SA-MP Forums Archive
Team Gates - 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: Team Gates (/showthread.php?tid=180187)



Team Gates - GangsTa_ - 30.09.2010

Hello. There. I am going to make some gates that only SWAT can open, yeah, I defined the teams (Team ID is 1 for SWAT)
Here are my gate codes:
pawn Код:
if (strcmp("/swdeschide", cmdtext, true, 10) == 0)
    {
        MoveObject(swatgate, 1632.111,-1849.007,15.385, 3.0);
        SendClientMessage(playerid, COLOR_CYAN, "SWAT Poarta Deschisa");
        return 1;
    }
if (strcmp("/swinchide", cmdtext, true, 10) == 0)
    {
        MoveObject(swatgate, 1622.170,-1849.053,15.266, 3.0);
        SendClientMessage(playerid, COLOR_CYAN, "SWAT Poarta Inchisa");
        return 1;
    }



Re: Team Gates - LarzI - 30.09.2010

pawn Код:
if( your_team_variable_or_function == 1 )
//do your thang



Re: Team Gates - GangsTa_ - 05.10.2010

I have gTeam[playerid] can you give me example?


Re: Team Gates - LarzI - 05.10.2010

Sure

pawn Код:
if (strcmp("/swdeschide", cmdtext, true, 10) == 0)
    {
        if(gTeam[playerid] != TEAM_SWAT) //player is NOT SWAT
            return SendClientMessage(playerid, 0xFF0000FF, "SWAT players only!");
        MoveObject(swatgate, 1632.111,-1849.007,15.385, 3.0);
        SendClientMessage(playerid, COLOR_CYAN, "SWAT Poarta Deschisa");
        return 1;
    }
    if (strcmp("/swinchide", cmdtext, true, 10) == 0)
    {
        if(gTeam[playerid] != TEAM_SWAT) //player is NOT SWAT
            return SendClientMessage(playerid, 0xFF0000FF, "SWAT players only!");
        MoveObject(swatgate, 1622.170,-1849.053,15.266, 3.0);
        SendClientMessage(playerid, COLOR_CYAN, "SWAT Poarta Inchisa");
        return 1;
    }



Re: Team Gates - Hoss - 17.10.2010

Ty its work for me!!!