SetVehicleParamsForPlayer
Description:
Function SetVehicleParamsForPlayer set the parameters of a vehicle for a player.
Vehicles must be respawned for the 'objective' to be removed. |
Since 0.3a you will have to reapply this function when OnVehicleStreamIn is called. |
Parameters:
(vehicleid, playerid, objective, doorslocked)
int | vehicleid | The ID of the vehicle to set the parameters of. |
int | playerid | The ID of the player to set the vehicle's parameters for. |
bool | objective | 0 to disable the objective or 1 to show it. This is a bobbing yellow arrow above the vehicle. |
bool | doorslocked | 0 to unlock the doors or 1 to lock them. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. The player and/or vehicle specified do not exist.
This can be circumvented somewhat using Get/SetVehicleParamsEx which do not require the vehicle to be respawned. It is worth noting however that the object will be disabled on a global scale, and this is only useful if only one player has the vehicle as an objective:
Examples:
// sometime earlier: SetVehicleParamsForPlayer(iPlayerVehicle, iPlayerID, 1, 0); // sometime later when you want the vehicle to respawn: new iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective; GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, 0);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetVehicleParamsEx: Sets a vehicle's params for all players.