Freeze & Unfreeze.
#3

pawn Код:
if(strcmp(cmd, "/unfreeze", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /unfreeze [playerid/partofname]");
                return 1;
            }
            new playa;
            playa = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
              if(IsPlayerConnected(playa))
              {
                if(playa != INVALID_PLAYER_ID)
                {
                        TogglePlayerControllable(playa, 1);
                        format(string, sizeof(string), "You got unfrozen by %s",sendername);
                        SendClientMessage(playa,COLOR_RED,string);
                        format(string, sizeof(string), "You've unfrozen %s",giveplayer);
                        SendClientMessage(playerid,COLOR_RED,string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "Attempt denied! You are not authorized to use that command!");
            }
        }
        return 1;
    }
if(strcmp(cmd, "/freeze", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /unfreeze [playerid/partofname]");
                return 1;
            }
            new playa;
            playa = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
              if(IsPlayerConnected(playa))
              {
                if(playa != INVALID_PLAYER_ID)
                {
                        TogglePlayerControllable(playa, 0);
                        format(string, sizeof(string), "You got frozen by %s",sendername);
                        SendClientMessage(playa,COLOR_RED,string);
                        format(string, sizeof(string), "You frozen %s",giveplayer);
                        SendClientMessage(playerid,COLOR_RED,string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "Attempt denied! You are not authorized to use that command!");
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Freeze & Unfreeze. - by Landon - 03.04.2010, 17:00
Re: Freeze & Unfreeze. - by pmk1 - 03.04.2010, 17:07
Re: Freeze & Unfreeze. - by Landon - 03.04.2010, 17:08
Re: Freeze & Unfreeze. - by pmk1 - 03.04.2010, 17:13
Re: Freeze & Unfreeze. - by Landon - 03.04.2010, 17:29
Re: Freeze & Unfreeze. - by Landon - 03.04.2010, 20:33
Re: Freeze & Unfreeze. - by aircombat - 03.04.2010, 20:57
Re: Freeze & Unfreeze. - by Landon - 04.04.2010, 07:50
Re: Freeze & Unfreeze. - by aircombat - 04.04.2010, 10:07

Forum Jump:


Users browsing this thread: 1 Guest(s)