22.10.2013, 15:19
Yes, the second poster's code would work in the case of ZCMD. However, this will block pretty much ALL commands. However, let's say for example that you want players to be able to use /admins even if they aren't logged in.
ZCMD:
STRCMP:
ZCMD:
pawn Code:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/admins",true) != 0)
{
if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command");
}
return 1;
}
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/admins",true) != 0)
{
if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command");
}
return 1;
}