SetVehicleParamsEx
From SA-MP Wiki
(Difference between revisions)
| Revision as of 05:01, 1 July 2011 Kwarde (Talk | contribs) ← Previous diff |
Revision as of 14:17, 25 September 2011 Code8976Man (Talk | contribs) Next diff → |
||
| Line 9: | Line 9: | ||
| {{Param|vehicleid|The ID of the vehicle to edit.}} | {{Param|vehicleid|The ID of the vehicle to edit.}} | ||
| {{Param|engine|Toggle the engine status on or off.}} | {{Param|engine|Toggle the engine status on or off.}} | ||
| - | {{Param|lights|Toggle the lights on or off. (only works at night)}} | + | {{Param|lights|Toggle the lights on or off.}} |
| {{Param|alarm|Toggle the vehicle alarm on or off.}} | {{Param|alarm|Toggle the vehicle alarm on or off.}} | ||
| {{Param|doors|Toggle the lock status of the doors.}} | {{Param|doors|Toggle the lock status of the doors.}} | ||
| Line 26: | Line 26: | ||
| {{note|The alarm will not reset itself when it's over, you'll need to reset it by yourself.}} | {{note|The alarm will not reset itself when it's over, you'll need to reset it by yourself.}} | ||
| - | {{note|There's been said that lights only works at night. Wrong, it also works in daylight.}} | + | {{note|Lights also operate during the day.}} |
| Example: | Example: | ||
Revision as of 14:17, 25 September 2011
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. |
| 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.
