Skip to content

Commit 4874d97

Browse files
authored
Merge pull request #1142 from leamir/patch-1
Fix some GetVehicleParams types
2 parents eb33fbf + e3304ae commit 4874d97

File tree

7 files changed

+49
-49
lines changed

7 files changed

+49
-49
lines changed

frontend/docs/scripting/functions/GetVehicleParamsCarDoors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Allows you to retrieve the current state of a vehicle's doors
1414
| Name | Description |
1515
| ---------------- | ----------------------------------------------------------------------- |
1616
| vehicleid | The ID of the vehicle |
17-
| &bool:frontLeft | The integer to save the state of the driver's door to. |
18-
| &bool:frontRight | The integer to save the state of the passenger's door to. |
19-
| &bool:rearLeft | The integer to save the state of the rear left door to (if available). |
20-
| &bool:rearRight | The integer to save the state of the rear right door to (if available). |
17+
| &frontLeft | The integer to save the state of the driver's door to. |
18+
| &frontRight | The integer to save the state of the passenger's door to. |
19+
| &rearLeft | The integer to save the state of the rear left door to (if available). |
20+
| &rearRight | The integer to save the state of the rear right door to (if available). |
2121

2222
## Returns
2323

frontend/docs/scripting/functions/GetVehicleParamsCarWindows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Allows you to retrieve the current state of a vehicle's windows
1414
| Name | Description |
1515
| ---------------- | ------------------------------------------------------------------------- |
1616
| vehicleid | The ID of the vehicle |
17-
| &bool:frontLeft | The integer to save the state of the drivers window to. |
18-
| &bool:frontRight | The integer to save the state of the passengers window to. |
19-
| &bool:rearLeft | The integer to save the state of the rear left window to (if available). |
20-
| &bool:rearRight | The integer to save the state of the rear right window to (if available). |
17+
| &frontLeft | The integer to save the state of the drivers window to. |
18+
| &frontRight | The integer to save the state of the passengers window to. |
19+
| &rearLeft | The integer to save the state of the rear left window to (if available). |
20+
| &rearRight | The integer to save the state of the rear right window to (if available). |
2121

2222
## Returns
2323

frontend/docs/scripting/functions/GetVehicleParamsEx.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Gets a vehicle's parameters.
1212
| Name | Description |
1313
| --------------- | ------------------------------------------------------------------- |
1414
| vehicleid | The ID of the vehicle to get the parameters from. |
15-
| &bool:engine | Get the engine status. If 1, the engine is running.. |
16-
| &bool:lights | Get the vehicle's lights' state. If 1 the lights are on. |
17-
| &bool:alarm | Get the vehicle's alarm state. If 1 the alarm is (or was) sounding. |
18-
| &bool:doors | Get the lock status of the doors. If 1 the doors are locked. |
19-
| &bool:bonnet | Get the bonnet/hood status. If 1, it's open. |
20-
| &bool:boot | Get the boot/trunk status. 1 means it is open. |
21-
| &bool:objective | Get the objective status. 1 means the objective is on. |
15+
| &engine | Get the engine status. If 1, the engine is running.. |
16+
| &lights | Get the vehicle's lights' state. If 1 the lights are on. |
17+
| &alarm | Get the vehicle's alarm state. If 1 the alarm is (or was) sounding. |
18+
| &doors | Get the lock status of the doors. If 1 the doors are locked. |
19+
| &bonnet | Get the bonnet/hood status. If 1, it's open. |
20+
| &boot | Get the boot/trunk status. 1 means it is open. |
21+
| &objective | Get the objective status. 1 means the objective is on. |
2222

2323
## Returns
2424

@@ -32,7 +32,7 @@ The vehicle's parameters are stored in the referenced variables, not in the retu
3232

3333
```c
3434
new
35-
bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective;
35+
engine, lights, alarm, doors, bonnet, boot, objective;
3636
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
3737
//This would cause all the variable above, to become the status of its subject.
3838
```

frontend/docs/scripting/functions/SetVehicleParamsCarDoors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Allows you to open and close the doors of a vehicle.
1414
| Name | Description |
1515
| --------------- | ----------------------------------------------------------------------- |
1616
| vehicleid | The ID of the vehicle to set the door state of |
17-
| bool:frontLeft | The state of the driver's door. 1 to open, 0 to close. |
18-
| bool:frontRight | The state of the passenger door. 1 to open, 0 to close. |
19-
| bool:rearLeft | The state of the rear left door (if available). 1 to open, 0 to close. |
20-
| bool:rearRight | The state of the rear right door (if available). 1 to open, 0 to close. |
17+
| frontLeft | The state of the driver's door. 1 to open, 0 to close. |
18+
| frontRight | The state of the passenger door. 1 to open, 0 to close. |
19+
| rearLeft | The state of the rear left door (if available). 1 to open, 0 to close. |
20+
| rearRight | The state of the rear right door (if available). 1 to open, 0 to close. |
2121

2222
## Returns
2323

frontend/docs/scripting/functions/SetVehicleParamsCarWindows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Allows you to open and close the windows of a vehicle.
1414
| Name | Description |
1515
| --------------- | ------------------------------------------------------------------------- |
1616
| vehicleid | The ID of the vehicle to set the window state of |
17-
| bool:frontLeft | The state of the driver's window. 0 to open, 1 to close. |
18-
| bool:frontRight | The state of the passenger window. 0 to open, 1 to close. |
19-
| bool:rearLeft | The state of the rear left window (if available). 0 to open, 1 to close. |
20-
| bool:rearRight | The state of the rear right window (if available). 0 to open, 1 to close. |
17+
| frontLeft | The state of the driver's window. 0 to open, 1 to close. |
18+
| frontRight | The state of the passenger window. 0 to open, 1 to close. |
19+
| rearLeft | The state of the rear left window (if available). 0 to open, 1 to close. |
20+
| rearRight | The state of the rear right window (if available). 0 to open, 1 to close. |
2121

2222
## Returns
2323

frontend/docs/scripting/functions/SetVehicleParamsEx.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Sets a vehicle's parameters for all players.
1212
| Name | Description |
1313
| -------------- | --------------------------------------------------------------- |
1414
| vehicleid | The ID of the vehicle to set the parameters of. |
15-
| bool:engine | Engine status. 0 - Off, 1 - On. |
16-
| bool:lights | Light status. 0 - Off, 1 - On. |
17-
| bool:alarm | Vehicle alarm status. If on, the alarm starts. 0 - Off, 1 - On. |
18-
| bool:doors | Door lock status. 0 - Unlocked, 1 - Locked. |
19-
| bool:bonnet | Bonnet (hood) status. 0 - Closed, 1 - Open. |
20-
| bool:boot | Boot/trunk status. 0 - Closed, 1 - Open. |
21-
| bool:objective | Toggle the objective arrow above the vehicle. 0 - Off, 1 - On. |
15+
| engine | Engine status. 0 - Off, 1 - On. |
16+
| lights | Light status. 0 - Off, 1 - On. |
17+
| alarm | Vehicle alarm status. If on, the alarm starts. 0 - Off, 1 - On. |
18+
| doors | Door lock status. 0 - Unlocked, 1 - Locked. |
19+
| bonnet | Bonnet (hood) status. 0 - Closed, 1 - Open. |
20+
| boot | Boot/trunk status. 0 - Closed, 1 - Open. |
21+
| objective | Toggle the objective arrow above the vehicle. 0 - Off, 1 - On. |
2222

2323
## Returns
2424

@@ -35,7 +35,7 @@ new
3535

3636
// If setting a single parameter, you should obtain the current parameters so they aren't ALL changed
3737
new
38-
bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective;
38+
engine, lights, alarm, doors, bonnet, boot, objective;
3939

4040
// Somewhere where you create the vehicle..
4141
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
@@ -58,7 +58,7 @@ forward DisableVehicleAlarm(vehicleid);
5858
public DisableVehicleAlarm(vehicleid)
5959
{
6060
new
61-
bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective;
61+
engine, lights, alarm, doors, bonnet, boot, objective;
6262

6363
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
6464
if (alarm == VEHICLE_PARAMS_ON)

frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ tags: ["player", "vehicle"]
99

1010
Set 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:
3232
new
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

3737
GetVehicleParamsEx(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.
4141
public 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

6666
public 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

Comments
 (0)