Help with simple cmd
#1

When i write /kill its working fine but showing this:
SERVER:Unknown Command

Код:
CMD:kill(playerid,params[]) 
{   
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, C_RED, "You have killed yourself");
return 0;
}
Reply
#2

Код:
CMD:kill(playerid,params[]) 
{   
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, C_RED, "You have killed yourself");
return 1;
}
Changes:
- Changed "return 0;" to "return 1;" so it will know that the command is successfully executed and the servfer will not detect it as unknown command because in you "OnPlayerCommandPrompt" the "!success" is called when the command is not successfully executed and the message "Unknown command" is shown.
Reply
#3

Quote:
Originally Posted by K0P
Посмотреть сообщение
Код:
CMD:kill(playerid,params[]) 
{   
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, C_RED, "You have killed yourself");
return 1;
}
Changes:
- Changed "return 0;" to "return 1;" so it will know that the command is successfully executed and the servfer will not detect it as unknown command because in you "OnPlayerCommandPrompt" the "!success" is called when the command is not successfully executed and the message "Unknown command" is shown.
Thanks worked fine now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)