22.10.2013, 15:03
pawn Code:
new bool:Spawned[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Spawned[playerid] = false;
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
Spawned[playerid] = false;
return 1;
}
public OnPlayerSpawn(playerid)
{
Spawned[playerid] = true;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Spawned[playerid] = false;
return 1;
}
//Commands that you want to be disabled
CMD:mycommand1(playerid, params[])
{
if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command.");
//rest of command
return 1;
}
CMD:mycommand2(playerid, params[])
{
if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command.");
//rest of command
return 1;
}
//etc.