how to make these cars only for national guard
#1

hey how can i make these only for national guard faction number 11

+rep for who helps

Код:
AddStaticVehicle(470,1522.80004883,-1459.80004883,9.60000038,177.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1518.30004883,-1459.59997559,9.60000038,177.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1513.50000000,-1460.00000000,9.60000038,177.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1513.30004883,-1467.59997559,9.60000038,273.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1513.69995117,-1471.59997559,9.60000038,273.99353027,-1,-1); //Patriot
AddStaticVehicle(470,1538.00000000,-1476.00000000,9.60000038,1.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1518.09997559,-1445.69995117,13.50000000,272.00000000,-1,-1); //Patriot
AddStaticVehicle(470,1511.50000000,-1445.69995117,13.50000000,271.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1512.19995117,-1435.69995117,13.50000000,87.99499512,-1,-1); //Patriot
AddStaticVehicle(470,1519.40002441,-1435.80004883,13.50000000,87.99499512,-1,-1); //Patriot
AddStaticVehicle(548,1531.00000000,-1461.50000000,69.00000000,0.00000000,-1,-1); //Cargobob
AddStaticVehicle(425,1508.69995117,-1461.40002441,68.00000000,0.00000000,-1,-1); //Hunter
AddStaticVehicle(487,1520.30004883,-1461.69995117,67.40000153,0.00000000,-1,-1); //Maverick
Reply
#2

edit wont work
Reply
#3

Easy, check under the callback OnPlayerEnterVehicle check either for the models of the vehicles or the vehicle ids, you can retrieve them by doing this;

pawn Код:
new NGVehiclesId[13];
public OnGameModeInit()
{
    NGVehiclesId[0] = AddStaticVehicle(470,1522.80004883,-1459.80004883,9.60000038,177.99499512,-1,-1); //Patriot
    NGVehiclesId[1] = AddStaticVehicle(470,1518.30004883,-1459.59997559,9.60000038,177.99499512,-1,-1); //Patriot
    NGVehiclesId[2] = AddStaticVehicle(470,1513.50000000,-1460.00000000,9.60000038,177.99499512,-1,-1); //Patriot
    NGVehiclesId[3] = AddStaticVehicle(470,1513.30004883,-1467.59997559,9.60000038,273.99499512,-1,-1); //Patriot
    NGVehiclesId[4] = AddStaticVehicle(470,1513.69995117,-1471.59997559,9.60000038,273.99353027,-1,-1); //Patriot
    NGVehiclesId[5] = AddStaticVehicle(470,1538.00000000,-1476.00000000,9.60000038,1.99499512,-1,-1); //Patriot
    NGVehiclesId[6] = AddStaticVehicle(470,1518.09997559,-1445.69995117,13.50000000,272.00000000,-1,-1); //Patriot
    NGVehiclesId[7] = AddStaticVehicle(470,1511.50000000,-1445.69995117,13.50000000,271.99499512,-1,-1); //Patriot
    NGVehiclesId[8] = AddStaticVehicle(470,1512.19995117,-1435.69995117,13.50000000,87.99499512,-1,-1); //Patriot
    NGVehiclesId[9] = AddStaticVehicle(470,1519.40002441,-1435.80004883,13.50000000,87.99499512,-1,-1); //Patriot
    NGVehiclesId[10] = AddStaticVehicle(548,1531.00000000,-1461.50000000,69.00000000,0.00000000,-1,-1); //Cargobob
    NGVehiclesId[11] = AddStaticVehicle(425,1508.69995117,-1461.40002441,68.00000000,0.00000000,-1,-1); //Hunter
    NGVehiclesId[12] = AddStaticVehicle(487,1520.30004883,-1461.69995117,67.40000153,0.00000000,-1,-1); //Maverick
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    for(new v = 0; v < sizeof(NGVehiclesId); v++) {
        if(vehicleid == NGVehiclesId[v] && PlayerFaction[playerid] != 11) RemovePlayerFromVehicle(playerid); // Change PlayerFaction to whichever variable you use to store the player's faction.
    }
}
Note this will only remove a player for the vehicle ids stored in NGVehiclesId.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)