Team Gates
#1

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;
    }
Reply
#2

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

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

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;
    }
Reply
#5

Ty its work for me!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)