06.12.2009, 07:53
Can someone help me.. I need a command that makes everyone freeze inside the server except for the user...and when someone types it they need to be rcon admin to do it pls help
new pFrozen[MAX_PLAYERS];
new AllFrozen;
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext[1],"freezeall",true)
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFF0000FF,"You are not authorized to use this command.");
if(!AllFrozen)
{
for(new player;player<MAX_PLAYERS;player++)
{
if(player==playerid)continue;
if(!pFrozen[player])
{
pFrozen[playerid]=1;
TogglePlayerControllable(playerid,0);
}
}
AllFrozen=1;
return 1;
}else{
for(new player;player<MAX_PLAYERS;player++)
{
if(pFrozen[player])
{
pFrozen[playerid]=0;
TogglePlayerControllable(playerid,1);
}
}
AllFrozen=0;
return 1;
}
}
return 0;
}
Originally Posted by Joe Staff
-10 rep @ Joe Staff, reason: spoon feeding.
|