@@ -9,12 +9,12 @@ tags: ["player", "vehicle"]
99
1010Set the parameters of a vehicle for a player.
1111
12- | Name | Description |
13- | ---------------- | -------------------------------------------------------------------------------------------------------- |
14- | vehicle | The ID of the vehicle to set the parameters of. |
15- | playerid | The ID of the player to set the vehicle's parameters for. |
16- | bool : objective | 'false' to disable the objective or 'true' to show it. This is a bobbing yellow arrow above the vehicle. |
17- | bool : doorslocked | 'false' to unlock the doors or 'true' to lock them. |
12+ | Name | Description |
13+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
14+ | vehicle | The ID of the vehicle to set the parameters of. |
15+ | playerid | The ID of the player to set the vehicle's parameters for. |
16+ | objective | VEHICLE_PARAMS_OFF to disable the objective or VEHICLE_PARAMS_ON to show it. This is a bobbing yellow arrow above the vehicle. |
17+ | doorslocked | VEHICLE_PARAMS_OFF to unlock the doors or VEHICLE_PARAMS_ON to lock them. |
1818
1919## Returns
2020
@@ -26,16 +26,16 @@ Set the parameters of a vehicle for a player.
2626
2727``` c
2828// sometime earlier:
29- SetVehicleParamsForPlayer (iPlayerVehicle, iPlayerID, true, false );
29+ SetVehicleParamsForPlayer (iPlayerVehicle, iPlayerID, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_OFF );
3030
3131// sometime later when you want the vehicle to respawn:
3232new
33- bool : iEngine , bool : iLights , bool : iAlarm ,
34- bool : iDoors , bool : iBonnet , bool : iBoot ,
35- bool : iObjective ;
33+ iEngine, iLights, iAlarm,
34+ iDoors, iBonnet, iBoot,
35+ iObjective;
3636
3737GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective);
38- SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, false );
38+ SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, VEHICLE_PARAMS_OFF );
3939
4040// Locks own car for all players, except the player who used the command.
4141public OnPlayerCommandText(playerid, cmdtext[ ] )
@@ -61,17 +61,17 @@ public OnPlayerCommandText(playerid, cmdtext[])
6161}
6262
6363// Will show vehicle markers for players streaming in for 0.3a+
64- new bool : iVehicleObjective [ MAX_VEHICLES] [ 2] ;
64+ new iVehicleObjective[ MAX_VEHICLES] [ 2 ] ;
6565
6666public OnGameModeInit() //Or another callback
6767{
6868 new temp = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0, 0, -1); //ID 1
69- iVehicleObjective[ temp] [ 0 ] = true ; //Marker
70- iVehicleObjective[ temp] [ 1 ] = false ; //Door Lock
69+ iVehicleObjective[ temp] [ 0 ] = VEHICLE_PARAMS_ON ; //Marker
70+ iVehicleObjective[ temp] [ 1 ] = VEHICLE_PARAMS_OFF ; //Door Lock
7171 return 1;
7272}
7373
74- stock SetVehicleParamsForPlayerEx(vehicleid, playerid, bool : objective , bool : doorslocked )
74+ stock SetVehicleParamsForPlayerEx(vehicleid, playerid, objective, doorslocked)
7575{
7676 SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked);
7777 iVehicleObjective[ vehicleid] [ 0 ] = objective;
@@ -97,7 +97,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid)
9797{
9898 if (vehicleid == myMarkedCar)
9999 {
100- SetVehicleParamsForPlayer(myMarkedCar, forplayerid, true, false ); // marker can be visible only if the vehicle streamed for player
100+ SetVehicleParamsForPlayer(myMarkedCar, forplayerid, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_OFF ); // marker can be visible only if the vehicle streamed for player
101101 }
102102 return 1;
103103}
0 commit comments