17.08.2009, 22:40
The above poster is wrong.
You need to either return 1 or 0 under OnPlayerCommandText. 1 Passes it on to another script, 0 says "Server: Unknown command".
Put this:
If you want your own Wrong command message, replace return 0 with:
You need to either return 1 or 0 under OnPlayerCommandText. 1 Passes it on to another script, 0 says "Server: Unknown command".
Put this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/kill", true))
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, 0xFF8282AA, "SERVER: You have killed yourself!");
return 1;
}
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, LightBlue, "Checking");
return 1;
}
return 0;
}
pawn Код:
return SendClientMessage(playerid,RED,"That command doesn't exist!");