Multi-Parameter Commands!
#7

Why would you need to make a switch? If you mean a /goto off for the "giveplayerid":

pawn Код:
new bool: Goto[MAX_PLAYERS][MAX_PLAYERS];
towards the top ^^

then, below the sscanf line

pawn Код:
if(Goto[giveplayerid][playerid] == true) return SendClientMessage(playerid, -1, "That player has disabled you from using /goto to TP to them!");
then something such as:
pawn Код:
CMD:disablegoto(playerid, params[])
{
      new giveplayerid;
      if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /disablegoto [playerid]");

      if(Goto[playerid][giveplayerid] == true)
      {
           Goto[playerid][giveplayerid] = false;
           SendClientMessage(playerid, -1, "That player can now TP to you again.");
      }

      else {
            Goto[playerid][giveplayerid] = true;
            SendClientMessage(playerid, -1, "That player can no longer TP to you.");
      }

      return 1;
}
Reply


Messages In This Thread
Multi-Parameter Commands! - by ironmen - 07.06.2015, 20:44
Re: Multi-Parameter Commands! - by Abagail - 07.06.2015, 20:51
Re: Multi-Parameter Commands! - by ironmen - 07.06.2015, 20:55
Re: Multi-Parameter Commands! - by ironmen - 07.06.2015, 21:00
Re: Multi-Parameter Commands! - by Abagail - 07.06.2015, 21:02
Re: Multi-Parameter Commands! - by ironmen - 07.06.2015, 21:04
Re: Multi-Parameter Commands! - by Abagail - 07.06.2015, 21:10
Re: Multi-Parameter Commands! - by ironmen - 08.06.2015, 05:30

Forum Jump:


Users browsing this thread: 3 Guest(s)