Hello there,
i'm a new little coder and want to recode a plugin.
Its this:
Hats
I tried to give every player a hat when he spawn first time on map.
Originalfunction of Hats:
PHP Code:
public Give_Hat(id)
{
new smodelnum[5], name[32]
read_argv(1,name,31)
read_argv(2,smodelnum,4)
new player = cmd_target(id,name,2)
if (!player) {
client_print(id,print_chat,"[%s] Player With That Name Does Not Exist.",PLUG_TAG)
return PLUGIN_HANDLED
}
new imodelnum = (str_to_num(smodelnum))
if (imodelnum > MAX_HATS) return PLUGIN_HANDLED
Set_Hat(player,imodelnum,id)
return PLUGIN_CONTINUE
}
But i only get the error "[HATS] Player With That Name Does not Exist" when i join the server and spawn the first time.
How i had to modify the command, which i send to client @ first spawn?
PHP Code:
new nick[33]
new model[2]
get_user_name (id,nick,32)
model = "1"; // Automatic Modelnr 1
client_cmd(id,"amx_givehat #%n %m",id,model)
Can someone help a little Codingnoob? :-/
Please.
Greets, Grinf4ce
__________________