15.01.2011, 11:26
You can just delete OnPlayerCommandText from your script and add two new callbacks instead.
But note that you don't need to add those callbacks, if you don't use them.
pawn Код:
/*
this callback is called when someone sends a command.
if you return 0 here, the command won't be performed.
*/
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED) //if wasted, can't perform commands
{
SendClientMessage(playerid, 0xFFFFFFFF, "Commands are temporary disabled.");
return 0;
}
return 1;
}
/*
this callback gets called after command execution, here if you do
"return 0" the player will see standard "Unknown command" message.
*/
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success)
{
return 1;
}
return 0;
}
//your command is here
CMD:test(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, COLOR_RED, "This is a test cmd");
return 1;
}