05.05.2011, 11:10
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//Every command here
return SendClientMessage(playerid, 0xAFAFAFAA, "Custom unknown command text");
}
pawn Код:
if(!strcmp(cmdtext, "/my_command"))
{
//Do something
return 1; //<--
}
After performing the command, it'll return '1' (or 'true'). If you have the following commands:
/my_command
/help
and if they both have, it will return the value '1'. If you don't perform one of those commands, it won't return the value '1', so it will automatic call the return at the end of onPlayerCommandText. You can compare it with this:
pawn Код:
switch(random(10))
{
case 0,1,2,3: print("0, 1, 2 or 3 was the random"); //if it is 0, 1, 2 or 3
default: print("The random was something else"); //if it's something else
}