Resolved [ZE] Nick Changer Problem with Array

Coding Help/Re-API Supported
Post Reply
Mystic Viper
Senior Member
Senior Member
Romania
Posts: 115
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 4 times
Contact:

[ZE] Nick Changer Problem with Array

#1

Post by Mystic Viper » 1 Year 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.     "ZE | ULTRACS | RO"
  28.      
  29. }
  30. new g_sizeof_names = sizeof g_names
  31.  
  32. new const g_names_new[][] =
  33. {
  34.     "ZE | WSTRIKE | RO", //Aici pui tu in ce nume sa se schimbe
  35.     "ZE | WSTRIKE | RO" //Si aici aceeasi treaba
  36. }
  37. new g_sizeof_names_new = sizeof g_names_new - 1
  38.  
  39. new g_filter_chars[29] = " ~`@#$%&*()-_=+\|[{]};',<>/?" //^"
  40. //new g_sizeof_filter = sizeof g_filter_chars
  41.  
  42. new g_names_changed = 1
  43.  
  44. public plugin_init()
  45.     register_plugin("[ZE] Nick Changer Ultra", "1.0", "Legolas")
  46.  
  47. public client_connect(id)
  48.     verify_name(id)
  49.  
  50. public client_infochanged(id)
  51. {
  52.     if (!is_user_connected(id))
  53.         return;
  54.    
  55.     verify_name(id)
  56. }
  57.  
  58. verify_name(id)
  59. {
  60.     static name[32]
  61.     get_user_info(id, "name", name, 31)
  62.    
  63.     static i, ignore
  64.     ignore = false
  65.    
  66.     for (i = 0; i <= g_sizeof_names_new; i++)
  67.         if (containi(name, g_names_new) != -1)
  68.         {
  69.             ignore = true
  70.             break;
  71.         }
  72.    
  73.     if (ignore)
  74.         return;
  75.    
  76.     for (i = 0; i < 29; i++)
  77.         replace_all(name, 31, g_filter_chars, "")
  78.    
  79.     for (i = 0; i < g_sizeof_names; i++)
  80.         if (containi(name, g_names) != -1)
  81.         {
  82.             formatex(name, 31, "%s [%d]", g_names_new[random_num(0, g_sizeof_names_new)], g_names_changed)
  83.             set_user_info(id, "name", name)
  84.             client_cmd(id, "name ^"%s^"", name)
  85.             g_names_changed++
  86.         }
  87. }
  88. }
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: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 115 times
Age: 22
Contact:

#2

Post by Raheem » 1 Year 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
Loading Raheem's signature, Please wait...
Image

Mystic Viper
Senior Member
Senior Member
Romania
Posts: 115
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 4 times
Contact:

#3

Post by Mystic Viper » 1 Year Ago

same error

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 115 times
Age: 22
Contact:

#4

Post by Raheem » 1 Year Ago

I updated the post, sorry for this.
Loading Raheem's signature, Please wait...
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests