23.02.2014, 18:26
I have a problem in a zcmd command will changes the player skin.
here is the code :
if the player types /player_skin gets "Usage: /skin <skinid>" this one is correct
if player types /player_skin 0~299 changes the skin this one is correct
BUT if typed a number greater than 299 (e.g 300) types "u can't use" but types a line which writed "SERVER: Unknown command."
i want just write "u cant use" without the error (SERVER: Unknown command.).
if the return changed to 1 game crashes.
here is the code :
PHP Code:
CMD:player_skin(playerid, params[])
{
new skinid;
if (sscanf(params, "i", skinid))
{
return SendClientMessage(playerid, 0xBE6C97FF, "Usage: /skin <skinid>");
}
if (skinid > 299)
{
SendClientMessage(playerid, 0x5A00FFFF, "u can't use");
return 0;
}
SetPlayerSkin(playerid, skinid);
return 1;
}
if player types /player_skin 0~299 changes the skin this one is correct
BUT if typed a number greater than 299 (e.g 300) types "u can't use" but types a line which writed "SERVER: Unknown command."
i want just write "u cant use" without the error (SERVER: Unknown command.).
if the return changed to 1 game crashes.