public OnPlayerCommandRecieved(playerid, cmdtext[])
{
if(Player[playerid][IsLoggedIn] == false) return GameTextForPlayer(playerid, "~w~You need to be ~r~logged in ~w~to use commands!", 3000, 4), 0;
if(Player[playerid][PlayerSpawned] == false) return GameTextForPlayer(playerid, "~w~You must be ~r~alive ~w~to use commands!", 3000, 4), 0;
return 1;
}
public OnPlayerCommandRecieved(playerid, cmdtext[]) { if(!Player[playerid][IsLoggedIn]) { GameTextForPlayer(playerid, "~w~You need to be ~r~logged in ~w~to use commands!", 3000, 4); return 0; } if(!Player[playerid][PlayerSpawned]) { GameTextForPlayer(playerid, "~w~You must be ~r~alive ~w~to use commands!", 3000, 4); return 0; } return 1; }
public OnPlayerCommandRecieved(playerid, cmdtext[]) { if(Player[playerid][IsLoggedIn] == false) return GameTextForPlayer(playerid, "~w~You need to be ~r~logged in ~w~to use commands!", 3000, 4), 0; if(Player[playerid][PlayerSpawned] == false) return GameTextForPlayer(playerid, "~w~You must be ~r~alive ~w~to use commands!", 3000, 4), 0; return 1; } } |
public OnPlayerCommandRecieved(playerid, cmdtext[]) { if(Player[playerid][IsLoggedIn] = 0) return GameTextForPlayer(playerid, "~w~You need to be ~r~logged in ~w~to use commands!", 3000, 4), 0; if(Player[playerid][PlayerSpawned] = 0) return GameTextForPlayer(playerid, "~w~You must be ~r~alive ~w~to use commands!", 3000, 4), 0; return 1; } public OnPlayerSpawn(playerid) { Player[playerid][IsLoggedIn] = 1; Player[playerid][PlayerSpawned] = 1; return 1; } public OnPlayerDeath(playerid) { Player[playerid][PlayerSpawned] = 0; return 1; } |
The return value of GameTextForPlayer is undefined. Return a proper value.
|
public OnPlayerCommandReceived(playerid, cmd[], params[], flags) { if(!Player[playerid][IsLoggedIn]) return false; return true; }