Thread: [Plugin] Pawn.CMD
View Single Post
Old 15/05/2020, 08:55 AM   #466
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: Pawn.CMD

I'm trying to restrict players from using commands if they're not logged in at first, and then spawned. But this doesn't work.
Code:
forward OnPlayerCommandRecieved(playerid, cmd[], params[], flags);
public OnPlayerCommandRecieved(playerid, cmd[], params[], flags)
{
    if(loggedin[playerid] == 0)
    {
	 SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF}You have to be logged in first.");
         return 0;
    }
	
    if(playerspawned[playerid] == 0)
    {
	 SendClientMessage(playerid, COLOR_RED, "Error: {FFFFFF}You have to be spawned first.");
	 return 0;
    }
    return 1;
}
Mike861 is offline   Reply With Quote