SetVehicleParamsEx
From SA-MP Wiki
Sets a vehicle's params for all players.
(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
| vehicleid | The ID of the vehicle to edit. |
| engine | Toggle the engine status on or off. |
| lights | Toggle the lights on or off. (only works at night) |
| alarm | Toggle the vehicle alarm on or off. |
| doors | Toggle the lock status of the doors. |
| bonnet | Toggle the bonnet to be opened or closed. |
| boot | Toggle the boot to be opened or closed. |
| objective | Toggle the objective status for the vehicle on or off. |
| Returns | This function doesn't return a specific value |
new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
Example:
new Timer_VehAlarm[MAX_VEHICLES]; SetVehicleParamsEx_Fixed(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective) { SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); if(alarm){ KillTimer(Timer_VehAlarm[vehicleid]); Timer_VehAlarm[vehicleid] = SetTimerEx("DisableVehicleAlarm", 20000, false, "d", vehicleid);} } forward DisableVehicleAlarm(vehicleid); public DisableVehicleAlarm(vehicleid) { new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, engine, lights, false, doors, bonnet, boot, objective); }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
