SA-MP Forums Archive
Restrict teleport - 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: Restrict teleport (/showthread.php?tid=109629)



Restrict teleport - Galcio - 21.11.2009

Hey,

I got two teams in my GM, grove street and ballas. I wonder how to restrict a teleport command only for (example) ballas. I know there's a restrict command for admins, IsPlayerAdmin or something. But is there something similar for teams?

I appreciate any help!


Re: Restrict teleport - thiaZ_ - 21.11.2009

pawn Код:
new TEAM[MAX_PLAYERS];

OnPlayerClassRequest(playerid,classid)
{
  if(classid == 0) //Your Grove Classid(s)
  {
    TEAM[playerid] = 1; //1 stands for grove
  }
  if(classid == 1) //Your Ballas Classid(s)
  {
    TEAM[playerid] = 2; //2 stands for ballas
  }
}
...

//onplayercommandtext...
if(!strcmp(cmdtext, "/groveteleport", true, 14))
{
  if(TEAM[playerid] == 1) //check if the player is grove
  {
   .... //if yes
  }
  else
  {
    SendClientMessage(playerid,0xFFFFFFFF,"This teleport is only for Grove Homies"); //if no
  }
  return 1;
}
here ya got...