diff --git a/docs/scripting/callbacks/OnEnterExitModShop.md b/docs/scripting/callbacks/OnEnterExitModShop.md index 1a7d3b099..36e1f4963 100644 --- a/docs/scripting/callbacks/OnEnterExitModShop.md +++ b/docs/scripting/callbacks/OnEnterExitModShop.md @@ -1,7 +1,7 @@ --- title: OnEnterExitModShop description: This callback is called when a player enters or exits a mod shop. -tags: [] +tags: ["player"] --- @@ -54,4 +54,5 @@ The following callbacks might be useful, as they're related to this callback in The following functions might be useful, as they're related to this callback in one way or another. +- [IsPlayerInModShop](../functions/IsPlayerInModShop): Check if the player is in the mod shop. - [AddVehicleComponent](../functions/AddVehicleComponent): Add a component to a vehicle. diff --git a/docs/scripting/functions/AddStaticVehicle.md b/docs/scripting/functions/AddStaticVehicle.md index b580349bd..cf38fbe38 100644 --- a/docs/scripting/functions/AddStaticVehicle.md +++ b/docs/scripting/functions/AddStaticVehicle.md @@ -41,3 +41,15 @@ public OnGameModeInit() - [AddStaticVehicleEx](AddStaticVehicleEx): Add a static vehicle with custom respawn time. - [CreateVehicle](CreateVehicle): Create a vehicle. - [DestroyVehicle](DestroyVehicle): Destroy a vehicle. +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Check whether a vehicle's siren is on or off. +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): Adjusts vehicle model, spawn location, colours, respawn delay and interior. +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): Gets the vehicle spawn location and colours. +- [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): Set the respawn delay of a vehicle. +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle. + +## Related Callbacks + +- [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Called when a vehicle respawns. +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Called when a vehicle's siren is toggled on/off. diff --git a/docs/scripting/functions/AddStaticVehicleEx.md b/docs/scripting/functions/AddStaticVehicleEx.md index c6279dca5..273de7356 100644 --- a/docs/scripting/functions/AddStaticVehicleEx.md +++ b/docs/scripting/functions/AddStaticVehicleEx.md @@ -42,3 +42,16 @@ public OnGameModeInit() - [AddStaticVehicle](AddStaticVehicle): Add a static vehicle. - [CreateVehicle](CreateVehicle): Create a vehicle. +- [DestroyVehicle](DestroyVehicle): Destroy a vehicle. +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Check whether a vehicle's siren is on or off. +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): Adjusts vehicle model, spawn location, colours, respawn delay and interior. +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): Gets the vehicle spawn location and colours. +- [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): Set the respawn delay of a vehicle. +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle. + +## Related Callbacks + +- [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Called when a vehicle respawns. +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Called when a vehicle's siren is toggled on/off. diff --git a/docs/scripting/functions/ChangeVehicleColor.md b/docs/scripting/functions/ChangeVehicleColor.md index 27e7707ce..b508792d2 100644 --- a/docs/scripting/functions/ChangeVehicleColor.md +++ b/docs/scripting/functions/ChangeVehicleColor.md @@ -74,5 +74,9 @@ Some vehicles have only a primary color and some can not have the color changed ## Related Functions +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. - [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Change the paintjob on a vehicle. + +## Related Callbacks + - [OnVehicleRespray](../callbacks/OnVehicleRespray): Called when a vehicle is resprayed. diff --git a/docs/scripting/functions/ChangeVehicleColours.md b/docs/scripting/functions/ChangeVehicleColours.md new file mode 100644 index 000000000..79cc1dd49 --- /dev/null +++ b/docs/scripting/functions/ChangeVehicleColours.md @@ -0,0 +1,84 @@ +--- +title: ChangeVehicleColours +description: Change a vehicle's primary and secondary colors. +tags: ["vehicle"] +--- + + + +## Description + +Change a vehicle's primary and secondary colors. + +| Name | Description | +| --------- | ---------------------------------------------- | +| vehicleid | The ID of the vehicle to change the colors of. | +| color1 | The new vehicle's primary Color ID. | +| color2 | The new vehicle's secondary Color ID. | + +## Returns + +1: The function executed successfully. The vehicle's color was successfully changed. + +0: The function failed to execute. The vehicle does not exist. + +## Examples + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + // Change the primary color to black and the secondary color to white + ChangeVehicleColours(vehicleid, 0, 1); + return 1; +} +``` +## Snippets + +```c +new VehicleColoursTableRGBA[256] = { +// The existing colours from San Andreas +0x000000FF, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF, +0x46597AFF, 0x656A79FF, 0x5D7E8DFF, 0x58595AFF, 0xD6DAD6FF, 0x9CA1A3FF, 0x335F3FFF, 0x730E1AFF, 0x7B0A2AFF, 0x9F9D94FF, +0x3B4E78FF, 0x732E3EFF, 0x691E3BFF, 0x96918CFF, 0x515459FF, 0x3F3E45FF, 0xA5A9A7FF, 0x635C5AFF, 0x3D4A68FF, 0x979592FF, +0x421F21FF, 0x5F272BFF, 0x8494ABFF, 0x767B7CFF, 0x646464FF, 0x5A5752FF, 0x252527FF, 0x2D3A35FF, 0x93A396FF, 0x6D7A88FF, +0x221918FF, 0x6F675FFF, 0x7C1C2AFF, 0x5F0A15FF, 0x193826FF, 0x5D1B20FF, 0x9D9872FF, 0x7A7560FF, 0x989586FF, 0xADB0B0FF, +0x848988FF, 0x304F45FF, 0x4D6268FF, 0x162248FF, 0x272F4BFF, 0x7D6256FF, 0x9EA4ABFF, 0x9C8D71FF, 0x6D1822FF, 0x4E6881FF, +0x9C9C98FF, 0x917347FF, 0x661C26FF, 0x949D9FFF, 0xA4A7A5FF, 0x8E8C46FF, 0x341A1EFF, 0x6A7A8CFF, 0xAAAD8EFF, 0xAB988FFF, +0x851F2EFF, 0x6F8297FF, 0x585853FF, 0x9AA790FF, 0x601A23FF, 0x20202CFF, 0xA4A096FF, 0xAA9D84FF, 0x78222BFF, 0x0E316DFF, +0x722A3FFF, 0x7B715EFF, 0x741D28FF, 0x1E2E32FF, 0x4D322FFF, 0x7C1B44FF, 0x2E5B20FF, 0x395A83FF, 0x6D2837FF, 0xA7A28FFF, +0xAFB1B1FF, 0x364155FF, 0x6D6C6EFF, 0x0F6A89FF, 0x204B6BFF, 0x2B3E57FF, 0x9B9F9DFF, 0x6C8495FF, 0x4D8495FF, 0xAE9B7FFF, +0x406C8FFF, 0x1F253BFF, 0xAB9276FF, 0x134573FF, 0x96816CFF, 0x64686AFF, 0x105082FF, 0xA19983FF, 0x385694FF, 0x525661FF, +0x7F6956FF, 0x8C929AFF, 0x596E87FF, 0x473532FF, 0x44624FFF, 0x730A27FF, 0x223457FF, 0x640D1BFF, 0xA3ADC6FF, 0x695853FF, +0x9B8B80FF, 0x620B1CFF, 0x5B5D5EFF, 0x624428FF, 0x731827FF, 0x1B376DFF, 0xEC6AAEFF, 0x000000FF, +// SA-MP extended colours (0.3x) +0x177517FF, 0x210606FF, 0x125478FF, 0x452A0DFF, 0x571E1EFF, 0x010701FF, 0x25225AFF, 0x2C89AAFF, 0x8A4DBDFF, 0x35963AFF, +0xB7B7B7FF, 0x464C8DFF, 0x84888CFF, 0x817867FF, 0x817A26FF, 0x6A506FFF, 0x583E6FFF, 0x8CB972FF, 0x824F78FF, 0x6D276AFF, +0x1E1D13FF, 0x1E1306FF, 0x1F2518FF, 0x2C4531FF, 0x1E4C99FF, 0x2E5F43FF, 0x1E9948FF, 0x1E9999FF, 0x999976FF, 0x7C8499FF, +0x992E1EFF, 0x2C1E08FF, 0x142407FF, 0x993E4DFF, 0x1E4C99FF, 0x198181FF, 0x1A292AFF, 0x16616FFF, 0x1B6687FF, 0x6C3F99FF, +0x481A0EFF, 0x7A7399FF, 0x746D99FF, 0x53387EFF, 0x222407FF, 0x3E190CFF, 0x46210EFF, 0x991E1EFF, 0x8D4C8DFF, 0x805B80FF, +0x7B3E7EFF, 0x3C1737FF, 0x733517FF, 0x781818FF, 0x83341AFF, 0x8E2F1CFF, 0x7E3E53FF, 0x7C6D7CFF, 0x020C02FF, 0x072407FF, +0x163012FF, 0x16301BFF, 0x642B4FFF, 0x368452FF, 0x999590FF, 0x818D96FF, 0x99991EFF, 0x7F994CFF, 0x839292FF, 0x788222FF, +0x2B3C99FF, 0x3A3A0BFF, 0x8A794EFF, 0x0E1F49FF, 0x15371CFF, 0x15273AFF, 0x375775FF, 0x060820FF, 0x071326FF, 0x20394BFF, +0x2C5089FF, 0x15426CFF, 0x103250FF, 0x241663FF, 0x692015FF, 0x8C8D94FF, 0x516013FF, 0x090F02FF, 0x8C573AFF, 0x52888EFF, +0x995C52FF, 0x99581EFF, 0x993A63FF, 0x998F4EFF, 0x99311EFF, 0x0D1842FF, 0x521E1EFF, 0x42420DFF, 0x4C991EFF, 0x082A1DFF, +0x96821DFF, 0x197F19FF, 0x3B141FFF, 0x745217FF, 0x893F8DFF, 0x7E1A6CFF, 0x0B370BFF, 0x27450DFF, 0x071F24FF, 0x784573FF, +0x8A653AFF, 0x732617FF, 0x319490FF, 0x56941DFF, 0x59163DFF, 0x1B8A2FFF, 0x38160BFF, 0x041804FF, 0x355D8EFF, 0x2E3F5BFF, +0x561A28FF, 0x4E0E27FF, 0x706C67FF, 0x3B3E42FF, 0x2E2D33FF, 0x7B7E7DFF, 0x4A4442FF, 0x28344EFF +}; +``` +## Notes + +:::tip + +Some vehicles have only a primary color and some can not have the color changed at all. A few (cement, squallo) have 4 colors, of which 2 can not be changed in SA:MP + +::: + +## Related Functions + +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Change the paintjob on a vehicle. + +## Related Callbacks + +- [OnVehicleRespray](../callbacks/OnVehicleRespray): Called when a vehicle is resprayed. diff --git a/docs/scripting/functions/ChangeVehiclePaintjob.md b/docs/scripting/functions/ChangeVehiclePaintjob.md index 9003b029b..54cd95484 100644 --- a/docs/scripting/functions/ChangeVehiclePaintjob.md +++ b/docs/scripting/functions/ChangeVehiclePaintjob.md @@ -27,11 +27,15 @@ If vehicle's color is black , paintjob may not be visible. Better to make vehicl ```c new rand = random(3); // Will either be 0 1 or 2 (all valid) -ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1); // making sure it is white for better result +ChangeVehicleColor(GetPlayerVehicleID(playerid), 1, 1); // making sure it is white for better result ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), rand); // changes the paintjob of the player's current vehicle to a random one ``` ## Related Functions +- [GetVehiclePaintjob](GetVehiclePaintjob): Gets the vehicle's paintjob id. - [ChangeVehicleColor](ChangeVehicleColor): Set the color of a vehicle. + +## Related Callbacks + - [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): Called when a vehicle's paintjob is changed. diff --git a/docs/scripting/functions/CreateVehicle.md b/docs/scripting/functions/CreateVehicle.md index a20930253..3aceb92b4 100644 --- a/docs/scripting/functions/CreateVehicle.md +++ b/docs/scripting/functions/CreateVehicle.md @@ -53,5 +53,14 @@ Trains can only be added with AddStaticVehicle and AddStaticVehicleEx. - [AddStaticVehicle](AddStaticVehicle): Add a static vehicle. - [AddStaticVehicleEx](AddStaticVehicleEx): Add a static vehicle with custom respawn time. - [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Check whether a vehicle's siren is on or off. +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): Adjusts vehicle model, spawn location, colours, respawn delay and interior. +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): Gets the vehicle spawn location and colours. +- [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): Set the respawn delay of a vehicle. +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle. + +## Related Callbacks + - [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Called when a vehicle respawns. - [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Called when a vehicle's siren is toggled on/off. diff --git a/docs/scripting/functions/GameModeExit.md b/docs/scripting/functions/GameModeExit.md index b23773b02..5727f12fd 100644 --- a/docs/scripting/functions/GameModeExit.md +++ b/docs/scripting/functions/GameModeExit.md @@ -16,3 +16,7 @@ if (OneTeamHasWon) GameModeExit(); } ``` + +## Related Functions + +- [SetModeRestartTime](SetModeRestartTime): Sets the delay between loading main scripts, in seconds. diff --git a/docs/scripting/functions/GetModeRestartTime.md b/docs/scripting/functions/GetModeRestartTime.md new file mode 100644 index 000000000..56db728cb --- /dev/null +++ b/docs/scripting/functions/GetModeRestartTime.md @@ -0,0 +1,28 @@ +--- +title: GetModeRestartTime +description: Gets the delay between loading main scripts, in seconds. +tags: [] +--- + + + +## Description + +Gets the delay between loading main scripts, in seconds. + +## Return Values + +Returns the delay as a float value. + +## Examples + +```c +SetModeRestartTime(5.0); + +new Float:seconds = GetModeRestartTime(); +printf("Delay: %.1f", seconds); // Delay: 5.0 +``` + +## Related Functions + +- [SetModeRestartTime](SetModeRestartTime): Sets the delay between loading main scripts, in seconds. diff --git a/docs/scripting/functions/GetPlayerHydraReactorAngle.md b/docs/scripting/functions/GetPlayerHydraReactorAngle.md new file mode 100644 index 000000000..63af2d9f3 --- /dev/null +++ b/docs/scripting/functions/GetPlayerHydraReactorAngle.md @@ -0,0 +1,27 @@ +--- +title: GetPlayerHydraReactorAngle +description: Gets the hydra reactor angle of the player's vehicle. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the hydra reactor angle of the player's vehicle. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Examples + +```c +new Float:reactorAngle = GetPlayerHydraReactorAngle(playerid); +``` + +## Related Functions + +- [GetVehicleHydraReactorAngle](GetVehicleHydraReactorAngle): Gets the hydra reactor angle of the vehicle. diff --git a/docs/scripting/functions/GetPlayerLandingGearState.md b/docs/scripting/functions/GetPlayerLandingGearState.md new file mode 100644 index 000000000..de9aa367d --- /dev/null +++ b/docs/scripting/functions/GetPlayerLandingGearState.md @@ -0,0 +1,31 @@ +--- +title: GetPlayerLandingGearState +description: Gets the landing gear state of the current player's vehicle. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the [landing gear state](../resources/landinggearstate) of the current player's vehicle. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Examples + +```c +new LANDING_GEAR_STATE:state = GetPlayerLandingGearState(playerid); +``` + +## Related Functions + +- [GetVehicleLandingGearState](GetVehicleLandingGearState): Gets the current vehicle landing gear state from the latest driver. + +## Related Resources + +- [Vehicle Landing Gear States](../resources/landinggearstate) diff --git a/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md b/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md new file mode 100644 index 000000000..eccbb7cc8 --- /dev/null +++ b/docs/scripting/functions/GetPlayerLastSyncedTrailerID.md @@ -0,0 +1,31 @@ +--- +title: GetPlayerLastSyncedTrailerID +description: Gets the player's last synced trailer ID. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the player's last synced trailer ID. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Return Values + +Returns the last synced trailer ID. + +## Examples + +```c +new trailerid = GetPlayerLastSyncedTrailerID(playerid); +``` + +## Related Functions + +- [GetPlayerLastSyncedVehicleID](GetPlayerLastSyncedVehicleID): Gets the player's last synced vehicle ID. diff --git a/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md b/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md new file mode 100644 index 000000000..27a1bb4ab --- /dev/null +++ b/docs/scripting/functions/GetPlayerLastSyncedVehicleID.md @@ -0,0 +1,31 @@ +--- +title: GetPlayerLastSyncedVehicleID +description: Gets the player's last synced vehicle ID. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the player's last synced vehicle ID. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Return Values + +Returns the last synced vehicle ID. + +## Examples + +```c +new vehicleid = GetPlayerLastSyncedVehicleID(playerid); +``` + +## Related Functions + +- [GetPlayerLastSyncedTrailerID](GetPlayerLastSyncedTrailerID): Gets the player's last synced trailer ID. diff --git a/docs/scripting/functions/GetPlayerSirenState.md b/docs/scripting/functions/GetPlayerSirenState.md new file mode 100644 index 000000000..32a83cfd6 --- /dev/null +++ b/docs/scripting/functions/GetPlayerSirenState.md @@ -0,0 +1,49 @@ +--- +title: GetPlayerSirenState +description: Gets the siren state of the player's vehicle. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the siren state of the player's vehicle. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Return Values + +Returns the vehicle siren state. + +## Examples + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/siren", true)) + { + if (!IsPlayerInAnyVehicle(playerid)) + { + return 1; + } + + new bool:sirenState = GetPlayerSirenState(playerid); + + SendClientMessage(playerid, 0xFFFF00FF, "Vehicle siren state: %s", sirenState ? "On" : "Off"); + return 1; + } + return 0; +} +``` + +## Related Functions + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): Turn the siren for a vehicle on or off. +- [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): Turn the siren for a vehicle on or off. +- [IsVehicleSirenEnabled](IsVehicleSirenEnabled): Checks if a vehicle siren is on or off. +- [GetVehicleSirenState](GetVehicleSirenState): Gets the siren state of the vehicle. diff --git a/docs/scripting/functions/GetPlayerTrainSpeed.md b/docs/scripting/functions/GetPlayerTrainSpeed.md new file mode 100644 index 000000000..658e01946 --- /dev/null +++ b/docs/scripting/functions/GetPlayerTrainSpeed.md @@ -0,0 +1,28 @@ +--- +title: GetPlayerTrainSpeed +description: Gets the speed of the player's train. +tags: ["player", "vehicle"] +--- + + + +## Description + +Gets the speed of the player's train. + +## Parameters + +| Name | Description | +|----------|-----------------------| +| playerid | The ID of the player. | + +## Examples + +```c +new Float:speed = GetPlayerTrainSpeed(playerid); +SendClientMessage(playerid, 0xFFFF00FF, "The speed of your train: %f", speed); +``` + +## Related Functions + +- [GetVehicleTrainSpeed](GetVehicleTrainSpeed): Gets the speed of the train. diff --git a/docs/scripting/functions/GetRandomVehicleColourPair.md b/docs/scripting/functions/GetRandomVehicleColourPair.md new file mode 100644 index 000000000..4852289e0 --- /dev/null +++ b/docs/scripting/functions/GetRandomVehicleColourPair.md @@ -0,0 +1,36 @@ +--- +title: GetRandomVehicleColourPair +description: Get random colour indexes that are valid for the given vehicle model. +tags: ["vehicle"] +--- + + + +## Description + +Get random colour indexes that are valid for the given vehicle model. + +## Parameters + +| Name | Description | +|--------------|----------------------------------------------------------------------| +| modelid | The ID of the [vehicle model](../resources/vehicleid). | +| &colour1 | A variable in which to store the colour1 value, passed by reference. | +| &colour2 | A variable in which to store the colour2 value, passed by reference. | +| &colour3 = 0 | A variable in which to store the colour3 value, passed by reference. | +| &colour4 = 0 | A variable in which to store the colour4 value, passed by reference. | + +## Examples + +```c +new + colour1, + colour2; + +GetRandomVehicleColourPair(560, colour1, colour2); +``` + +## Related Functions + +- [VehicleColourIndexToColour](VehicleColourIndexToColour): Convert a car colour index to a HEX colour (RGBA). +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. diff --git a/docs/scripting/functions/GetServerRuleFlags.md b/docs/scripting/functions/GetServerRuleFlags.md new file mode 100644 index 000000000..811ee7b13 --- /dev/null +++ b/docs/scripting/functions/GetServerRuleFlags.md @@ -0,0 +1,36 @@ +--- +title: GetServerRuleFlags +description: Gets the flags of a server rule. +tags: ["rule"] +--- + + + +## Description + +Gets the flags of a server rule. + +## Return Values + +Returns the server rule flags. + +## Examples + +```c +public OnGameModeInit() +{ + AddServerRule("discord", "discord.gg/samp"); + SetServerRuleFlags("discord", 1); + + new E_SERVER_RULE_FLAGS:flags = GetServerRuleFlags("discord"); + printf("Flags: %d", _:flags); // Flags: 1 + return 1; +} +``` + +## Related Functions + +- [AddServerRule](AddServerRule): Add a server rule. +- [RemoveServerRule](RemoveServerRule): Remove the server rule. +- [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. +- [SetServerRuleFlags](SetServerRuleFlags): Sets the flags of a server rule. diff --git a/docs/scripting/functions/GetVehicleCab.md b/docs/scripting/functions/GetVehicleCab.md new file mode 100644 index 000000000..3941e0067 --- /dev/null +++ b/docs/scripting/functions/GetVehicleCab.md @@ -0,0 +1,41 @@ +--- +title: GetVehicleCab +description: Get the ID of the trailer attached to a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the ID of the trailer attached to a vehicle. + +| Name | Description | +| --------- | -------------------------------------------- | +| vehicleid | The ID of the vehicle to get the trailer of. | + +## Returns + +The vehicle ID of the trailer or 0 if no trailer is attached. + +## Examples + +```c +new + trailerId = GetVehicleCab(vehicleid); +DetachTrailerFromVehicle(trailerId); +``` + +## Notes + +:::warning + +This function does not work for trains. + +::: + +## Related Functions + +- [AttachTrailerToVehicle](AttachTrailerToVehicle): Attach a trailer to a vehicle. +- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): Detach a trailer from a vehicle. +- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): Check if a trailer is attached to a vehicle. diff --git a/docs/scripting/functions/GetVehicleColours.md b/docs/scripting/functions/GetVehicleColours.md new file mode 100644 index 000000000..1b07f5dbb --- /dev/null +++ b/docs/scripting/functions/GetVehicleColours.md @@ -0,0 +1,41 @@ +--- +title: GetVehicleColours +description: Gets the vehicle colours. +tags: ["vehicle"] +--- + + + +## Description + +Gets the vehicle colours. + +## Parameters + +| Name | Description | +|-----------|----------------------------------------------------------------------| +| vehicleid | The ID of the vehicle. | +| &colour1 | A variable in which to store the colour1 value, passed by reference. | +| &colour2 | A variable in which to store the colour2 value, passed by reference. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + new + colour1, + colour2; + + GetVehicleColours(vehicleid, colour1, colour2); + // colour1 = 6 + // colour2 = 0 + return 1; +} +``` + +## Related Functions + +- [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. diff --git a/docs/scripting/functions/GetVehicleDriver.md b/docs/scripting/functions/GetVehicleDriver.md index 8bed4499d..ad6e86ce4 100644 --- a/docs/scripting/functions/GetVehicleDriver.md +++ b/docs/scripting/functions/GetVehicleDriver.md @@ -1,46 +1,41 @@ --- title: GetVehicleDriver description: Get the playerid of the person driving the vehicle. +tags: ["vehicle"] --- -:::warning - -This function requires the Open Multiplayer server software. You can get that [here](https://github.com/openmultiplayer/server-beta) - -This function requires `omp.inc` provided by the Open Multiplayer server software. You can get that [here](https://github.com/openmultiplayer/server-beta/blob/master/omp.inc) - -::: + ## Description Get the playerid of the person driving the vehicle. +## Parameters -| Name | Description | -| ------------- | ---------------------------------------------------------------------------- | -| vehicleid | The ID of the vehicle to get the driver of. | +| Name | Description | +|-----------|---------------------------------------------| +| vehicleid | The ID of the vehicle to get the driver of. | ## Returns -`playerid` - The playerid of the person driving. - -`INVALID_VEHICLE_ID` - The vehicle does not exist. +Returns the driver ID (player ID). -`INVALID_PLAYER_ID` - The vehicle has no driver. +`INVALID_PLAYER_ID` - The vehicle has no driver. ## Examples ```c -#include -#include - public OnPlayerExitVehicle(playerid, vehicleid) { new driverid = GetVehicleDriver(vehicleid); - if(driverid != INVALID_PLAYER_ID) + if (driverid != INVALID_PLAYER_ID) { SendClientMessage(driverid, -1, "Someone is exiting your vehicle."); } return 1; } ``` + +## Related Functions + +- [GetVehicleLastDriver](GetVehicleLastDriver): Get the last driver of a vehicle. diff --git a/docs/scripting/functions/GetVehicleHydraReactorAngle.md b/docs/scripting/functions/GetVehicleHydraReactorAngle.md new file mode 100644 index 000000000..3da8c918d --- /dev/null +++ b/docs/scripting/functions/GetVehicleHydraReactorAngle.md @@ -0,0 +1,27 @@ +--- +title: GetVehicleHydraReactorAngle +description: Gets the hydra reactor angle of the vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Gets the hydra reactor angle of the vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Examples + +```c +new Float:reactorAngle = GetVehicleHydraReactorAngle(vehicleid); +``` + +## Related Functions + +- [GetPlayerHydraReactorAngle](GetPlayerHydraReactorAngle): Gets the reactor angle of the player's hydra. diff --git a/docs/scripting/functions/GetVehicleInterior.md b/docs/scripting/functions/GetVehicleInterior.md new file mode 100644 index 000000000..ab7477d27 --- /dev/null +++ b/docs/scripting/functions/GetVehicleInterior.md @@ -0,0 +1,39 @@ +--- +title: GetVehicleInterior +description: Get the interior id of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the interior id of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns vehicle interior id. + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + LinkVehicleToInterior(vehicleid, 15); + + new interiorid = GetVehicleInterior(vehicleid); + // interiorid = 15 + return 1; +} +``` + +## Related Functions + +- [LinkVehicleToInterior](LinkVehicleToInterior): Links a vehicle to an interior. diff --git a/docs/scripting/functions/GetVehicleLandingGearState.md b/docs/scripting/functions/GetVehicleLandingGearState.md new file mode 100644 index 000000000..078e250e3 --- /dev/null +++ b/docs/scripting/functions/GetVehicleLandingGearState.md @@ -0,0 +1,31 @@ +--- +title: GetVehicleLandingGearState +description: Gets the current vehicle landing gear state from the latest driver. +tags: ["vehicle"] +--- + + + +## Description + +Gets the current vehicle [landing gear state](../resources/landinggearstate) from the latest driver. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Examples + +```c +new LANDING_GEAR_STATE:state = GetVehicleLandingGearState(vehicleid); +``` + +## Related Functions + +- [GetPlayerLandingGearState](GetPlayerLandingGearState): Gets the landing gear state of the current player's vehicle. + +## Related Resources + +- [Vehicle Landing Gear States](../resources/landinggearstate) diff --git a/docs/scripting/functions/GetVehicleLastDriver.md b/docs/scripting/functions/GetVehicleLastDriver.md new file mode 100644 index 000000000..2e08bf775 --- /dev/null +++ b/docs/scripting/functions/GetVehicleLastDriver.md @@ -0,0 +1,51 @@ +--- +title: GetVehicleLastDriver +description: Get the last driver of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the last driver of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns the last driver ID (player ID). + +`INVALID_PLAYER_ID` - The vehicle has no last driver. + +## Examples + +```c +new g_Vehicle; + +public OnGameModeInit() +{ + g_Vehicle = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); +} + +public OnGameModeExit() +{ + new lastDriver = GetVehicleLastDriver(g_Vehicle); + if (lastDriver != INVALID_PLAYER_ID) + { + printf("Vehicle ID %d last driver: %d", g_Vehicle, lastDriver); + } + else + { + printf("Vehicle ID %d has no last driver.", g_Vehicle); + } +} +``` + +## Related Functions + +- [GetVehicleDriver](GetVehicleDriver): Get the playerid of the person driving the vehicle. diff --git a/docs/scripting/functions/GetVehicleMatrix.md b/docs/scripting/functions/GetVehicleMatrix.md new file mode 100644 index 000000000..5fe00f27d --- /dev/null +++ b/docs/scripting/functions/GetVehicleMatrix.md @@ -0,0 +1,47 @@ +--- +title: GetVehicleMatrix +description: Gets the actual rotation matrix of the vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Gets the actual rotation matrix of the vehicle. + +## Parameters + +| Name | Description | +|---------------|--------------------------------------------------------------------------------| +| vehicleid | The ID of the vehicle. | +| &Float:rightX | A float variable in which to store the rightX coordinate, passed by reference. | +| &Float:rightY | A float variable in which to store the rightY coordinate, passed by reference. | +| &Float:rightZ | A float variable in which to store the rightZ coordinate, passed by reference. | +| &Float:upX | A float variable in which to store the upX coordinate, passed by reference. | +| &Float:upY | A float variable in which to store the upY coordinate, passed by reference. | +| &Float:upZ | A float variable in which to store the upZ coordinate, passed by reference. | +| &Float:atX | A float variable in which to store the atX coordinate, passed by reference. | +| &Float:atY | A float variable in which to store the atY coordinate, passed by reference. | +| &Float:atZ | A float variable in which to store the atZ coordinate, passed by reference. | + +## Examples + +```c +new + Float:rightX, + Float:rightY, + Float:rightZ, + Float:upX, + Float:upY, + Float:upZ, + Float:atX, + Float:atY, + Float:atZ; + +GetVehicleMatrix(vehicleid, rightX, rightY, rightZ, upX, upY, upZ, atX, atY, atZ); +``` + +## Related Functions + +- [GetVehicleRotationQuat](GetVehicleRotationQuat): Returns a vehicle's rotation on all axes as a quaternion. diff --git a/docs/scripting/functions/GetVehicleModelCount.md b/docs/scripting/functions/GetVehicleModelCount.md new file mode 100644 index 000000000..d03cbe0c2 --- /dev/null +++ b/docs/scripting/functions/GetVehicleModelCount.md @@ -0,0 +1,36 @@ +--- +title: GetVehicleModelCount +description: Gets the model count of a vehicle model. +tags: ["vehicle"] +--- + + + +## Description + +Gets the model count of a vehicle model. + +## Parameters + +| Name | Description | +|---------|--------------------------------------------------------| +| modelid | The ID of the [vehicle model](../resources/vehicleid). | + +## Examples + +```c +public OnGameModeInit() +{ + CreateVehicle(560, 2112.7607, -1308.3751, 23.6797, 90.0000, -1, -1, 100); + CreateVehicle(560, 2104.5730, -1308.3313, 23.6797, 90.0000, -1, -1, 100); + CreateVehicle(560, 2120.3616, -1308.4973, 23.6797, 90.0000, -1, -1, 100); + + new modelid = 560; + printf("Vehicle model: %d - model count: %d", modelid, GetVehicleModelCount(modelid)); // Vehicle model: 560 - model count: 3 +} +``` + +## Related Functions + +- [CreateVehicle](CreateVehicle): Create a vehicle. +- [GetVehicleModelsUsed](GetVehicleModelsUsed): Get the number of used vehicle models on the server. diff --git a/docs/scripting/functions/GetVehicleModelsUsed.md b/docs/scripting/functions/GetVehicleModelsUsed.md new file mode 100644 index 000000000..71ffc9046 --- /dev/null +++ b/docs/scripting/functions/GetVehicleModelsUsed.md @@ -0,0 +1,24 @@ +--- +title: GetVehicleModelsUsed +description: Get the number of used vehicle models on the server. +tags: ["vehicle"] +--- + + + +## Description + +Get the number of used vehicle models on the server. + +## Examples + +```c +public OnGameModeInit() +{ + printf("Used vehicle models: %d", GetVehicleModelsUsed()); +} +``` + +## Related Functions + +- [GetVehicleModelCount](GetVehicleModelCount): Gets the model count of a vehicle model. diff --git a/docs/scripting/functions/GetVehicleNumberPlate.md b/docs/scripting/functions/GetVehicleNumberPlate.md new file mode 100644 index 000000000..784fd2400 --- /dev/null +++ b/docs/scripting/functions/GetVehicleNumberPlate.md @@ -0,0 +1,38 @@ +--- +title: GetVehicleNumberPlate +description: Get the number plate of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the number plate of a vehicle. + +## Parameters + +| Name | Description | +|----------------------|-------------------------------------------------------------| +| vehicleid | The ID of the vehicle. | +| plate[] | An array into which to store the name, passed by reference. | +| len = sizeof (plate) | The length of the plate that should be stored. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + SetVehicleNumberPlate(vehicleid, "ABCD 123"); + + new numberPlate[16]; + GetVehicleNumberPlate(vehicleid, numberPlate); + // numberPlate = "ABCD 123" + return 1; +} +``` + +## Related Functions + +- [SetVehicleNumberPlate](SetVehicleNumberPlate): Set a vehicle numberplate. diff --git a/docs/scripting/functions/GetVehicleOccupiedTick.md b/docs/scripting/functions/GetVehicleOccupiedTick.md new file mode 100644 index 000000000..71a4636a4 --- /dev/null +++ b/docs/scripting/functions/GetVehicleOccupiedTick.md @@ -0,0 +1,38 @@ +--- +title: GetVehicleOccupiedTick +description: Get the occupied tick of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the occupied tick of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns occupied tick in milliseconds. + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new occupiedTick = GetVehicleOccupiedTick(vehicleid); + printf("Vehicle ID %d occupied tick: %d ms", vehicleid, occupiedTick); + return 1; +} +``` + +## Related Functions + +- [SetVehicleOccupiedTick](SetVehicleOccupiedTick): Set the occupied tick of a vehicle. diff --git a/docs/scripting/functions/GetVehiclePaintjob.md b/docs/scripting/functions/GetVehiclePaintjob.md new file mode 100644 index 000000000..395c902b9 --- /dev/null +++ b/docs/scripting/functions/GetVehiclePaintjob.md @@ -0,0 +1,39 @@ +--- +title: GetVehiclePaintjob +description: Gets the vehicle's paintjob id. +tags: ["vehicle"] +--- + + + +## Description + +Gets the vehicle's paintjob id. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns the [paintjob id](../resources/paintjobs). + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + ChangeVehiclePaintjob(vehicleid, 2); + + new paintjob = GetVehiclePaintjob(vehicleid); + // paintjob = 2 + return 1; +} +``` + +## Related Functions + +- [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Change a vehicle's paintjob diff --git a/docs/scripting/functions/GetVehicleParamsSirenState.md b/docs/scripting/functions/GetVehicleParamsSirenState.md index 53704fa86..964f52ed6 100644 --- a/docs/scripting/functions/GetVehicleParamsSirenState.md +++ b/docs/scripting/functions/GetVehicleParamsSirenState.md @@ -51,3 +51,5 @@ Because a siren state of -1 or 0 means 'off', you cannot use a boolean condition ::: ## Related Functions + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): Turn the siren for a vehicle on or off. diff --git a/docs/scripting/functions/GetVehicleRespawnDelay.md b/docs/scripting/functions/GetVehicleRespawnDelay.md new file mode 100644 index 000000000..b835c5bf8 --- /dev/null +++ b/docs/scripting/functions/GetVehicleRespawnDelay.md @@ -0,0 +1,34 @@ +--- +title: GetVehicleRespawnDelay +description: Get the respawn delay of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the respawn delay of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new respawnDelay = GetVehicleRespawnDelay(vehicleid); + // respawnDelay = 60 + return 1; +} +``` + +## Related Functions + +- [SetVehicleRespawnDelay](SetVehicleRespawnDelay): Set the respawn delay of a vehicle. diff --git a/docs/scripting/functions/GetVehicleRespawnTick.md b/docs/scripting/functions/GetVehicleRespawnTick.md new file mode 100644 index 000000000..dbca1f943 --- /dev/null +++ b/docs/scripting/functions/GetVehicleRespawnTick.md @@ -0,0 +1,38 @@ +--- +title: GetVehicleRespawnTick +description: Get the respawn tick of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Get the respawn tick of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns respawn tick in milliseconds. + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + new respawnTick = GetVehicleRespawnTick(vehicleid); + printf("Vehicle ID %d respawn tick: %d ms", vehicleid, respawnTick); + return 1; +} +``` + +## Related Functions + +- [SetVehicleRespawnTick](SetVehicleRespawnTick): Set the respawn tick of a vehicle. diff --git a/docs/scripting/functions/GetVehicleRotationQuat.md b/docs/scripting/functions/GetVehicleRotationQuat.md index fb2deb480..60502e4d1 100644 --- a/docs/scripting/functions/GetVehicleRotationQuat.md +++ b/docs/scripting/functions/GetVehicleRotationQuat.md @@ -38,3 +38,4 @@ There is no 'set' variation of this function; you can not SET a vehicle's rotati - [GetVehicleZAngle](GetVehicleZAngle): Check the current angle of a vehicle. - [GetVehicleRotation](GetVehicleRotation): Get the rotation of a vehicle on the XYZ axis. +- [GetVehicleMatrix](GetVehicleMatrix): Gets the actual rotation matrix of the vehicle. diff --git a/docs/scripting/functions/GetVehicleSirenState.md b/docs/scripting/functions/GetVehicleSirenState.md new file mode 100644 index 000000000..214e76e6a --- /dev/null +++ b/docs/scripting/functions/GetVehicleSirenState.md @@ -0,0 +1,40 @@ +--- +title: GetVehicleSirenState +description: Gets the siren state of the vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Gets the siren state of the vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +Returns the vehicle siren state. + +## Examples + +```c +public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) +{ + new bool:sirenState = GetVehicleSirenState(vehicleid); + + SendClientMessage(playerid, 0xFFFF00FF, "Vehicle siren state: %s", sirenState ? "On" : "Off"); + return 1; +} +``` + +## Related Functions + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): Turn the siren for a vehicle on or off. +- [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): Turn the siren for a vehicle on or off. +- [IsVehicleSirenEnabled](IsVehicleSirenEnabled): Checks if a vehicle siren is on or off. +- [GetPlayerSirenState](GetPlayerSirenState): Gets the siren state of the player's vehicle. diff --git a/docs/scripting/functions/GetVehicleSpawnInfo.md b/docs/scripting/functions/GetVehicleSpawnInfo.md new file mode 100644 index 000000000..bcbd78d91 --- /dev/null +++ b/docs/scripting/functions/GetVehicleSpawnInfo.md @@ -0,0 +1,47 @@ +--- +title: GetVehicleSpawnInfo +description: Gets the vehicle spawn location and colours. +tags: ["vehicle"] +--- + + + +## Description + +Gets the vehicle spawn location and colours. + +## Parameters + +| Name | Description | +|---------------|--------------------------------------------------------------------------------| +| vehicleid | The ID of the vehicle. | +| &Float:spawnX | A float variable in which to store the spawnX coordinate, passed by reference. | +| &Float:spawnY | A float variable in which to store the spawnY coordinate, passed by reference. | +| &Float:spawnZ | A float variable in which to store the spawnZ coordinate, passed by reference. | +| &Float:angle | A float variable in which to store the angle coordinate, passed by reference. | +| &colour1 | A variable in which to store the colour1 value, passed by reference. | +| &colour2 | A variable in which to store the colour2 value, passed by reference. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + new + Float:spawnX, + Float:spawnY, + Float:spawnZ, + Float:angle, + colour1, + colour2; + + GetVehicleSpawnInfo(vehicleid, spawnX, spawnY, spawnZ, angle, colour1, colour2); + return 1; +} +``` + +## Related Functions + +- [SetVehicleSpawnInfo](SetVehicleSpawnInfo): Adjusts vehicle model, spawn location, colours, respawn delay and interior. diff --git a/docs/scripting/functions/GetVehicleTower.md b/docs/scripting/functions/GetVehicleTower.md new file mode 100644 index 000000000..e960c03fc --- /dev/null +++ b/docs/scripting/functions/GetVehicleTower.md @@ -0,0 +1,45 @@ +--- +title: GetVehicleTower +description: Get the ID of the trailer attached to a vehicle. +tags: ["vehicle"] +--- + +:::warning + +This function is deprecated, See [GetVehicleCab](GetVehicleCab). + +::: + +## Description + +Get the ID of the trailer attached to a vehicle. + +| Name | Description | +| --------- | -------------------------------------------- | +| vehicleid | The ID of the vehicle to get the trailer of. | + +## Returns + +The vehicle ID of the trailer or 0 if no trailer is attached. + +## Examples + +```c +new + trailerId = GetVehicleTower(vehicleid); +DetachTrailerFromVehicle(trailerId); +``` + +## Notes + +:::warning + +This function does not work for trains. + +::: + +## Related Functions + +- [AttachTrailerToVehicle](AttachTrailerToVehicle): Attach a trailer to a vehicle. +- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): Detach a trailer from a vehicle. +- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): Check if a trailer is attached to a vehicle. diff --git a/docs/scripting/functions/GetVehicleTrainSpeed.md b/docs/scripting/functions/GetVehicleTrainSpeed.md new file mode 100644 index 000000000..8730ed59d --- /dev/null +++ b/docs/scripting/functions/GetVehicleTrainSpeed.md @@ -0,0 +1,29 @@ +--- +title: GetVehicleTrainSpeed +description: Gets the speed of the train. +tags: ["vehicle"] +--- + + + +## Description + +Gets the speed of the train. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Examples + +```c +new vehicleid = GetPlayerVehicleID(playerid); + +new Float:speed = GetVehicleTrainSpeed(vehicleid); +``` + +## Related Functions + +- [GetPlayerTrainSpeed](GetPlayerTrainSpeed): Gets the speed of the player's train. diff --git a/docs/scripting/functions/GetVehicleZAngle.md b/docs/scripting/functions/GetVehicleZAngle.md index 970c296c1..28e60bedc 100644 --- a/docs/scripting/functions/GetVehicleZAngle.md +++ b/docs/scripting/functions/GetVehicleZAngle.md @@ -50,4 +50,5 @@ public OnPlayerCommandText(playerid, cmdtext[]) - [GetVehicleRotationQuat](GetVehicleRotationQuat): Get the quaternion rotation of a vehicle. - [SetVehicleZAngle](SetVehicleZAngle): Set the direction of a vehicle. - [GetVehiclePos](GetVehiclePos): Get the position of a vehicle. +- [GetVehicleMatrix](GetVehicleMatrix): Gets the actual rotation matrix of the vehicle. - [GetPlayerFacingAngle](GetPlayerFacingAngle): Check where a player is facing. diff --git a/docs/scripting/functions/HasVehicleBeenOccupied.md b/docs/scripting/functions/HasVehicleBeenOccupied.md new file mode 100644 index 000000000..c8cfdda2f --- /dev/null +++ b/docs/scripting/functions/HasVehicleBeenOccupied.md @@ -0,0 +1,40 @@ +--- +title: HasVehicleBeenOccupied +description: Check if a vehicle is occupied. +tags: ["vehicle"] +--- + + + +## Description + +Check if a vehicle is occupied. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +**true** - Vehicle is occupied. + +**false** - Vehicle is not occupied. + +## Examples + +```c +if (HasVehicleBeenOccupied(vehicleid)) +{ + // Vehicle is occupied +} +else +{ + // Vehicle is not occupied +} +``` + +## Related Functions + +- [SetVehicleBeenOccupied](SetVehicleBeenOccupied): Sets the vehicle's occupancy. diff --git a/docs/scripting/functions/HideVehicle.md b/docs/scripting/functions/HideVehicle.md new file mode 100644 index 000000000..81eded23b --- /dev/null +++ b/docs/scripting/functions/HideVehicle.md @@ -0,0 +1,33 @@ +--- +title: HideVehicle +description: Hides a vehicle from the game. +tags: ["vehicle"] +--- + + + +## Description + +Hides a vehicle from the game. + +## Parametes + +| Name | Description | +|-----------|--------------------------------| +| vehicleid | The ID of the vehicle to hide. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); + HideVehicle(vehicleid); + return 1; +} +``` + +## Related Functions + +- [ShowVehicle](ShowVehicle): Shows the hidden vehicle. +- [IsVehicleHidden](IsVehicleHidden): Checks if a vehicle is hidden. diff --git a/docs/scripting/functions/IsPlayerInModShop.md b/docs/scripting/functions/IsPlayerInModShop.md new file mode 100644 index 000000000..70f98843e --- /dev/null +++ b/docs/scripting/functions/IsPlayerInModShop.md @@ -0,0 +1,51 @@ +--- +title: IsPlayerInModShop +description: Check if the player is in the mod shop. +tags: ["player"] +--- + + + +## Description + +Check if the player is in the mod shop. + +## Parameters + +| Name | Description | +|----------|--------------------------------| +| playerid | The ID of the player to check. | + +## Return Values + +**true** - Player is in mod shop. + +**false** - Player is not in mod shop. + +## Examples + +```c +if (IsPlayerInModShop(playerid)) +{ + SendClientMessage(playerid, 0xFFFF00FF, "You are in the mod shop."); +} +else +{ + SendClientMessage(playerid, 0xFF0000FF, "You are not in the mod shop."); +} +``` + +## Related Functions + +The following functions might be useful, as they're related to this callback in one way or another. + +- [AddVehicleComponent](AddVehicleComponent): Add a component to a vehicle. + +## Related Callbacks + +The following callbacks might be useful, as they're related to this callback in one way or another. + +- [OnVehicleMod](../callbacks/OnVehicleMod): This callback is called when a vehicle is modded. +- [OnVehicleRespray](../callbacks/OnVehicleRespray): This callback is called when a player exits a mod shop, even if the colors weren't changed. +- [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): This callback is called when a player previews a vehicle paintjob inside a mod shop. +- [OnEnterExitModShop](../callbacks/OnEnterExitModShop): This callback is called when a player enters or exits a mod shop. diff --git a/docs/scripting/functions/IsVehicleDead.md b/docs/scripting/functions/IsVehicleDead.md new file mode 100644 index 000000000..ade396541 --- /dev/null +++ b/docs/scripting/functions/IsVehicleDead.md @@ -0,0 +1,40 @@ +--- +title: IsVehicleDead +description: Check if a vehicle is dead. +tags: ["vehicle"] +--- + + + +## Description + +Check if a vehicle is dead. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +**true** - Vehicle is dead. + +**false** - Vehicle is not dead. + +## Examples + +```c +if (IsVehicleDead(vehicleid)) +{ + // Vehicle is dead +} +else +{ + // Vehicle is not dead +} +``` + +## Related Functions + +- [SetVehicleDead](SetVehicleDead): Sets the vehicle to dead. diff --git a/docs/scripting/functions/IsVehicleHidden.md b/docs/scripting/functions/IsVehicleHidden.md new file mode 100644 index 000000000..4e5dfcb18 --- /dev/null +++ b/docs/scripting/functions/IsVehicleHidden.md @@ -0,0 +1,41 @@ +--- +title: IsVehicleHidden +description: Checks if a vehicle is hidden. +tags: ["vehicle"] +--- + + + +## Description + +Checks if a vehicle is hidden. + +## Parameters + +| Name | Description | +|-----------|---------------------------------| +| vehicleid | The ID of the vehicle to check. | + +## Return Values + +**true** - Vehicle is hidden. + +**false** - Vehicle is not hidden. + +## Examples + +```c +if (IsVehicleHidden(vehicleid)) +{ + // Vehicle is hidden +} +else +{ + // Vehicle is not hidden +} +``` + +## Related Functions + +- [HideVehicle](HideVehicle): Hides a vehicle from the game. +- [ShowVehicle](ShowVehicle): Shows the hidden vehicle. diff --git a/docs/scripting/functions/IsVehicleOccupied.md b/docs/scripting/functions/IsVehicleOccupied.md new file mode 100644 index 000000000..c44558712 --- /dev/null +++ b/docs/scripting/functions/IsVehicleOccupied.md @@ -0,0 +1,40 @@ +--- +title: IsVehicleOccupied +description: Check if a vehicle is occupied. +tags: ["vehicle"] +--- + + + +## Description + +Check if a vehicle is occupied. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | + +## Return Values + +**true** - Vehicle is occupied. + +**false** - Vehicle is not occupied. + +## Examples + +```c +if (IsVehicleOccupied(vehicleid)) +{ + // Vehicle is occupied +} +else +{ + // Vehicle is not occupied +} +``` + +## Related Functions + +- [SetVehicleBeenOccupied](SetVehicleBeenOccupied): Sets the vehicle's occupancy. diff --git a/docs/scripting/functions/IsVehicleSirenEnabled.md b/docs/scripting/functions/IsVehicleSirenEnabled.md new file mode 100644 index 000000000..84c96afd8 --- /dev/null +++ b/docs/scripting/functions/IsVehicleSirenEnabled.md @@ -0,0 +1,42 @@ +--- +title: IsVehicleSirenEnabled +description: Checks if a vehicle siren is on or off. +tags: ["vehicle"] +--- + + + +## Description + +Checks if a vehicle siren is on or off. + +## Parameters + +| Name | Description | +|-----------|---------------------------------| +| vehicleid | The ID of the vehicle to check. | + +## Return Values + +**true** - Vehicle siren is on. + +**false** - Vehicle siren is off. + +## Examples + +```c +if (IsVehicleSirenEnabled(vehicleid)) +{ + // Vehicle siren is on +} +else +{ + // Vehicle siren is off +} +``` + +## Related Functions + +- [SetVehicleParamsSirenState](SetVehicleParamsSirenState): Turn the siren for a vehicle on or off. +- [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): Turn the siren for a vehicle on or off. +- [IsVehicleSirenEnabled](IsVehicleSirenEnabled): Checks if a vehicle siren is on or off. diff --git a/docs/scripting/functions/LinkVehicleToInterior.md b/docs/scripting/functions/LinkVehicleToInterior.md index 843c1f5c6..72afd40b2 100644 --- a/docs/scripting/functions/LinkVehicleToInterior.md +++ b/docs/scripting/functions/LinkVehicleToInterior.md @@ -31,5 +31,6 @@ public OnGameModeInit() ## Related Functions +- [GetVehicleInterior](GetVehicleInterior): Get the interior id of a vehicle. - [SetVehicleVirtualWorld](SetVehicleVirtualWorld): Set the virtual world of a vehicle. - [SetPlayerInterior](SetPlayerInterior): Set a player's interior. diff --git a/docs/scripting/functions/SetModeRestartTime.md b/docs/scripting/functions/SetModeRestartTime.md new file mode 100644 index 000000000..0adca4d65 --- /dev/null +++ b/docs/scripting/functions/SetModeRestartTime.md @@ -0,0 +1,56 @@ +--- +title: SetModeRestartTime +description: Sets the delay between loading main scripts, in seconds. +tags: [] +--- + + + +## Description + +Sets the delay between loading main scripts, in seconds. + +## Parameters + +| Name | Description | +|---------------|---------------------| +| Float:seconds | Seconds to restart. | + +## Return Values + +1 - Function executed successfully. + +0 - Function failed to execute. This means that the specified seconds should not be less than 1. + +## Examples + +```c +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/restart", true)) + { + if (!IsPlayerAdmin(playerid)) + { + return 1; + } + + SetModeRestartTime(5.0); + SendClientMessage(playerid, -1, "[SERVER]: The server will restart in 5 seconds."); + return 1; + } + return 0; +} +``` + +## Notes + +:::warning + +The `seconds` parameter is a float. + +::: + +## Related Functions + +- [GetModeRestartTime](GetModeRestartTime): Gets the delay between loading main scripts, in seconds. +- [GameModeExit](GameModeExit): Ends the current gamemode. diff --git a/docs/scripting/functions/SetServerRule.md b/docs/scripting/functions/SetServerRule.md new file mode 100644 index 000000000..8b6ac2d49 --- /dev/null +++ b/docs/scripting/functions/SetServerRule.md @@ -0,0 +1,46 @@ +--- +title: SetServerRule +description: Add a server rule. +tags: ["rule"] +--- + + + +## Description + +Add a server rule. + +## Parameters + +| Name | Description | +| ----------------- | ----------------------------------------------------------- | +| const rule[] | The server rule name to add. | +| const format[] | The server rule value. | +| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | + +## Returns + +Returns true if the function executed successfully, otherwise false. + +## Examples + +```c +public OnGameModeInit() +{ + SetServerRule("discord", "discord.gg/samp"); + return 1; +} +``` + +## Notes + +:::tip + +This function is the same as [AddServerRule](AddServerRule). + +::: + +## Related Functions + +- [RemoveServerRule](RemoveServerRule): Remove the server rule. +- [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. diff --git a/docs/scripting/functions/SetServerRuleFlags.md b/docs/scripting/functions/SetServerRuleFlags.md new file mode 100644 index 000000000..924e33353 --- /dev/null +++ b/docs/scripting/functions/SetServerRuleFlags.md @@ -0,0 +1,40 @@ +--- +title: SetServerRuleFlags +description: Sets the flags of a server rule. +tags: ["rule"] +--- + + + +## Description + +Sets the flags of a server rule. + +## Parameters + +| Name | Description | +|---------------------------|-----------------------| +| const rule[] | The server rule name. | +| E_SERVER_RULE_FLAGS:flags | The flags to set. | + +## Returns + +Returns true if the function executed successfully, otherwise false. + +## Examples + +```c +public OnGameModeInit() +{ + AddServerRule("discord", "discord.gg/samp"); + SetServerRuleFlags("discord", 1); + return 1; +} +``` + +## Related Functions + +- [AddServerRule](AddServerRule): Add a server rule. +- [RemoveServerRule](RemoveServerRule): Remove the server rule. +- [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. +- [GetServerRuleFlags](GetServerRuleFlags): Gets the flags of a server rule. diff --git a/docs/scripting/functions/SetVehicleBeenOccupied.md b/docs/scripting/functions/SetVehicleBeenOccupied.md new file mode 100644 index 000000000..aa1d15655 --- /dev/null +++ b/docs/scripting/functions/SetVehicleBeenOccupied.md @@ -0,0 +1,28 @@ +--- +title: SetVehicleBeenOccupied +description: Sets the vehicle's occupancy. +tags: ["vehicle"] +--- + + + +## Description + +Sets the vehicle's occupancy. + +## Parameters + +| Name | Description | +|---------------|--------------------------------------| +| vehicleid | The ID of the vehicle. | +| bool:occupied | **true**: occupied - **false**: not occupied | + +## Examples + +```c +SetVehicleBeenOccupied(vehicleid, true); +``` + +## Related Functions + +- [HasVehicleBeenOccupied](HasVehicleBeenOccupied): Check if a vehicle is occupied. diff --git a/docs/scripting/functions/SetVehicleDead.md b/docs/scripting/functions/SetVehicleDead.md new file mode 100644 index 000000000..26e5d1e1a --- /dev/null +++ b/docs/scripting/functions/SetVehicleDead.md @@ -0,0 +1,28 @@ +--- +title: SetVehicleDead +description: Sets the vehicle to dead. +tags: ["vehicle"] +--- + + + +## Description + +Sets the vehicle to dead. + +## Parameters + +| Name | Description | +|-----------|--------------------------------------| +| vehicleid | The ID of the vehicle. | +| bool:dead | **true**: dead - **false**: not dead | + +## Examples + +```c +SetVehicleDead(vehicleid, true); +``` + +## Related Functions + +- [IsVehicleDead](IsVehicleDead): Check if a vehicle is dead. diff --git a/docs/scripting/functions/SetVehicleNumberPlate.md b/docs/scripting/functions/SetVehicleNumberPlate.md index 3d0f0da43..356da01ab 100644 --- a/docs/scripting/functions/SetVehicleNumberPlate.md +++ b/docs/scripting/functions/SetVehicleNumberPlate.md @@ -51,6 +51,7 @@ You can use color embedding on the number plate text. ## Related Functions +- [GetVehicleNumberPlate](GetVehicleNumberPlate): Get the number plate of a vehicle. - [SetVehicleToRespawn](SetVehicleToRespawn): Respawn a vehicle. - [ChangeVehicleColor](ChangeVehicleColor): Set the color of a vehicle. - [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Change the paintjob on a vehicle. diff --git a/docs/scripting/functions/SetVehicleOccupiedTick.md b/docs/scripting/functions/SetVehicleOccupiedTick.md new file mode 100644 index 000000000..0446dfbaa --- /dev/null +++ b/docs/scripting/functions/SetVehicleOccupiedTick.md @@ -0,0 +1,40 @@ +--- +title: SetVehicleOccupiedTick +description: Set the occupied tick of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Set the occupied tick of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | +| ticks | The ticks to set. | + +## Return Values + +**true** - Function executed successfully. + +**false** - Function failed to execute. + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + SetVehicleOccupiedTick(vehicleid, 300); + return 1; +} +``` + +## Related Functions + +- [GetVehicleOccupiedTick](GetVehicleOccupiedTick): Get the occupied tick of a vehicle. diff --git a/docs/scripting/functions/SetVehicleParamsSirenState.md b/docs/scripting/functions/SetVehicleParamsSirenState.md new file mode 100644 index 000000000..106d94f36 --- /dev/null +++ b/docs/scripting/functions/SetVehicleParamsSirenState.md @@ -0,0 +1,30 @@ +--- +title: SetVehicleParamsSirenState +description: Turn the siren for a vehicle on or off. +tags: ["vehicle"] +--- + + + +## Description + +Turn the siren for a vehicle on or off. + +## Parameters + +| Name | Description | +|--------------|-------------------------------| +| vehicleid | The ID of the vehicle. | +| bool:enabled | **true**: On - **false**: Off | + +## Examples + +```c +SetVehicleParamsSirenState(vehicleid, true); +``` + +## Related Functions + +- [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Returns a vehicle's siren state (on/off). +- [GetVehicleSirenState](GetVehicleSirenState): Gets the siren state of the vehicle. +- [GetPlayerSirenState](GetPlayerSirenState): Gets the siren state of the player's vehicle. diff --git a/docs/scripting/functions/SetVehicleRespawnDelay.md b/docs/scripting/functions/SetVehicleRespawnDelay.md new file mode 100644 index 000000000..f4c563798 --- /dev/null +++ b/docs/scripting/functions/SetVehicleRespawnDelay.md @@ -0,0 +1,34 @@ +--- +title: SetVehicleRespawnDelay +description: Set the respawn delay of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Set the respawn delay of a vehicle. + +## Parameters + +| Name | Description | +|--------------|----------------------------------------| +| vehicleid | The ID of the vehicle. | +| respawnDelay | The respawn delay (in seconds) to set. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + SetVehicleRespawnDelay(vehicleid, 120); + return 1; +} +``` + +## Related Functions + +- [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle. diff --git a/docs/scripting/functions/SetVehicleRespawnTick.md b/docs/scripting/functions/SetVehicleRespawnTick.md new file mode 100644 index 000000000..fd25961e4 --- /dev/null +++ b/docs/scripting/functions/SetVehicleRespawnTick.md @@ -0,0 +1,40 @@ +--- +title: SetVehicleRespawnTick +description: Set the respawn tick of a vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Set the respawn tick of a vehicle. + +## Parameters + +| Name | Description | +|-----------|------------------------| +| vehicleid | The ID of the vehicle. | +| ticks | The ticks to set. | + +## Return Values + +**true** - Function executed successfully. + +**false** - Function failed to execute. + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); + + SetVehicleRespawnTick(vehicleid, 300); + return 1; +} +``` + +## Related Functions + +- [GetVehicleRespawnTick](GetVehicleRespawnTick): Get the respawn tick of a vehicle. diff --git a/docs/scripting/functions/SetVehicleSpawnInfo.md b/docs/scripting/functions/SetVehicleSpawnInfo.md new file mode 100644 index 000000000..e7ce1f169 --- /dev/null +++ b/docs/scripting/functions/SetVehicleSpawnInfo.md @@ -0,0 +1,42 @@ +--- +title: SetVehicleSpawnInfo +description: Adjusts vehicle model, spawn location, colours, respawn delay and interior. +tags: ["vehicle"] +--- + + + +## Description + +Adjusts vehicle model, spawn location, colours, respawn delay and interior. + +## Parameters + +| Name | Description | +|-------------------|-------------------------------------------------------------| +| vehicleid | The ID of the vehicle. | +| modelid | [Vehicle model](../resources/vehicleid) id to set. | +| Float:spawnX | The X coordinate to set. | +| Float:spawnY | The Y coordinate to set. | +| Float:spawnZ | The Z coordinate to set. | +| Float:angle | The angle to set. | +| colour1 | The [vehicle colour](../resources/vehiclecolorid) 1 to set. | +| colour2 | The [vehicle colour](../resources/vehiclecolorid) 2 to set. | +| respawnDelay = -2 | The vehicle respawn delay to set. | +| interior = -2 | The interior id to set. | + +## Examples + +```c +public OnGameModeInit() +{ + new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); + + SetVehicleSpawnInfo(vehicleid, 522, 2096.0417, -1314.1062, 24.0078, 0.0000, 1, 7); + return 1; +} +``` + +## Related Functions + +- [GetVehicleSpawnInfo](GetVehicleSpawnInfo): Gets the vehicle spawn location and colours. diff --git a/docs/scripting/functions/ShowVehicle.md b/docs/scripting/functions/ShowVehicle.md new file mode 100644 index 000000000..b37097c59 --- /dev/null +++ b/docs/scripting/functions/ShowVehicle.md @@ -0,0 +1,48 @@ +--- +title: ShowVehicle +description: Shows the hidden vehicle. +tags: ["vehicle"] +--- + + + +## Description + +Shows the hidden vehicle. + +## Parametes + +| Name | Description | +|-----------|--------------------------------| +| vehicleid | The ID of the vehicle to show. | + +## Examples + +```c +new g_Vehicle; + +public OnGameModeInit() +{ + g_Vehicle = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); + HideVehicle(g_Vehicle); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + if (!strcmp(cmdtext, "/showvehicle", true)) + { + if (IsVehicleHidden(g_Vehicle)) + { + ShowVehicle(g_Vehicle); + } + return 1; + } + return 0; +} +``` + +## Related Functions + +- [HideVehicle](HideVehicle): Hides a vehicle from the game. +- [IsVehicleHidden](IsVehicleHidden): Checks if a vehicle is hidden. diff --git a/docs/scripting/functions/ToggleVehicleSirenEnabled.md b/docs/scripting/functions/ToggleVehicleSirenEnabled.md new file mode 100644 index 000000000..7d0534944 --- /dev/null +++ b/docs/scripting/functions/ToggleVehicleSirenEnabled.md @@ -0,0 +1,29 @@ +--- +title: ToggleVehicleSirenEnabled +description: Turn the siren for a vehicle on or off. +tags: ["vehicle"] +--- + + + +## Description + +Turn the siren for a vehicle on or off. + +## Parameters + +| Name | Description | +|--------------|-------------------------------| +| vehicleid | The ID of the vehicle. | +| bool:enabled | **true**: On - **false**: Off | + +## Examples + +```c +ToggleVehicleSirenEnabled(vehicleid, true); +``` + +## Related Functions + +- [GetVehicleSirenState](GetVehicleSirenState): Gets the siren state of the vehicle. +- [GetPlayerSirenState](GetPlayerSirenState): Gets the siren state of the player's vehicle. diff --git a/docs/scripting/functions/VehicleColourIndexToColour.md b/docs/scripting/functions/VehicleColourIndexToColour.md new file mode 100644 index 000000000..7852e328f --- /dev/null +++ b/docs/scripting/functions/VehicleColourIndexToColour.md @@ -0,0 +1,29 @@ +--- +title: VehicleColourIndexToColour +description: Convert a car colour index to a HEX colour (RGBA). +tags: ["vehicle"] +--- + + + +## Description + +Convert a car colour index to a HEX colour (RGBA). + +## Parameters + +| Name | Description | +|--------------|------------------------------------------------| +| index | [Vehicle colour](../resources/vehiclecolorid). | +| alpha = 0xFF | Alpha channel. | + +## Examples + +```c +new colour = VehicleColourIndexToColour(3, 0xFF); +``` + +## Related Functions + +- [GetRandomVehicleColourPair](GetRandomVehicleColourPair): Get random colour indexes that are valid for the given vehicle model. +- [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. diff --git a/docs/scripting/resources/landinggearstate.md b/docs/scripting/resources/landinggearstate.md new file mode 100644 index 000000000..c767223c7 --- /dev/null +++ b/docs/scripting/resources/landinggearstate.md @@ -0,0 +1,9 @@ +--- +title: Vehicle Landing Gear States +description: Vehicle Landing Gear States +--- + +| Definition | ID | +|-------------------------|----| +| LANDING_GEAR_STATE_DOWN | 0 | +| LANDING_GEAR_STATE_UP | 1 |