Restrict teleport
#1

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!
Reply
#2

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)