10.12.2018, 04:33
(
Последний раз редактировалось Altus; 10.12.2018 в 16:56.
)
Hi, in order to lock the vehicles for everyone but the members of the particular team, you should write something like the following (not compiled/tested, just a sketch):
You need to create the vehicles at OnGameModInit (or OnFilterScriptInit) with the CreateTeamVehicle function. Then, if a vehicle is streamed in for a member of the team, it will be unlocked, otherwise locked. Keep in mind that all the vehicles will still be unlocked for passengers.
Код:
#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)); }