Resolved [ZE] Nick Changer Problem with Array

Coding Help/Re-API Supported
Post Reply
Mystic Viper
Member
Member
Romania
Posts: 99
Joined: 10 Months Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

[ZE] Nick Changer Problem with Array

#1

Post by Mystic Viper » 3 Months Ago

  1. #include <amxmodx>
  2.  
  3. new const g_names[][] =
  4. {
  5.     "PLAYARENA",
  6.     "SilentGamerz.com",
  7.     "<Warrior> Player",
  8.     "Player",
  9.     "RCPlayer",
  10.     "JOINGAME",
  11.     "Evils",
  12.     "hentai-squad.com",
  13.     "progaming.ba",
  14.     "progaming",
  15.     "GUNGAME.SLADERS.RO",
  16.     "Www.RG-ZONE.RO",
  17.     "Join Us @SilentGamerz.Org",
  18.     "ZE.VIPGAME.RO",
  19.     "VIPGAME",
  20.     "Rs.Only-Games.rO",
  21.     "unnamed",
  22.     "Toxic-Gamers.net>>ZE# 1",
  23.     "Zombie.Devilx.Ro",
  24.     "zc.csone.ro",
  25.     "csone",
  26.     "178.32.241.10",
  27.     "pro@Silent.Gamerz.com",
  28.     "ZE | ULTRACS | RO"
  29.      
  30. }
  31. new g_sizeof_names = sizeof g_names
  32.  
  33. new const g_names_new[][] =
  34. {
  35.     "ZE | WSTRIKE | RO", //Aici pui tu in ce nume sa se schimbe
  36.     "ZE | WSTRIKE | RO" //Si aici aceeasi treaba
  37. }
  38. new g_sizeof_names_new = sizeof g_names_new - 1
  39.  
  40. new g_filter_chars[29] = " ~`@#$%&*()-_=+\|[{]};',<>/?" //^"
  41. //new g_sizeof_filter = sizeof g_filter_chars
  42.  
  43. new g_names_changed = 1
  44.  
  45. public plugin_init()
  46.     register_plugin("[ZE] Nick Changer Ultra", "1.0", "Legolas")
  47.  
  48. public client_connect(id)
  49.     verify_name(id)
  50.  
  51. public client_infochanged(id)
  52. {
  53.     if (!is_user_connected(id))
  54.         return;
  55.    
  56.     verify_name(id)
  57. }
  58.  
  59. verify_name(id)
  60. {
  61.     static name[32]
  62.     get_user_info(id, "name", name, 31)
  63.    
  64.     static i, ignore
  65.     ignore = false
  66.    
  67.     for (i = 0; i <= g_sizeof_names_new; i++)
  68.         if (containi(name, g_names_new) != -1)
  69.         {
  70.             ignore = true
  71.             break;
  72.         }
  73.    
  74.     if (ignore)
  75.         return;
  76.    
  77.     for (i = 0; i < 29; i++)
  78.         replace_all(name, 31, g_filter_chars, "")
  79.    
  80.     for (i = 0; i < g_sizeof_names; i++)
  81.         if (containi(name, g_names) != -1)
  82.         {
  83.             formatex(name, 31, "%s [%d]", g_names_new[random_num(0, g_sizeof_names_new)], g_names_changed)
  84.             set_user_info(id, "name", name)
  85.             client_cmd(id, "name ^"%s^"", name)
  86.             g_names_changed++
  87.         }
  88. }
  89. }
I tried my plugin and get 2 errors on compiler:

ze_nick_changer_new.sma(68) : error 048: array dimensions do not match
ze_nick_changer_new.sma(81) : error 048: array dimensions do not match

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1961
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 3 Months Ago

Line 68 change g_names_new to g_names_new[i]
Line 81 change g_names to g_names[i]

And remove '}' at line 89
Last edited by Raheem on 23 May 2019, 15:14, edited 3 times in total.
Reason: FIXED
You don't know? Learn and you will know.

Mystic Viper
Member
Member
Romania
Posts: 99
Joined: 10 Months Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

#3

Post by Mystic Viper » 3 Months Ago

same error

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1961
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#4

Post by Raheem » 3 Months Ago

I updated the post, sorry for this.
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests