Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Server Factions

$
0
0
Code:

new pTeam[MAX_PLAYERS];

#define team_civili 0
#define team_policija 1
#define team_mafija 2

#define team_police_cars 25
#define team_mafija_cars 10

new PoliceCar[team_police_cars];
new MafijaCar[team_mafija_cars];

public OnGameModeInit()
{
        PoliceCar[0] = CreateVehicle(599, -234.9609, 975.8903, -27.7522, -90.0000, 1, 1, 4000);
        SetVehicleNumberPlate(PoliceCar[0], "Sheriff");
        PoliceCar[1] = CreateVehicle(599, -234.9609, 971.8903, -27.7522, -90.0000, 1, 1, 4000);
        SetVehicleNumberPlate(PoliceCar[1], "Sheriff");
        /////////////////////////////////////////////////////
        MafijaCar[0] = CreateVehicle(599, -234.9609, 975.8903, -27.7522, -90.0000, 1, 1, 4000);
        MafijaCar[1] = CreateVehicle(599, -234.9609, 971.8903, -27.7522, -90.0000, 1, 1, 4000);
        /////////////////////////////////////////////////////
        return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        for(new i = 0; i < sizeof(PoliceCar); i ++)
        {
          if(vehicleid == PoliceCar[i] && !pTeam[playerid] == 1)
            {
                        ClearAnimations(playerid);
                        GameTextForPlayer(playerid,"~r~ Policija",2000,4);
            }
        }
        for(new i = 0; i < sizeof(MafijaCar); i ++)
        {
            if(vehicleid == MafijaCar[i] && !pTeam[playerid] == 2)
            {
                        ClearAnimations(playerid);
                        GameTextForPlayer(playerid,"~r~ Mafija",2000,4);
            }
        }
        return 1;
}

So when I try to enter a police vehicle it says POLICIJA and I cant get in,I can get in other cars.
WHY?
What am I missing?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>