Solved [ZE] Nick Changer Problem with Array

Coding Help/Re-API Supported
Post Reply
Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

[ZE] Nick Changer Problem with Array

#1

Post by Templaso » 4 years 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
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 4 years 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 4 years ago, edited 3 times in total.
Reason: FIXED
He who fails to plan is planning to fail

Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

#3

Post by Templaso » 4 years ago

same error

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 4 years ago

I updated the post, sorry for this.
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 3 guests