Quote:
Originally Posted by BenzoAMG
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:
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; }
STRCMP:
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; }
|
Wow nice! Anyway as you said it will block all commands. But do you think is there any other way to exempt this /admins command somewhere here?
Code:
if(pInfo[playerid][Spawned] == 0)
{
SendClientMessage(playerid, -1, "You have to be logged in.");
return 0;
}