From SA-MP Wiki
| This Function was added in SA-MP 0.3c and will not work in earlier versions!
|
Sets a vehicle's parameters for all players.
Parameters:(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
| vehicleid | The ID of the vehicle to set the parameters of. |
| engine | Toggle the engine status on or off (0/1). |
| lights | Toggle the lights on or off (0/1). |
| alarm | Toggle the vehicle alarm on or off (0/1). |
| doors | Toggle the lock status of the doors (0/1). |
| bonnet | Toggle the bonnet to be open or closed (0/1). |
| boot | Toggle the boot to be open or closed (0/1). |
| objective | Toggle the objective status for the vehicle on or off (0/1). |
| Returns | This function doesn't return a specific value |
// If setting a single parameter, you should obtain the current parameters so they aren't ALL changed
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
| Notes:
- The alarm will not reset when finished, you'll need to reset it by yourself with this function.
- Lights also operate during the day.
|
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.