sorry for the double post, but I need some help with this again. I'm playing with it and tried to set the name into a var. So when the round starts, each player receives a message saying his/her name.
"Your name is London/Manchester/Hong-Kong/Santiago"
But it only says the number of the name and not the word. (Like "Your name is 9" instead of "Your name is name9")
PHP Code:
#include <amxmodx>
#include <fun>
const MAXPLAYERS = 33
new NameIndex[MAXPLAYERS]
new name[33]
new const g_szNames[MAXPLAYERS - 1][]=
{
"name1",
"name2",
"name3",
"name4",
"name5",
"name6",
"name7",
"name8",
"name9",
"name10",
"name11",
"name12",
"name13",
"name14",
"name15",
"name16",
"name17",
"name18",
"name19",
"name20",
"name21",
"name22",
"name23",
"name24",
"name25",
"name26",
"name27",
"name28",
"name29",
"name30",
"name31",
"name32"
}
new bool:NameUsed[sizeof g_szNames]
public plugin_init()
{
register_plugin("Names", "1.0", "Flicke3rR")
register_logevent("logevent_round_start", 2, "1=Round_Start")
}
public logevent_round_start()
{
for (new id = 0; id < 1; id++)
{
new iRand = random(sizeof g_szNames)
while(NameUsed[iRand])
iRand = random(sizeof g_szNames)
name[id] = iRand
NameUsed[iRand] = true
NameIndex[id] = iRand
client_print(id, print_chat, "Your name is %s", name[id])
}
return PLUGIN_HANDLED;
}
public client_disconnect(id)
NameUsed[NameIndex[id]] = false
Any ideas?