09.12.2018, 13:15
How to create vehicles belonging to a gang?
For this gamemode:
https://sampforum.blast.hk/showthread.php?tid=590991
For this gamemode:
https://sampforum.blast.hk/showthread.php?tid=590991
new GangCar[3][2]; Vehicles() { GangCar[0][0] = AddStaticVehicleEx(560, 2488.8835, -1682.5499, 12.9978, 88.5095, 234, 0, 60*4); //GrovesCar GangCar[0][1] = AddStaticVehicleEx(560, 2505.8076, -1676.9358, 13.0382, 145.1543, 234, 0, 60*4); //GrovesCar GangCar[1][0] = AddStaticVehicleEx(566, 1942.0941, -1131.7699, 25.1147, 269.9582, 242, 0, 60*4); //BallasCar GangCar[1][1] = AddStaticVehicleEx(566, 1922.3245, -1131.7358, 24.7656, 269.2967, 242, 0, 60*4); //BallasCar GangCar[2][0] = AddStaticVehicleEx(467, 2456.3350, -1270.5421, 23.6457, 180.9951, 6, 6, 60*4); //VagosCar GangCar[2][1] = AddStaticVehicleEx(467, 2445.8972, -1271.0826, 23.6627, 179.5045, 6, 6, 60*4); //VagosCar }
#define TEAMS 10 new number_of_vehicles[TEAMS]; new team_vehicles[MAX_VEHICLES] = { INVALID_VEHICLE_ID, ... }; CreateTeamVehicle(team_id, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2) { if (team_id < 0 || team_id >= TEAMS) return INVALID_VEHICLE_ID; new vehicle_id = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2); team_vehicles[vehicle_id] = team_id; return vehicle_id; } GetVehicleTeam(vehicleid) { return team_vehicles[vehicleid]; } public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, GetPlayerTeam(forplayerid) != GetVehicleTeam(vehicleid)); }