SA-MP Forums Archive
Freeze || Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Freeze || Command (/showthread.php?tid=112192)



Freeze || Command - Asylum - 06.12.2009

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


Re: Freeze || Command - Joe Staff - 06.12.2009

This is lame.

pawn Код:
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;
}
-10 rep @ Joe Staff, reason: spoon feeding.


Re: Freeze || Command - DJDhan - 06.12.2009

Quote:
Originally Posted by Joe Staff
-10 rep @ Joe Staff, reason: spoon feeding.
LOL XD