diff --git a/frontend/docs/scripting/callbacks/OnActorStreamIn.md b/frontend/docs/scripting/callbacks/OnActorStreamIn.md index b5996e9383d..f8358a29b49 100644 --- a/frontend/docs/scripting/callbacks/OnActorStreamIn.md +++ b/frontend/docs/scripting/callbacks/OnActorStreamIn.md @@ -41,3 +41,4 @@ public OnActorStreamIn(actorid, forplayerid) The following callbacks might be useful, as they're related to this callback in one way or another. - [OnActorStreamOut](OnActorStreamOut): This callback is called when an actor streams out by a player's client. +- [OnPlayerStreamIn](OnPlayerStreamIn): This callback is called when a player streams in for another player. diff --git a/frontend/docs/scripting/callbacks/OnActorStreamOut.md b/frontend/docs/scripting/callbacks/OnActorStreamOut.md index 44c44a506d5..5057311fc24 100644 --- a/frontend/docs/scripting/callbacks/OnActorStreamOut.md +++ b/frontend/docs/scripting/callbacks/OnActorStreamOut.md @@ -41,3 +41,4 @@ public OnActorStreamOut(actorid, forplayerid) The following callbacks might be useful, as they're related to this callback in one way or another. - [OnActorStreamIn](OnActorStreamIn): This callback is called when an actor streams in by a player's client. +- [OnPlayerStreamOut](OnPlayerStreamOut): This callback is called when a player streams out for another player. diff --git a/frontend/docs/scripting/callbacks/OnDialogResponse.md b/frontend/docs/scripting/callbacks/OnDialogResponse.md index b6dd06629c5..d1c05f6d0d5 100644 --- a/frontend/docs/scripting/callbacks/OnDialogResponse.md +++ b/frontend/docs/scripting/callbacks/OnDialogResponse.md @@ -126,13 +126,13 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -**DIALOG_STYLE_TABLIST** +**DIALOG_STYLE_TABLIST_HEADERS** ```c #define DIALOG_WEAPONS 3 // In some command -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/docs/scripting/callbacks/OnGameModeExit.md b/frontend/docs/scripting/callbacks/OnGameModeExit.md index 62bfca88a7f..12679d509d0 100644 --- a/frontend/docs/scripting/callbacks/OnGameModeExit.md +++ b/frontend/docs/scripting/callbacks/OnGameModeExit.md @@ -9,6 +9,12 @@ tags: [] This callback is called when a gamemode ends, either through 'gmx', the server being shut down, or GameModeExit. +## Returns + +This callback does not handle returns. + +It is always called first in gamemode. + ## Examples ```c diff --git a/frontend/docs/scripting/callbacks/OnGameModeInit.md b/frontend/docs/scripting/callbacks/OnGameModeInit.md index 430e8689786..c5db59fd3f4 100644 --- a/frontend/docs/scripting/callbacks/OnGameModeInit.md +++ b/frontend/docs/scripting/callbacks/OnGameModeInit.md @@ -9,6 +9,12 @@ tags: [] This callback is triggered when the gamemode starts. +## Returns + +This callback does not handle returns. + +It is always called first in gamemode. + ## Examples ```c diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md index df5c1bf80f1..a945e4fe2ab 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickPlayer.md @@ -39,9 +39,7 @@ public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) :::note -There is currently only one 'source' (0 - `CLICK_SOURCE_SCOREBOARD`). - -The existence of this argument suggests that more sources may be supported in the future. +There is currently only one 'source' (0 - `CLICK_SOURCE_SCOREBOARD`). The existence of this argument suggests that more sources may be supported in the future. ::: diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md index 302f41e3151..79f16e61508 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md @@ -16,6 +16,8 @@ This callback is called when a player clicks on a player-textdraw. It is not cal ## Returns +Returning 1 in this callback will prevent it being called in other scripts. This should be used to signal that the textdraw on which they clicked was 'found' and no further processing is needed. You should return 0 if the textdraw on which they clicked wasn't found, just like in [OnPlayerCommandText](OnPlayerCommandText). + It is always called first in filterscripts so returning 1 there also blocks other scripts from processing it. ## Examples diff --git a/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md index 19fd084eed6..684a16e6c8a 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/docs/scripting/callbacks/OnPlayerClickTextDraw.md @@ -16,6 +16,8 @@ This callback is called when a player clicks on a textdraw or cancels the select ## Returns +Returning 1 in this callback will prevent it being called in other scripts. This should be used to signal that the textdraw on which they clicked was 'found' and no further processing is needed. You should return 0 if the textdraw on which they clicked wasn't found, just like in [OnPlayerCommandText](OnPlayerCommandText). + It is always called first in filterscripts so returning 1 there also blocks other scripts from processing it. ## Examples @@ -64,8 +66,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- The clickable area is defined by [TextDrawTextSize](../functions/TextDrawTextSize). -- The `x` and `y` parameters passed to that function must not be zero or negative. +- The clickable area is defined by [TextDrawTextSize](../functions/TextDrawTextSize). The `x` and `y` parameters passed to that function must not be zero or negative. - Do not use [CancelSelectTextDraw](../functions/CancelSelectTextDraw) unconditionally within this callback. This results in an **infinite loop**. ::: diff --git a/frontend/docs/scripting/callbacks/OnPlayerCommandText.md b/frontend/docs/scripting/callbacks/OnPlayerCommandText.md index cf05b069d57..0ccef9e4272 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerCommandText.md +++ b/frontend/docs/scripting/callbacks/OnPlayerCommandText.md @@ -16,6 +16,10 @@ This callback is called when a player enters a command into the client chat wind ## Returns +1 - The command was processed. + +0 - The command was not processed. If the command was not found both in filterscripts and in gamemode, the player will receive a `SERVER: Unknown command.` message. + It is always called first in filterscripts so returning 1 there blocks other scripts from processing it. ## Examples diff --git a/frontend/docs/scripting/callbacks/OnPlayerDeath.md b/frontend/docs/scripting/callbacks/OnPlayerDeath.md index 74ec478d2b4..60593612bf3 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/docs/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -The reason will return 37 (flame thrower) from any fire sources (e.g. molotov, 18) The reason will return 51 from any weapon that creates an explosion (e.g. RPG, grenade) You do not need to check whether killerid is valid before using it in [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID is a valid killerid ID parameter in that function. playerid is the only one who can call the callback. (good to know for anti fake death) +- The reason will return 37 (flame thrower) from any fire sources (e.g. molotov, 18) +- The reason will return 51 from any weapon that creates an explosion (e.g. RPG, grenade) +- You do not need to check whether killerid is valid before using it in [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID is a valid killerid ID parameter in that function. +- playerid is the only one who can call the callback. (good to know for anti fake death) ::: diff --git a/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md b/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md index 8d2e78cf2aa..1f594483800 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/docs/scripting/callbacks/OnPlayerDisconnect.md @@ -59,9 +59,7 @@ public OnPlayerDisconnect(playerid, reason) :::note -Some functions might not work correctly when used in this callback because the player is already disconnected when the callback is called. This means that you can't get unambiguous information from functions like [GetPlayerIp](../functions/GetPlayerIp) and [GetPlayerPos](../functions/GetPlayerPos). - -This issue is solved in open.mp server. +Some functions might not work correctly when used in this callback because the player is already disconnected when the callback is called. This means that you can't get unambiguous information from functions like [GetPlayerIp](../functions/GetPlayerIp) and [GetPlayerPos](../functions/GetPlayerPos). This issue is solved in open.mp server. ::: diff --git a/frontend/docs/scripting/callbacks/OnPlayerEditObject.md b/frontend/docs/scripting/callbacks/OnPlayerEditObject.md index dafefa522e8..226ff34263f 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerEditObject.md +++ b/frontend/docs/scripting/callbacks/OnPlayerEditObject.md @@ -100,6 +100,7 @@ The following functions might be useful, as they're related to this callback in - [CreateObject](../functions/CreateObject): Create an object. - [DestroyObject](../functions/DestroyObject): Destroy an object. - [MoveObject](../functions/MoveObject): Move an object. +- [EditObject](../functions/EditObject): Edit an object. ## Related Resources diff --git a/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md b/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md index aad181f9ab1..df9752bc0ba 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md +++ b/frontend/docs/scripting/callbacks/OnPlayerRequestClass.md @@ -16,6 +16,8 @@ This callback is called when a player changes class at class selection (and when ## Returns +Returning 0 in this callback will prevent the player from spawning. The player can be forced to spawn when [SpawnPlayer](../functions/SpawnPlayer) is used. + It is always called first in filterscripts. ## Examples diff --git a/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md index 6bc3ffecebb..dda8e9d1e28 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md @@ -27,6 +27,8 @@ It is always called first in filterscripts so returning 1 there blocks other fil ## Examples +**Example - Debugging** + ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { @@ -52,6 +54,8 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod
+**Example - One-shot-kill sniper headshots** + ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { diff --git a/frontend/docs/scripting/callbacks/OnPlayerText.md b/frontend/docs/scripting/callbacks/OnPlayerText.md index d15c2f7a9af..e209067feeb 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerText.md +++ b/frontend/docs/scripting/callbacks/OnPlayerText.md @@ -16,6 +16,8 @@ This callback is called when a player sends a message in chat. ## Returns +Returning 0 in this callback will stop the text from being sent to all players. + It is always called first in filterscripts so returning 0 on it blocks other scripts from processing it. ## Examples diff --git a/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md b/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md index e157880dc32..60ca7602ae2 100644 --- a/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md +++ b/frontend/docs/scripting/callbacks/OnPlayerWeaponShot.md @@ -7,7 +7,7 @@ tags: ["player"] ## Description -This callback is called when a player fires a weapon. Only firearms are supported. +This callback is called when a player fires a weapon. Only firearms are supported. Only passenger drive-by is supported (not driver drive-by, and not sea sparrow / hunter shots). | Name | Description | | ----------------------- | ------------------------------------------------------------------- | diff --git a/frontend/docs/scripting/callbacks/OnRconCommand.md b/frontend/docs/scripting/callbacks/OnRconCommand.md index 26986376527..2e352d36531 100644 --- a/frontend/docs/scripting/callbacks/OnRconCommand.md +++ b/frontend/docs/scripting/callbacks/OnRconCommand.md @@ -15,6 +15,10 @@ This callback is called when a command is sent through the server console, RCON ## Returns +0 - The command was not processed, it will be passed to another script. + +1 - The command was processed, it will not be passed to other scripts. + It is always called first in filterscripts so returning 1 on it blocks the main script from processing it. ## Examples @@ -25,7 +29,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: You typed '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/docs/scripting/callbacks/OnTrailerUpdate.md b/frontend/docs/scripting/callbacks/OnTrailerUpdate.md index 2a211af0000..2a6050a5595 100644 --- a/frontend/docs/scripting/callbacks/OnTrailerUpdate.md +++ b/frontend/docs/scripting/callbacks/OnTrailerUpdate.md @@ -36,7 +36,8 @@ public OnTrailerUpdate(playerid, vehicleid) :::warning -This callback is called very frequently per second per trailer. You should refrain from implementing intensive calculations or intensive file writing/reading operations in this callback. +- This callback is called very frequently per second per trailer. You should refrain from implementing intensive calculations or intensive file writing/reading operations in this callback. +- This callback is not called for trains. ::: diff --git a/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md b/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md index cc1f31edfe2..2169be2b3e5 100644 --- a/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md +++ b/frontend/docs/scripting/callbacks/OnUnoccupiedVehicleUpdate.md @@ -23,6 +23,8 @@ This callback is called when a player's client updates/syncs the position of a v ## Returns +Returning 0 in this callback will stop the vehicle's position being synced to other players. Update is still sent to the updating player. + It is always called first in filterscripts so returning 0 there also blocks other scripts from processing it. ## Examples @@ -47,6 +49,7 @@ public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_ - This callback is called very frequently per second per unoccupied vehicle. You should refrain from implementing intensive calculations or intensive file writing/reading operations in this callback. - [GetVehiclePos](../functions/GetVehiclePos) will return the old coordinates of the vehicle before this update. +- This callback is not called for trains. ::: diff --git a/frontend/docs/scripting/callbacks/OnVehicleDeath.md b/frontend/docs/scripting/callbacks/OnVehicleDeath.md index bd8c4d52211..84d3d105363 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/docs/scripting/callbacks/OnVehicleDeath.md @@ -34,8 +34,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- This callback will also be called when a vehicle enters water, but the vehicle can be saved from destruction by teleportation or driving out (if only partially submerged). -- The callback won't be called a second time, and the vehicle may disappear when the driver exits, or after a short time. +This callback will also be called when a vehicle enters water, but the vehicle can be saved from destruction by teleportation or driving out (if only partially submerged). The callback won't be called a second time, and the vehicle may disappear when the driver exits, or after a short time. ::: diff --git a/frontend/docs/scripting/callbacks/OnVehicleMod.md b/frontend/docs/scripting/callbacks/OnVehicleMod.md index 46a2d9ff385..4a7633e2ac3 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleMod.md +++ b/frontend/docs/scripting/callbacks/OnVehicleMod.md @@ -17,6 +17,8 @@ This callback is called when a vehicle is modded. ## Returns +Return 0 to desync the mod from propagating. + It is always called first in gamemode so returning 0 there also blocks other filterscripts from processing it. ## Examples diff --git a/frontend/docs/scripting/callbacks/OnVehicleRespray.md b/frontend/docs/scripting/callbacks/OnVehicleRespray.md index 941a8d8d67c..5140f03c3d6 100644 --- a/frontend/docs/scripting/callbacks/OnVehicleRespray.md +++ b/frontend/docs/scripting/callbacks/OnVehicleRespray.md @@ -18,6 +18,8 @@ This callback is called when a player exits a mod shop, even if the colors weren ## Returns +Returning 0 in this callback will deny the colour change. Returning 1 will allow it. + It is always called first in gamemode so returning 0 there also blocks other filterscripts from processing it. ## Examples diff --git a/frontend/docs/scripting/functions/AddCharModel.md b/frontend/docs/scripting/functions/AddCharModel.md index 0bbf4e4ac5b..f6f75f2fc8a 100644 --- a/frontend/docs/scripting/functions/AddCharModel.md +++ b/frontend/docs/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Notes :::note diff --git a/frontend/docs/scripting/functions/AddSimpleModel.md b/frontend/docs/scripting/functions/AddSimpleModel.md index 4607b0084ad..75d58c8f210 100644 --- a/frontend/docs/scripting/functions/AddSimpleModel.md +++ b/frontend/docs/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Notes :::note diff --git a/frontend/docs/scripting/functions/AddStaticPickup.md b/frontend/docs/scripting/functions/AddStaticPickup.md index ee250c23e3b..92ea3f417fc 100644 --- a/frontend/docs/scripting/functions/AddStaticPickup.md +++ b/frontend/docs/scripting/functions/AddStaticPickup.md @@ -52,6 +52,10 @@ This function doesn't return a pickup ID that you can use in, for example, OnPla - [CreatePickup](CreatePickup): Create a pickup. - [DestroyPickup](DestroyPickup): Destroy a pickup. +## Related Callbacks + +- [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): Called when a player picks up a pickup. + ## Related Resources - [Pickup IDs](../resources/pickupids) diff --git a/frontend/docs/scripting/functions/BanEx.md b/frontend/docs/scripting/functions/BanEx.md index 03d910915e7..0e65ec1a9c1 100644 --- a/frontend/docs/scripting/functions/BanEx.md +++ b/frontend/docs/scripting/functions/BanEx.md @@ -42,6 +42,8 @@ public OnPlayerCommandText( playerid, cmdtext[] )
+The following code snippet shows a way of displaying a message for the player before they are banned: + ```c // In order to display a message (eg. reason) for the player before the connection is closed // you have to use a timer to create a delay. This delay needs only to be a few milliseconds long, diff --git a/frontend/docs/scripting/functions/CancelSelectTextDraw.md b/frontend/docs/scripting/functions/CancelSelectTextDraw.md index ed084db0568..d7e3beab044 100644 --- a/frontend/docs/scripting/functions/CancelSelectTextDraw.md +++ b/frontend/docs/scripting/functions/CancelSelectTextDraw.md @@ -36,9 +36,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::warning -This function calls [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) with INVALID_TEXT_DRAW (65535). - -Using this function inside OnPlayerClickTextDraw without catching this case will cause clients to go into an infinite loop. +This function calls [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) with INVALID_TEXT_DRAW (65535). Using this function inside OnPlayerClickTextDraw without catching this case will cause clients to go into an infinite loop. ::: diff --git a/frontend/docs/scripting/functions/Create3DTextLabel.md b/frontend/docs/scripting/functions/Create3DTextLabel.md index a97866c48e3..f51063171f3 100644 --- a/frontend/docs/scripting/functions/Create3DTextLabel.md +++ b/frontend/docs/scripting/functions/Create3DTextLabel.md @@ -63,7 +63,8 @@ drawDistance seems to be a lot smaller when spectating. :::tip -Use colour embedding for multiple colours in the text. +- Use colour embedding for multiple colours in the text. +- To remove the background use colour with transparency less than 0xFF. ::: diff --git a/frontend/docs/scripting/functions/CreateObject.md b/frontend/docs/scripting/functions/CreateObject.md index 531af05f8a4..45a477bc8af 100644 --- a/frontend/docs/scripting/functions/CreateObject.md +++ b/frontend/docs/scripting/functions/CreateObject.md @@ -20,6 +20,10 @@ Creates an object at specified coordinates in the game world. | Float:rotationZ | The Z rotation of the object. | | Float:drawDistance | (optional) The distance that San Andreas renders objects at. 0.0 will cause objects to render at their default distances. | +## Returns + +The ID of the object that was created, or INVALID_OBJECT_ID if the object limit (MAX_OBJECTS) was reached. + ## Examples ```c @@ -35,7 +39,9 @@ public OnGameModeInit() :::note -There is a limit of 1000 objects (MAX_OBJECTS). To circumvent this limit, you can use the [streamer](https://github.com/samp-incognito/samp-streamer-plugin) plugin. +- Objects that emit light (lampposts, police lights, bollard lights, neons etc.) that have a greater rotation than 16.26 degrees (or -16.26) on either the X or Y axis will stop shining. This effect also applies to light objects attached to other objects, players and vehicles. If a light object is attached to a car and the car is rotated over 16.26 degrees (like in a rollover), the object will also stop emitting light. This is a GTA:SA issue, not a server bug. +- In case the light is attached to another object, one fix for this is to set `syncRotation` to `false` in [AttachObjectToObject](AttachObjectToObject). This will ensure the light stays at 0 rotation. This would only really work for objects that consist ONLY of light, so it wouldn't work for the police light for example. +- There is a limit of 1000 objects (MAX_OBJECTS). To circumvent this limit, you can use the [streamer](https://github.com/samp-incognito/samp-streamer-plugin) plugin. ::: diff --git a/frontend/docs/scripting/functions/CreatePlayerTextDraw.md b/frontend/docs/scripting/functions/CreatePlayerTextDraw.md index d3c4034b3c2..793bb590389 100644 --- a/frontend/docs/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/docs/scripting/functions/CreatePlayerTextDraw.md @@ -43,7 +43,16 @@ public OnPlayerConnect(playerid) :::note -Player-textdraws are automatically destroyed when a player disconnects. +- The `x, y` coordinate is the top left coordinate for the text draw area based on a 640x480 "canvas" (irrespective of screen resolution). +- If you plan on using [PlayerTextDrawAlignment](PlayerTextDrawAlignment) with alignment 3 (`TEXT_DRAW_ALIGN_RIGHT`), the `x, y` coordinate is the top right coordinate for the text draw. +- This function merely CREATES the textdraw, you must use [PlayerTextDrawShow](PlayerTextDrawShow) to show it to a player. +- Player-textdraws are automatically destroyed when a player disconnects. + +::: + +:::tip + +It is recommended to use WHOLE numbers instead of decimal positions when creating player textdraws to ensure resolution friendly design. ::: diff --git a/frontend/docs/scripting/functions/DisableInteriorEnterExits.md b/frontend/docs/scripting/functions/DisableInteriorEnterExits.md index 0f4be394a9d..4f083880254 100644 --- a/frontend/docs/scripting/functions/DisableInteriorEnterExits.md +++ b/frontend/docs/scripting/functions/DisableInteriorEnterExits.md @@ -9,6 +9,10 @@ tags: ["interior"] Disable all the interior entrances and exits in the game (the yellow arrows at doors). +## Returns + +This function always returns **true**. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/DisableMenuRow.md b/frontend/docs/scripting/functions/DisableMenuRow.md index 6b1a06baf61..268d8f293dd 100644 --- a/frontend/docs/scripting/functions/DisableMenuRow.md +++ b/frontend/docs/scripting/functions/DisableMenuRow.md @@ -57,8 +57,7 @@ Crashes when passed an invalid menu ID. (Fixed in open.mp) :::note - This function disabled the specified menu row for all players. -- There is no function to disable a menu row for a specific player. -- You'd have to create two menus - one with a row disabled, and one without. Or one per player. +- There is no function to disable a menu row for a specific player. You'd have to create two menus - one with a row disabled, and one without. Or one per player. ::: diff --git a/frontend/docs/scripting/functions/DisableNameTagLOS.md b/frontend/docs/scripting/functions/DisableNameTagLOS.md index 7fc3178bfc3..01e4d11cfd8 100644 --- a/frontend/docs/scripting/functions/DisableNameTagLOS.md +++ b/frontend/docs/scripting/functions/DisableNameTagLOS.md @@ -9,6 +9,10 @@ tags: [] Disables the nametag Line-Of-Sight checking so that players can see nametags through objects. +## Returns + +This function does not return any specific values. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/EditAttachedObject.md b/frontend/docs/scripting/functions/EditAttachedObject.md index 6a2b86d56b4..c760a57fb77 100644 --- a/frontend/docs/scripting/functions/EditAttachedObject.md +++ b/frontend/docs/scripting/functions/EditAttachedObject.md @@ -40,6 +40,12 @@ public OnPlayerCommandText(playerid, cmdtext[]) ## Notes +:::note + +There are 7 clickable buttons in edition mode. The three single icons that have X/Y/Z on them can be dragged to edit position/rotation/scale. The four buttons in a row are to select the edition mode and save edition: Move, Rotate, Scale and Save. + +::: + :::tip You can move the camera while editing by pressing and holding the spacebar (or W in vehicle) and moving your mouse. diff --git a/frontend/docs/scripting/functions/EditPlayerObject.md b/frontend/docs/scripting/functions/EditPlayerObject.md index a748a22b0d1..d85f4c50077 100644 --- a/frontend/docs/scripting/functions/EditPlayerObject.md +++ b/frontend/docs/scripting/functions/EditPlayerObject.md @@ -57,3 +57,4 @@ You can move the camera while editing by pressing and holding the spacebar (or W - [EditAttachedObject](EditAttachedObject): Edit an attached object. - [SelectObject](SelectObject): Select an object. - [CancelEdit](CancelEdit): Cancel the edition of an object. +- [EditObject](EditObject): Edit an object. diff --git a/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md b/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md index 9ce2d0b1ebe..dd5a3a169a2 100644 --- a/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md +++ b/frontend/docs/scripting/functions/EnableVehicleFriendlyFire.md @@ -9,6 +9,10 @@ tags: ["vehicle"] Enable friendly fire for team vehicles. Players will be unable to damage teammates' vehicles (SetPlayerTeam must be used!). +## Returns + +This function does not return any specific values. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/ForceClassSelection.md b/frontend/docs/scripting/functions/ForceClassSelection.md index 7ea7e9ad5cb..76c9383968e 100644 --- a/frontend/docs/scripting/functions/ForceClassSelection.md +++ b/frontend/docs/scripting/functions/ForceClassSelection.md @@ -37,7 +37,8 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::warning -This function does not perform a state change to `PLAYER_STATE_WASTED` when combined with TogglePlayerSpectating (see example above), as is listed here. +- The player will not return to class selection until they re-spawn. This can be achieved with [TogglePlayerSpectating](TogglePlayerSpectating), as seen in the example above. +- This function does not perform a state change to `PLAYER_STATE_WASTED` when combined with TogglePlayerSpectating (see example above), as is listed here. ::: diff --git a/frontend/docs/scripting/functions/GameModeExit.md b/frontend/docs/scripting/functions/GameModeExit.md index be808661504..d7b96542d49 100644 --- a/frontend/docs/scripting/functions/GameModeExit.md +++ b/frontend/docs/scripting/functions/GameModeExit.md @@ -9,6 +9,10 @@ tags: [] Ends the current gamemode. +## Returns + +This function does not return any specific values. + ## Examples ```c @@ -21,3 +25,7 @@ if (OneTeamHasWon) ## Related Functions - [SetModeRestartTime](SetModeRestartTime): Sets the delay between loading main scripts, in seconds. + +## Related Callbacks + +- [OnGameModeExit](../callbacks/OnGameModeExit): Called when a gamemode ends. diff --git a/frontend/docs/scripting/functions/GameTextForPlayer.md b/frontend/docs/scripting/functions/GameTextForPlayer.md index 45feaa9212a..3dedeaa265d 100644 --- a/frontend/docs/scripting/functions/GameTextForPlayer.md +++ b/frontend/docs/scripting/functions/GameTextForPlayer.md @@ -58,7 +58,7 @@ Also, a blank space at end of the string may result in faliure. For example: `"H - [HideGameTextForAll](HideGameTextForAll): Stop showing a gametext style for all players. - [GetGameText](GetGameText): Gets all the information on the given game text style. - [HasGameText](HasGameText): Does the player currently have text in the given gametext style displayed? -- [TextDrawShowForAll](TextDrawShowForAll): Show a textdraw for all players. +- [TextDrawShowForPlayer](TextDrawShowForPlayer): Show a textdraw for a certain player. ## Related Resources diff --git a/frontend/docs/scripting/functions/GangZoneShowForPlayer.md b/frontend/docs/scripting/functions/GangZoneShowForPlayer.md index 55b98c66d3b..89e986fe288 100644 --- a/frontend/docs/scripting/functions/GangZoneShowForPlayer.md +++ b/frontend/docs/scripting/functions/GangZoneShowForPlayer.md @@ -41,7 +41,7 @@ public OnPlayerSpawn(playerid) - [GangZoneCreate](GangZoneCreate): Create a gangzone. - [GangZoneDestroy](GangZoneDestroy): Destroy a gangzone. -- [GangZoneShowForPlayer](GangZoneShowForPlayer): Show a gangzone for a player. +- [GangZoneShowForAll](GangZoneShowForAll): Show a gangzone for all players. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Hide a gangzone for a player. - [GangZoneHideForAll](GangZoneHideForAll): Hide a gangzone for all players. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Make a gangzone flash for a player. diff --git a/frontend/docs/scripting/functions/GetGravity.md b/frontend/docs/scripting/functions/GetGravity.md index 002eb8258b0..45401097a88 100644 --- a/frontend/docs/scripting/functions/GetGravity.md +++ b/frontend/docs/scripting/functions/GetGravity.md @@ -9,6 +9,10 @@ tags: [] Get the currently global gravity. +## Returns + +The current set gravity (as a float). + ## Examples **SA-MP server:** diff --git a/frontend/docs/scripting/functions/GetMaxPlayers.md b/frontend/docs/scripting/functions/GetMaxPlayers.md index 05c6826efbe..08332dce87b 100644 --- a/frontend/docs/scripting/functions/GetMaxPlayers.md +++ b/frontend/docs/scripting/functions/GetMaxPlayers.md @@ -21,8 +21,7 @@ SendClientMessage(playerid, 0xFFFFFFFF, string); :::warning -- This function can not be used in place of MAX_PLAYERS. -- It can not be used at compile time (e.g. for array sizes). +- This function can not be used in place of MAX_PLAYERS. It can not be used at compile time (e.g. for array sizes). - `MAX_PLAYERS` should always be re-defined to what the 'max_players' var will be, or higher. ::: diff --git a/frontend/docs/scripting/functions/GetPVarString.md b/frontend/docs/scripting/functions/GetPVarString.md index a657c0cb775..e2df6b3cbf1 100644 --- a/frontend/docs/scripting/functions/GetPVarString.md +++ b/frontend/docs/scripting/functions/GetPVarString.md @@ -44,7 +44,8 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -If length of string is zero (value not set), `output` text will not be updated or set to anything and will remain with old data, neccesying that you clear the variable to blank value if [GetPVarString](GetPVarString) returns 0 if that behavior is undesired. +- Variables aren't reset until after [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect) is called, so the values are still accessible in OnPlayerDisconnect. +- If length of string is zero (value not set), `output` text will not be updated or set to anything and will remain with old data, neccesying that you clear the variable to blank value if [GetPVarString](GetPVarString) returns 0 if that behavior is undesired. ::: diff --git a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md index 9c2ad158bc3..509853646b6 100644 --- a/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md +++ b/frontend/docs/scripting/functions/GetPlayerCameraTargetPlayer.md @@ -34,7 +34,8 @@ if (IsPlayerAdmin(playerTarget)) :::warning -Do not confuse this function with GetPlayerTargetPlayer. GetPlayerTargetPlayer returns the ID of the player playerid is aming at (with a weapon). GetPlayerCameraTargetPlayer returns the ID of the player playerid is looking at (reference point is the center of the screen). +- This function is disabled by default to save bandwidth. Use [EnablePlayerCameraTarget](EnablePlayerCameraTarget) to enable it for each player. +- Do not confuse this function with GetPlayerTargetPlayer. GetPlayerTargetPlayer returns the ID of the player playerid is aming at (with a weapon). GetPlayerCameraTargetPlayer returns the ID of the player playerid is looking at (reference point is the center of the screen). ::: diff --git a/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md b/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md index 606a9625c09..4188f739dac 100644 --- a/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md +++ b/frontend/docs/scripting/functions/GetPlayerDrunkLevel.md @@ -30,6 +30,14 @@ public OnPlayerStateChange(playerid, oldstate, newstate) } ``` +## Notes + +:::tip + +You can use [ApplyAnimation](ApplyAnimation) to apply a drunk animation. + +::: + ## Related Functions - [SetPlayerDrunkLevel](SetPlayerDrunkLevel): Set a player's drunk level. diff --git a/frontend/docs/scripting/functions/GetPlayerKeys.md b/frontend/docs/scripting/functions/GetPlayerKeys.md index 1e3fc2f7bcb..451a1aff6de 100644 --- a/frontend/docs/scripting/functions/GetPlayerKeys.md +++ b/frontend/docs/scripting/functions/GetPlayerKeys.md @@ -62,6 +62,10 @@ As of update 0.3.7, the keys "A" and "D" are not recognized when in a vehicle. H ::: +## Related Callbacks + +- [OnPlayerKeyStateChange](../callbacks/OnPlayerKeyStateChange): Called when a player's keystate changes. + ## Related Resources - [Keys](../resources/keys) diff --git a/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md b/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md index 910b04ab989..d7c1c088810 100644 --- a/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md +++ b/frontend/docs/scripting/functions/GetPlayerLastShotVectors.md @@ -54,6 +54,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) - This function will only work when lag compensation is enabled. - If the player hit nothing, the hit positions will be 0. This means you can't currently calculate how far a bullet travels through open air. +- The function will return last shot information even if that shot was desynced (by returning 0 in [OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot)). ::: diff --git a/frontend/docs/scripting/functions/GetPlayerName.md b/frontend/docs/scripting/functions/GetPlayerName.md index 2180fa632b1..2bdc7c93153 100644 --- a/frontend/docs/scripting/functions/GetPlayerName.md +++ b/frontend/docs/scripting/functions/GetPlayerName.md @@ -43,11 +43,7 @@ public OnPlayerConnect(playerid) :::note -A player's name can be up to 24 characters long by using [SetPlayerName](SetPlayerName). - -This is defined as `MAX_PLAYER_NAME`. - -However, the client can only join with a nickname between 3 and 20 characters, otherwise the connection will be rejected and the player has to quit to choose a valid name. +A player's name can be up to 24 characters long by using [SetPlayerName](SetPlayerName). This is defined as `MAX_PLAYER_NAME`. However, the client can only join with a nickname between 3 and 20 characters, otherwise the connection will be rejected and the player has to quit to choose a valid name. ::: diff --git a/frontend/docs/scripting/functions/GetServerTickRate.md b/frontend/docs/scripting/functions/GetServerTickRate.md index e6fac10d15e..2102dbcd9b5 100644 --- a/frontend/docs/scripting/functions/GetServerTickRate.md +++ b/frontend/docs/scripting/functions/GetServerTickRate.md @@ -9,6 +9,10 @@ tags: [] Gets the tick rate (like FPS) of the server. +## Returns + +The server tick rate (per second). Returns 0 when the server is just started. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md b/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md index b85ee9294dd..a082b861178 100644 --- a/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md +++ b/frontend/docs/scripting/functions/GetVehicleParamsSirenState.md @@ -54,3 +54,7 @@ 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. + +## Related Callbacks + +- [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Called when a vehicle's siren is toggled on/off. diff --git a/frontend/docs/scripting/functions/GetVehiclePos.md b/frontend/docs/scripting/functions/GetVehiclePos.md index 44153fb1e0f..a86b68caa14 100644 --- a/frontend/docs/scripting/functions/GetVehiclePos.md +++ b/frontend/docs/scripting/functions/GetVehiclePos.md @@ -57,3 +57,4 @@ public OnPlayerCommandText(playerid, cmdtext[]) - [SetVehiclePos](SetVehiclePos): Set the position of a vehicle. - [GetVehicleZAngle](GetVehicleZAngle): Check the current angle of a vehicle. - [GetVehicleRotationQuat](GetVehicleRotationQuat): Get the rotation quaternion of a vehicle. +- [GetVehicleRotation](GetVehicleRotation): Get the rotation of a vehicle on the XYZ axis. diff --git a/frontend/docs/scripting/functions/GetVehicleZAngle.md b/frontend/docs/scripting/functions/GetVehicleZAngle.md index 0fc10194526..d1130314c20 100644 --- a/frontend/docs/scripting/functions/GetVehicleZAngle.md +++ b/frontend/docs/scripting/functions/GetVehicleZAngle.md @@ -53,3 +53,4 @@ public OnPlayerCommandText(playerid, cmdtext[]) - [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. +- [GetVehicleRotation](GetVehicleRotation): Get the rotation of a vehicle on the XYZ axis. diff --git a/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md b/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md index c7a7ef487db..a779a395f47 100644 --- a/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md +++ b/frontend/docs/scripting/functions/ManualVehicleEngineAndLights.md @@ -9,6 +9,10 @@ tags: ["vehicle"] Use this function before any player connects (OnGameModeInit) to tell all clients that the script will control vehicle engines and lights. This prevents the game automatically turning the engine on/off when players enter/exit vehicles and headlights automatically coming on when it is dark. +## Returns + +This function always returns **true**. It cannot fail to execute. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/MoveObject.md b/frontend/docs/scripting/functions/MoveObject.md index 2d973530db2..12921f4ad84 100644 --- a/frontend/docs/scripting/functions/MoveObject.md +++ b/frontend/docs/scripting/functions/MoveObject.md @@ -83,3 +83,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) - [GetPlayerObjectPos](GetPlayerObjectPos): Locate a player object. - [GetPlayerObjectRot](GetPlayerObjectRot): Check the rotation of a player object. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Attach a player object to a player. + +## Related Callbacks + +- [OnObjectMoved](../callbacks/OnObjectMoved): Called when an object stops moving. diff --git a/frontend/docs/scripting/functions/NPC_IsValid.md b/frontend/docs/scripting/functions/NPC_IsValid.md index 5945ba1be06..2539a3ac827 100644 --- a/frontend/docs/scripting/functions/NPC_IsValid.md +++ b/frontend/docs/scripting/functions/NPC_IsValid.md @@ -43,8 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::tip -- Always check if an NPC is valid before performing operations on it. -- This prevents runtime errors and crashes. +- Always check if an NPC is valid before performing operations on it. This prevents runtime errors and crashes. - Use this in loops when iterating through potential NPC IDs. ::: diff --git a/frontend/docs/scripting/functions/PutPlayerInVehicle.md b/frontend/docs/scripting/functions/PutPlayerInVehicle.md index 1e307d92ed2..7b7630ffadb 100644 --- a/frontend/docs/scripting/functions/PutPlayerInVehicle.md +++ b/frontend/docs/scripting/functions/PutPlayerInVehicle.md @@ -51,8 +51,7 @@ You can use [GetPlayerVehicleSeat](GetPlayerVehicleSeat) in a loop to check if a :::warning - If the seat is invalid or already taken, the client will crash when they EXIT the vehicle. -- Putting a player into a vehicle that is not streamed in can be unreliable. This is due to a potential client-side issue where the vehicle may not have fully loaded into memory yet. -- This also applies when attempting to put a player into a vehicle that was just created. +- Putting a player into a vehicle that is not streamed in can be unreliable. This is due to a potential client-side issue where the vehicle may not have fully loaded into memory yet. This also applies when attempting to put a player into a vehicle that was just created. ::: diff --git a/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md b/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md index 8cf49c8a73b..eea585374c8 100644 --- a/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/docs/scripting/functions/RemoveBuildingForPlayer.md @@ -32,7 +32,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` +```c public OnPlayerConnect(playerid) { // When the player connects, all map objects will be removed. diff --git a/frontend/docs/scripting/functions/SelectTextDraw.md b/frontend/docs/scripting/functions/SelectTextDraw.md index 0688d531b14..373ce8762ae 100644 --- a/frontend/docs/scripting/functions/SelectTextDraw.md +++ b/frontend/docs/scripting/functions/SelectTextDraw.md @@ -37,7 +37,8 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::note -It is the TEXT which will be highlighted when hovered over, NOT the box (if one is shown). +- [TextDrawSetSelectable](TextDrawSetSelectable) or [PlayerTextDrawSetSelectable](PlayerTextDrawSetSelectable) MUST be used first, to allow a textdraw to be selectable. +- It is the TEXT which will be highlighted when hovered over, NOT the box (if one is shown). ::: diff --git a/frontend/docs/scripting/functions/SendDeathMessage.md b/frontend/docs/scripting/functions/SendDeathMessage.md index 1f1684dba60..94749967991 100644 --- a/frontend/docs/scripting/functions/SendDeathMessage.md +++ b/frontend/docs/scripting/functions/SendDeathMessage.md @@ -9,6 +9,8 @@ tags: [] Adds a death to the 'killfeed' on the right-hand side of the screen for all players. +The 5 most recent kills are shown on the right side of players' screens. Pressing F9 will hide/show the list. + | Name | Description | | ------ | --------------------------------------------------------------------------------------------------------------------------- | | killer | The ID of the killer (can be INVALID_PLAYER_ID). | diff --git a/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md b/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md index 25888c25897..6d4db732df1 100644 --- a/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md +++ b/frontend/docs/scripting/functions/SendDeathMessageToPlayer.md @@ -9,6 +9,8 @@ tags: ["player"] Adds a death to the 'killfeed' on the right-hand side of the screen for a single player. +The 5 most recent kills are shown on the right side of players' screens. Pressing F9 will hide/show the list. + | Name | Description | | -------- | --------------------------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player to send the death message to. | diff --git a/frontend/docs/scripting/functions/SetObjectMaterialText.md b/frontend/docs/scripting/functions/SetObjectMaterialText.md index 9d4548a2589..c58abadb22f 100644 --- a/frontend/docs/scripting/functions/SetObjectMaterialText.md +++ b/frontend/docs/scripting/functions/SetObjectMaterialText.md @@ -13,13 +13,13 @@ Replace the texture of an object with text. | ---------------------------------------- | -------------------------------------------------------------------------------- | | objectid | The ID of the object to replace the texture of with text. | | const text[] | The text to show on the object. (MAX 2048 characters) | -| materialIndex | The object's material index to replace with text. | -| OBJECT_MATERIAL_SIZE:materialsize | The [size](../resources/materialtextsizes) of the material. | -| const fontFace[] | The font to use. | -| fontSize | The size of the text (MAX 255). | -| bool:bold | Bold text. Set to true for bold, false for not. | -| fontColour | The color of the text, in ARGB format. | -| backgroundColour | The background color, in ARGB format. | +| materialIndex | The object's material index to replace with text (default: 0) (0 to 15). | +| OBJECT_MATERIAL_SIZE:materialsize | The [size](../resources/materialtextsizes) of the material (default: 256x128). | +| const fontFace[] | The font to use (default: Arial). | +| fontSize | The size of the text (default: 24) (MAX 255). | +| bool:bold | Bold text. Set to true for bold, false for not (default: true). | +| fontColour | The color of the text, in ARGB format (default: White). | +| backgroundColour | The background color, in ARGB format (default: None (transparent)). | | OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | The [alignment](../resources/materialtextalignment) of the text (default: left). | | OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | diff --git a/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md b/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md index 32c0c11ca01..9994b8b85c9 100644 --- a/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/docs/scripting/functions/SetPlayerArmedWeapon.md @@ -28,7 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid, WEAPON_FIST); // disables weapons return 1; } +``` +```c // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { diff --git a/frontend/docs/scripting/functions/SetPlayerCheckpoint.md b/frontend/docs/scripting/functions/SetPlayerCheckpoint.md index ef560889ba2..458f9435e06 100644 --- a/frontend/docs/scripting/functions/SetPlayerCheckpoint.md +++ b/frontend/docs/scripting/functions/SetPlayerCheckpoint.md @@ -54,7 +54,8 @@ public OnPlayerEnterCheckpoint(playerid) :::warning -Checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' checkpoints (only show them when players are close enough), use a checkpoint streamer. +- Checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' checkpoints (only show them when players are close enough), use a checkpoint streamer. +- Checkpoints created on server-created objects ([CreateObject](CreateObject)/[CreatePlayerObject](CreatePlayerObject)) will appear down on the 'real' ground, but will still function correctly. A pickup can be used instead. ::: diff --git a/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md b/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md index ae7b9c1ef3e..6ab5ccbc8cd 100644 --- a/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md +++ b/frontend/docs/scripting/functions/SetPlayerObjectMaterialText.md @@ -9,20 +9,20 @@ tags: ["player", "object", "playerobject"] Replace the texture of a player object with text. -| Name | Description | -| ---------------------------------------- | ------------------------------------------------------------------------------ | -| playerid | The ID of the player whose player object to set the text of. | -| objectid | The ID of the object on which to place the text. | -| text[] | The text to set. | -| materialIndex | The material index to replace with text (DEFAULT: 0). | -| OBJECT_MATERIAL_SIZE:materialSize | The [size](../resources/materialtextsizes) of the material (DEFAULT: 256x128). | -| const fontFace[] | The font to use (DEFAULT: Arial). | -| fontSize | The size of the text (DEFAULT: 24) (MAX 255). | -| bool:bold | Bold text. Set to 1 for bold, 0 for not (DEFAULT: 1). | -| fontColour | The color of the text (DEFAULT: White). | -| backgroundColour | The background color (DEFAULT: None (transparent)). | -| OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | The [alignment](../resources/materialtextsizes) of the text (DEFAULT: Left). | -| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | +| Name | Description | +| ---------------------------------------- | -------------------------------------------------------------------------------- | +| playerid | The ID of the player whose player object to set the text of. | +| objectid | The ID of the object on which to place the text. | +| text[] | The text to set. | +| materialIndex | The material index to replace with text (DEFAULT: 0). | +| OBJECT_MATERIAL_SIZE:materialSize | The [size](../resources/materialtextsizes) of the material (DEFAULT: 256x128). | +| const fontFace[] | The font to use (DEFAULT: Arial). | +| fontSize | The size of the text (DEFAULT: 24) (MAX 255). | +| bool:bold | Bold text. Set to 1 for bold, 0 for not (DEFAULT: 1). | +| fontColour | The color of the text (DEFAULT: White). | +| backgroundColour | The background color (DEFAULT: None (transparent)). | +| OBJECT_MATERIAL_TEXT_ALIGN:textAlignment | The [alignment](../resources/materialtextalignment) of the text (DEFAULT: Left). | +| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | ## Returns diff --git a/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md b/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md index feb19734811..1138e549de4 100644 --- a/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md +++ b/frontend/docs/scripting/functions/SetPlayerRaceCheckpoint.md @@ -62,7 +62,8 @@ public SetRaceCheckpoint(playerid, Airrace, target, next) :::warning -Race checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' race checkpoints (only show them when players are close enough), use a race checkpoint streamer. +- Race checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' race checkpoints (only show them when players are close enough), use a race checkpoint streamer. +- Race checkpoints created on server-created objects ([CreateObject](CreateObject)/[CreatePlayerObject](CreatePlayerObject)) will appear down on the 'real' ground, but will still function correctly. ::: diff --git a/frontend/docs/scripting/functions/SetPlayerSkin.md b/frontend/docs/scripting/functions/SetPlayerSkin.md index df23264ec84..2689938715b 100644 --- a/frontend/docs/scripting/functions/SetPlayerSkin.md +++ b/frontend/docs/scripting/functions/SetPlayerSkin.md @@ -35,7 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) diff --git a/frontend/docs/scripting/functions/SetTimerEx.md b/frontend/docs/scripting/functions/SetTimerEx.md index 4b3d3cddaf2..b6aba71a8db 100644 --- a/frontend/docs/scripting/functions/SetTimerEx.md +++ b/frontend/docs/scripting/functions/SetTimerEx.md @@ -34,6 +34,8 @@ SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid);
+**Implementation:** + ```c // The event callback (OnPlayerSpawn) - we will start a timer here public OnPlayerSpawn(playerid) diff --git a/frontend/docs/scripting/functions/SetVehicleParamsEx.md b/frontend/docs/scripting/functions/SetVehicleParamsEx.md index ea549284f5a..f219c6a70f8 100644 --- a/frontend/docs/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/docs/scripting/functions/SetVehicleParamsEx.md @@ -29,10 +29,6 @@ Sets a vehicle's parameters for all players. ## Examples ```c -// On top of our script, declaring a global variable -new - gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; - // If setting a single parameter, you should obtain the current parameters so they aren't ALL changed new engine, lights, alarm, doors, bonnet, boot, objective; @@ -40,6 +36,12 @@ new // Somewhere where you create the vehicle.. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed to VEHICLE_PARAMS_ON (1) +``` + +```c +// On top of our script, declaring a global variable +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; // The function SetVehicleParamsEx_Fixed(vehicleid, &bool:engine, &bool:lights, &bool:alarm, &bool:doors, &bool:bonnet, &bool:boot, &bool:objective) diff --git a/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md index 541d025707b..c719533df6b 100644 --- a/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/docs/scripting/functions/SetVehicleParamsForPlayer.md @@ -36,7 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, VEHICLE_PARAMS_OFF); +``` +```c // Locks own car for all players, except the player who used the command. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -59,7 +61,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c // Will show vehicle markers for players streaming in for 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; @@ -82,7 +86,11 @@ public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` + +Another way by theAlone +```c //Top new myMarkedCar; @@ -107,7 +115,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) :::note -Vehicles must be respawned for the 'objective' to be removed. +Vehicles must be respawned for the 'objective' to be removed. This can be circumvented somewhat using [GetVehicleParamsEx](GetVehicleParamsEx)/[SetVehicleParamsEx](SetVehicleParamsEx) which do not require the vehicle to be respawned (see the first example above). It is worth noting however that the objective will be disabled on a global scale, and this is only useful if only one player has the vehicle as an objective. ::: diff --git a/frontend/docs/scripting/functions/UsePlayerPedAnims.md b/frontend/docs/scripting/functions/UsePlayerPedAnims.md index d32444ccae3..a8d7f0770ba 100644 --- a/frontend/docs/scripting/functions/UsePlayerPedAnims.md +++ b/frontend/docs/scripting/functions/UsePlayerPedAnims.md @@ -9,6 +9,10 @@ tags: ["player"] Uses standard player walking animation (animation of the CJ skin) instead of custom animations for every skin (e.g. skating for skater skins). +## Returns + +This function does not return any specific values. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/fopen.md b/frontend/docs/scripting/functions/fopen.md index 83e738720d1..606d50be58f 100644 --- a/frontend/docs/scripting/functions/fopen.md +++ b/frontend/docs/scripting/functions/fopen.md @@ -148,7 +148,8 @@ else :::warning -If you use `io_read` and the file doesn't exist, it will return a NULL reference. Using invalid references on file functions will crash your server! +- This function can't access files outside the `scriptfiles` folder! +- If you use `io_read` and the file doesn't exist, it will return a NULL reference. Using invalid references on file functions will crash your server! ::: diff --git a/frontend/docs/scripting/functions/format.md b/frontend/docs/scripting/functions/format.md index 730d1e61b16..908a51158fa 100644 --- a/frontend/docs/scripting/functions/format.md +++ b/frontend/docs/scripting/functions/format.md @@ -70,6 +70,8 @@ format(string, sizeof(string), "The time is %02d:%02d:%02d.", hour, minute, seco
+A quite easy way to insert the literal percent sign (%) is by doing the following. + ```c new string[32]; format(string, sizeof(string), "43%s of my shirts are black.", "%%"); diff --git a/frontend/docs/scripting/functions/ftemp.md b/frontend/docs/scripting/functions/ftemp.md index 8788c0b0495..abff0737dea 100644 --- a/frontend/docs/scripting/functions/ftemp.md +++ b/frontend/docs/scripting/functions/ftemp.md @@ -9,6 +9,10 @@ tags: ["file management"] Creates a file in the "tmp", "temp" or root directory with random name for reading and writing. The file is deleted after fclose() is used on the file. +## Returns + +The temporary file handle. 0 if failed. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/heapspace.md b/frontend/docs/scripting/functions/heapspace.md index e8afd6efc52..0ffe2a7eb17 100644 --- a/frontend/docs/scripting/functions/heapspace.md +++ b/frontend/docs/scripting/functions/heapspace.md @@ -9,6 +9,10 @@ tags: ["core"] Returns the amount of memory available for the heap/stack in bytes. +## Returns + +The free space on the heap in bytes. The stack and the heap occupy a shared memory area, so this value indicates the number of bytes that is left for either the stack or the heap. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/numargs.md b/frontend/docs/scripting/functions/numargs.md index 2d2a18e1feb..cedb30e41c9 100644 --- a/frontend/docs/scripting/functions/numargs.md +++ b/frontend/docs/scripting/functions/numargs.md @@ -9,6 +9,10 @@ tags: ["core", "arguments", "args"] Get the number of arguments passed to a function. +## Returns + +The number of arguments passed. + ## Examples ```c diff --git a/frontend/docs/scripting/functions/random.md b/frontend/docs/scripting/functions/random.md index 238ea1f3053..d2a30c9b079 100644 --- a/frontend/docs/scripting/functions/random.md +++ b/frontend/docs/scripting/functions/random.md @@ -23,6 +23,11 @@ A random number ranging from 0 to max-1. new value = random(5); // 'value' might be 0, 1, 2, 3 or 4. (5 possible values) +``` + +Here's an example of how to script random spawnpoints: + +```c new Float:RandomSpawn[][4] = { // Positions, (X, Y, Z and Facing Angle) diff --git a/frontend/docs/scripting/functions/setproperty.md b/frontend/docs/scripting/functions/setproperty.md index 04a3e94736b..b7fba75e6de 100644 --- a/frontend/docs/scripting/functions/setproperty.md +++ b/frontend/docs/scripting/functions/setproperty.md @@ -22,11 +22,18 @@ This function does not return any specific values. ## Examples +**Storing Integers** + ```c setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Value that was stored is: %d", value); +``` + +**Storing Strings** + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -35,6 +42,11 @@ strunpack(value, value, sizeof(value)); // we need to unpack the string first print(value); //should print :) +``` + +Or... seeing as _all_ the parameters are optional, a piece of code like this similar: + +```c setproperty(.value = 123984334, .string = ":)"); // The rest is the same as above. diff --git a/frontend/docs/scripting/resources/colorslist.md b/frontend/docs/scripting/resources/colorslist.md index 7ec75f6c44f..28a09e8fafe 100644 --- a/frontend/docs/scripting/resources/colorslist.md +++ b/frontend/docs/scripting/resources/colorslist.md @@ -195,7 +195,7 @@ Game text colour tags can be used to form different colours easily. The below co [![Image:Blueandred.png](https://assets.open.mp/assets/images/colorList/Blueandred.png) -Now these colors are pretty dark. You can make them brighter by using **~h~** after the color code: +Now these colors are pretty dark. You can make them brighter by using **`~h~`** after the color code: ```c ~w~Hello this is ~b~~h~blue ~w~and this is ~r~~h~red diff --git a/frontend/docs/scripting/resources/dialogstyles.md b/frontend/docs/scripting/resources/dialogstyles.md index d6215447cdd..8ea9d5564c1 100644 --- a/frontend/docs/scripting/resources/dialogstyles.md +++ b/frontend/docs/scripting/resources/dialogstyles.md @@ -195,7 +195,6 @@ Showing: - **\t** creates a new column. - **\n** creates a new list item. - [Color embedding](colorslist#color-embedding) resets after **\n** and **\t**. -- The first **info** row contains the header. ::: diff --git a/frontend/docs/scripting/resources/mapicons.md b/frontend/docs/scripting/resources/mapicons.md index 7376d475b35..0a555adb535 100644 --- a/frontend/docs/scripting/resources/mapicons.md +++ b/frontend/docs/scripting/resources/mapicons.md @@ -10,6 +10,12 @@ This page has a list of all map icons which can be used by [SetPlayerMapIcon](.. ::: +:::warning + +Map icon ID 1, 2, 4, and 56 will cause your game to crash if you have map legends enabled while viewing the map. + +::: + | ID | Icon | Name | Notes | | --- | ------------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | 0 | ![](https://assets.open.mp/assets/images/mapIcons/icon0.gif) | Colored Square/Triangle (Dynamic) | Can be used in any colour. Used for Single Player objectives. Displays as triangle when the marker isn't at the same ground level with a player | diff --git a/frontend/docs/scripting/resources/shopnames.md b/frontend/docs/scripting/resources/shopnames.md index bf475c45a6b..1ef5d821424 100644 --- a/frontend/docs/scripting/resources/shopnames.md +++ b/frontend/docs/scripting/resources/shopnames.md @@ -9,13 +9,13 @@ In GTA: SA (and SA-MP as well), certain scripts are preprogrammed to run wheneve ::: -| Shop name | GXT name | What is it? | Coordinates | -| --------- | ------------- | -------------------------------- | --------------------------- | -| FDPIZA | Pizza Stack | The stock Pizza Stack interior | 374.0, -119.641, 1000.539 | -| FDCHICK | Cluckin' Bell | The stock Cluckin' Bell interior | 368.789, -6.857, 1000.839 | -| FDBURG | Burger Shot | The stock Burger Shot interior | 375.566, -68.222, 1000.549 | -| AMMUN1 | Ammunation | The first Ammu-Nation interior | 296.506, -38.168, 1000.547 | -| AMMUN2 | Ammunation | The second Ammu-Nation interior | 295.741, -80.479, 1000.534 | -| AMMUN3 | Ammunation | The third Ammu-Nation interior | 290.242, -109.508, 1000.545 | -| AMMUN4 | Ammunation | The fourth Ammu-Nation interior | 308.148, -141.104, 998.618 | -| AMMUN5 | Ammunation | The fifth Ammu-Nation interior | 312.791, -165.949, 998.618 | +| Shop name | GXT name | What is it? | Coordinates | Interior ID | +| --------- | ------------- | -------------------------------- | --------------------------- | ----------- | +| FDPIZA | Pizza Stack | The stock Pizza Stack interior | 374.0, -119.641, 1000.539 | 5 | +| FDCHICK | Cluckin' Bell | The stock Cluckin' Bell interior | 368.789, -6.857, 1000.839 | 9 | +| FDBURG | Burger Shot | The stock Burger Shot interior | 375.566, -68.222, 1000.549 | 10 | +| AMMUN1 | Ammunation | The first Ammu-Nation interior | 296.506, -38.168, 1000.547 | 1 | +| AMMUN2 | Ammunation | The second Ammu-Nation interior | 295.741, -80.479, 1000.534 | 4 | +| AMMUN3 | Ammunation | The third Ammu-Nation interior | 290.242, -109.508, 1000.545 | 6 | +| AMMUN4 | Ammunation | The fourth Ammu-Nation interior | 308.148, -141.104, 998.618 | 7 | +| AMMUN5 | Ammunation | The fifth Ammu-Nation interior | 312.791, -165.949, 998.618 | 6 | diff --git a/frontend/docs/tutorials/perplayervariablesystem.md b/frontend/docs/tutorials/perplayervariablesystem.md new file mode 100644 index 00000000000..6214a83fcba --- /dev/null +++ b/frontend/docs/tutorials/perplayervariablesystem.md @@ -0,0 +1,52 @@ +--- +title: Per-player variable system +sidebar_label: Per-player variable system +description: The per-player variable system (put short, PVar) is a new way of creating player variables in an efficient dynamically created method globally, meaning they can be used in server's gamemode and filterscripts at the same time. +--- + +The **per-player variable system** (put short, **PVar**) is a new way of creating player variables efficiently and dynamically, meaning that they can be used in server's gamemode and filterscripts at the same time. + +They are similar to [SVars](servervariablesystem), but are on a per-player basis. + +:::warning + +This system was introduced in SA-MP 0.3a R5 and will not work in earlier versions! + +::: + +## Advantages + +The per-player variable system has several major advantages over creating an array sized `MAX_PLAYERS`. + +- PVars can be shared/accessed across gamemode scripts and filterscripts, making it easier to modularize your code. + +- PVars are automatically deleted when a player leaves the server (after [OnPlayerDisconnect](../scripting/callbacks/OnPlayerDisconnect)), meaning you don't have to manually reset variables for the next player who joins. + +- No real need for complex enums/player info structures. + +- Saves memory by not allocating pawn array elements for playerids which will probably never be used. + +- You can easily enumerate and print/store the PVar list. This makes both debugging and player info storage easier. + +- Even if a PVar hasn't been created, it still will return a default value of 0. + +- PVars can hold very large strings using dynamically allocated memory. + +- You can Set, Get, Create PVars ingame. + +## Drawbacks + +- PVars are several times slower than regular variables. It is generally more favorable to trade in memory for speed, rather than the other way round. + +## Related Functions + +- [SetPVarInt](../scripting/functions/SetPVarInt): set an integer for a player variable. +- [GetPVarInt](../scripting/functions/GetPVarInt): get the previously set integer from a player variable. +- [SetPVarString](../scripting/functions/SetPVarString): set a string for a player variable. +- [GetPVarString](../scripting/functions/GetPVarString): get the previously set string from a player variable. +- [SetPVarFloat](../scripting/functions/SetPVarFloat): set a float for a player variable. +- [GetPVarFloat](../scripting/functions/GetPVarFloat): get the previously set float from a player variable. +- [DeletePVar](../scripting/functions/DeletePVar): delete a player variable. +- [GetPVarsUpperIndex](../scripting/functions/GetPVarsUpperIndex): each PVar has an index or 'id', this returns the highest one. +- [GetPVarNameAtIndex](../scripting/functions/GetPVarNameAtIndex): get the player variable's name from its index. +- [GetPVarType](../scripting/functions/GetPVarType): get the [type](../scripting/resources/pvartypes) of the player variable. diff --git a/frontend/docs/tutorials/servervariablesystem.md b/frontend/docs/tutorials/servervariablesystem.md index 9f869405985..2930dee1615 100644 --- a/frontend/docs/tutorials/servervariablesystem.md +++ b/frontend/docs/tutorials/servervariablesystem.md @@ -46,3 +46,6 @@ The SVar system is the same as the PVars, although the variables created are ser - [SetSVarFloat](../scripting/functions/SetSVarFloat): set a float for a server variable. - [GetSVarFloat](../scripting/functions/GetSVarFloat): get the previously set float from a server variable - [DeleteSVar](../scripting/functions/DeleteSVar): delete a server variable. +- [GetSVarsUpperIndex](../scripting/functions/GetSVarsUpperIndex): each SVar has an index or 'id', this returns the highest one. +- [GetSVarNameAtIndex](../scripting/functions/GetSVarNameAtIndex): get the server variable's name from its index. +- [GetSVarType](../scripting/functions/GetSVarType): get the [type](../scripting/resources/svartypes) of the server variable. diff --git a/frontend/docs/tutorials/stringmanipulation.md b/frontend/docs/tutorials/stringmanipulation.md index 8f7faac557f..f4aa4148a93 100644 --- a/frontend/docs/tutorials/stringmanipulation.md +++ b/frontend/docs/tutorials/stringmanipulation.md @@ -745,8 +745,8 @@ You can use another combination of characters to play with color mixes, **\~h\~* | ------------------------------ | -------------- | | \~r\~\~h\~ | Lighter red | | \~r\~\~h\~\~h\~ | Red pink | -| \~r\~\~h\~\~h~\~h\~ | Dark red | -| \~r\~\~h\~~h~~h~~h\~ | Light red pink | +| \~r\~\~h\~\~h\~\~h\~ | Dark red | +| \~r\~\~h\~\~h\~\~h\~\~h\~ | Light red pink | | \~r\~\~h\~\~h\~\~h\~\~h\~\~h\~ | Pink | | \~g\~\~h\~ | Light green | diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 6e1fa83b8dd..9ecbe46f7dd 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Uvijek je pozvana prva u filterskripti tako da return-ovanje 1 tu blokira ostale ## Primjeri +**DIALOG_STYLE_MSGBOX** + ```c // Definiramo ID dijaloga kako bismo mogli upravljati odgovorima #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c // definiramo drugi dijalog, dajemo mu za jednu veću vrijednost od prošlog #define DIALOG_LOGIN 2 @@ -80,6 +87,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c // definiramo treci dijalog, ponovno je vrijednost veca od vrijednosti proslog dijaloga #define DIALOG_WEAPONS 3 @@ -105,11 +117,16 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c // ovo je drugi nacin za prikaz i upravljanje za treci dijalog #define DIALOG_WEAPONS 3 // U nekoj komandi ga prikazujemo -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Oruzja", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Oruzja", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index cb611f1b123..ded434612f4 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Razlog će return-ovati 37 (flame thrower/bacač plamena) ako je igrač umro od bilo kojeg izvora vatre (npr. molotov, 18). Razlog će return-ovati 51 ako je igrač umro od bilo koje vrste eksplozije (npr. RPG, granata). Ne moraš provjeravati da li je killerid validan prije nego što ga koristite u `SendDeathMessage`. INVALID_PLAYER_ID je validan killerid ID parametar u toj funkciji. playerid je jedini koji može pozvati ovaj callback. (dobro za znati za sprječavanje lažne smrti 'anti fake death'). +- Razlog će return-ovati 37 (flame thrower/bacač plamena) ako je igrač umro od bilo kojeg izvora vatre (npr. molotov, 18). +- Razlog će return-ovati 51 ako je igrač umro od bilo koje vrste eksplozije (npr. RPG, granata). +- Ne moraš provjeravati da li je killerid validan prije nego što ga koristite u `SendDeathMessage`. INVALID_PLAYER_ID je validan killerid ID parametar u toj funkciji. +- playerid je jedini koji može pozvati ovaj callback. (dobro za znati za sprječavanje lažne smrti 'anti fake death'). ::: diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md index e06e3dead2b..922811f54cf 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md @@ -48,7 +48,9 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod } return 1; } +``` +```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index d1b3cef2ded..0c0812f1942 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 934a18846ca..de71ddcca06 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: napisao si '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 890bc618181..545f6857ce8 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -39,11 +39,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Zabilješke :::note diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 0192cd84120..f1472db3ea5 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -39,10 +39,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Zabilješke :::note diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index b9dc3e83b2e..5744564d14c 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // Da bi se prikazala poruka (npr. razlog) za igrača prije nego se konekcija zatvori // morate koristiti timer kako biste stvorili mali razmak. Ovaj razmak treba da bude dug svega nekoliko milisekundi, // ali ovaj primjer koristi punu sekundu samo da bi bio na sigurnoj strani. diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 242019ecd5b..fa6d3266cc9 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +```c // Da bi se prikazala poruka (npr. razlog) za igrača prije nego se konekcija zatvori // morate koristiti timer kako biste stvorili mali razmak. Ovaj razmak treba da bude dug svega nekoliko milisekundi, // ali ovaj primjer koristi punu sekundu samo da bi bio na sigurnoj strani. diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md index 70bd36d65f5..196691d69a9 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -47,7 +47,7 @@ Player-textdraws se automatski unište kada se igrač diskonektuje. :::warning -Kodovi mapiranja tipkovnice (kao što je ~k~~VEHICLE_ENTER_EXIT~ Ne radi duže od 255. znaka). +Kodovi mapiranja tipkovnice (kao što je `~k~~VEHICLE_ENTER_EXIT~` Ne radi duže od 255. znaka). ::: diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md index d38ddbe0546..56d6b4d1e45 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -46,8 +46,7 @@ Ruši se kada se proslijedi nevažeći ID menija. :::note - Ova je funkcija onemogućila navedeni red menija za sve igrače. -- Ne postoji funkcija za onemogućavanje reda menija za određenog igrača. -- Morali biste stvoriti dva menija - jedan s onemogućenim redom i jedan bez. Ili po jedan po igraču. +- Ne postoji funkcija za onemogućavanje reda menija za određenog igrača. Morali biste stvoriti dva menija - jedan s onemogućenim redom i jedan bez. Ili po jedan po igraču. ::: diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md index 3a4e3938ac1..2155c677b0c 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -32,7 +32,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` +```c public OnPlayerConnect(playerid) { // Kada se igrač konektuje, svi objekti sa mape će se ukloniti. diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md index e540a974091..9bb9c18658f 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -28,7 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid,0); // onemogućuje oružja return 1; } +``` +```c // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md index 0fe24a09244..dd75e67a378 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -35,7 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md index 124f41e2fbb..a5349591772 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -29,10 +29,6 @@ Postavlja parametre vozila za sve igrače. ## Primjeri ```c -// Na vrhu naše skripte, deklarišemo globalnu varijablu -new - gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; - // Ako postavljate jedan parametar, trebali biste dobiti trenutne parametre kako se ne bi SVE promijenili new engine, lights, alarm, doors, bonnet, boot, objective; @@ -40,6 +36,12 @@ new // Negdje gdje kreirate vozilo.. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // SAMO parametar motora je promijenjen u VEHICLE_PARAMS_ON (1) +``` + +```c +// Na vrhu naše skripte, deklarišemo globalnu varijablu +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; // Funkcija SetVehicleParamsEx_Fixed(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective) diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md index 15513f727db..ad9271fdd68 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -36,6 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, 0); +``` + +```c // Zaključava svoje vozilo za sve igrače, osim igrača koji je koristio komandu. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -51,6 +54,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` + +```c // Will show vehicle markers for players streaming in for 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; @@ -73,6 +79,9 @@ public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` + +```c //Top new myMarkedCar; diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md index 9879614561a..46dd8f932da 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md @@ -45,7 +45,7 @@ public OnPlayerConnect(playerid) :::note -- X, Y kordinata je gornja lijeva kordinata za područje textdrawa na osnovu 640x448 "platna" (bez obzira na razlučivost zaslona). +- X, Y kordinata je gornja lijeva kordinata za područje textdrawa na osnovu 640x480 "platna" (bez obzira na razlučivost zaslona). - Ako planirate koristiti TextDrawAlignment s poravnanjem 3 (desno), kordinata x, Y je gornja desna kordinata za crtanje teksta. - Ova funkcija samo KREIRA izvlačenje teksta, za prikaz morate koristiti TextDrawShowForPlayer ili TextDrawShowForAll. @@ -59,7 +59,7 @@ Preporučuje se upotreba CIJELIH brojeva umjesto decimalnih mjesta prilikom krei :::warning -Kodovi preslikavanja tipki na tipkovnici (kao npr ~k~~VEHICLE_ENTER_EXIT~ ne rade preko 255-og karaktera. +Kodovi preslikavanja tipki na tipkovnici (kao npr `~k~~VEHICLE_ENTER_EXIT~` ne rade preko 255-og karaktera. ::: diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md index 55f319b7c04..227986cddfa 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md @@ -43,6 +43,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Otvorite "file.txt" u "write only" načinu (samo pisanje) new File:handle = fopen("file.txt", io_write); @@ -62,6 +65,9 @@ else // Error print("Nesupješno otvaranje file \"file.txt\"."); } +``` + +```c // Otvorite "file.txt" u "read and write" načinu (čitanje i pisanje) new File:handle = fopen("file.txt"), @@ -90,6 +96,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Otvorite "file.txt" u "append only" načinu (samo dodavanje) new File:handle = fopen("file.txt", io_append); diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/format.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/format.md index 76c43590979..16055220f0f 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/format.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/format.md @@ -47,14 +47,23 @@ format(result,sizeof(result), "Broj je %i.",number); //-> The number is 42. new string[]= "simple message"; format(result,sizeof(result), "Ovo je %s koji sadrži broj %i.", string, number); // Ovo je jednostavna poruka koja sadrži broj 42. +``` + +```c new string[64]; format(string,sizeof(string),"Vaš rezultat je: %d",GetPlayerScore(playerid)); SendClientMessage(playerid,0xFFFFFFAA,string); +``` + +```c new hour, minute, second, string[32]; gettime(hour, minute, second); format(string, sizeof(string), "Vrijeme je %02d:%02d:%02d.", hour, minute, second); // Ispisati će nešto kao 09:45:02 SendClientMessage(playerid, -1, string); +``` + +```c new string[35]; format(string,sizeof(string),"43% mojih majica je crno.","%%"); SendClientMessage(playerid,0xFFFFFAA,string); diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fread.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fread.md index fe209bdf0f1..13b40f9547e 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fread.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fread.md @@ -45,6 +45,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Otvorite "file.txt" u "read and write" načinu (čitanje i pisanje) new File:handle = fopen("file.txt"), diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md index 10d38cd55df..a8b4bc8075a 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md @@ -40,6 +40,9 @@ else // Error print("Nesupješno otvaranje file \"file.txt\"."); } +``` + +```c // Otvorite "file.txt" u "read and write" načinu (čitanje i pisanje) new File:handle = fopen("file.txt"), @@ -68,6 +71,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Otvorite "file.txt" u "append only" načinu (samo dodavanje) new File:handle = fopen("file.txt", io_append); diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/random.md index e071082057c..42414bfa34d 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/random.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -23,6 +23,9 @@ Slučajan broj u rasponu od 0 do max-1. new value = random(5); // 'value' može biti 0, 1, 2, 3 ili 4, 5 mogućih vrijednosti. +``` + +```c new Float:RandomSpawn[][4] = { // Pozicije, (X, Y, Z and Facing Angle) diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md index 55828f1c73b..b3aa73cbe95 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -27,6 +27,9 @@ setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Vrijednost koja je sacuvana: %d", value); +``` + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -35,6 +38,9 @@ strunpack(value, value, sizeof(value)); // Prvo moramo da otpakujemo string print(value); // Ispisati će :) +``` + +```c setproperty(.value = 123984334, .string = ":)"); // Ostalo je isto kao i gore. diff --git a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md index 8088eb0b06b..2cfb2d6115f 100644 --- a/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md +++ b/frontend/i18n/bs/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md @@ -25,6 +25,15 @@ Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. new string[4]; new iValue = 250; valstr(string,iValue); // string je sada "250" +``` + +## Zabilješke + +:::warning + +Prosljeđivanje velike vrijednosti ovoj funkciji može dovesti do zamrzavanja / pada sistema. Dostupni su popravci. Ispod je popravak koji se može staviti ravno u vašu skriptu (prije nego što se valstr koristi bilo gdje). open.mp uključuje ovaj popravak. + +```c // valstr fix by Slice stock FIX_valstr(dest[], value, bool:pack = false) { @@ -39,12 +48,6 @@ stock FIX_valstr(dest[], value, bool:pack = false) #define valstr FIX_valstr ``` -## Zabilješke - -:::warning - -Prosljeđivanje velike vrijednosti ovoj funkciji može dovesti do zamrzavanja / pada sistema. Dostupni su popravci. Ispod je popravak koji se može staviti ravno u vašu skriptu (prije nego što se valstr koristi bilo gdje). open.mp uključuje ovaj popravak. - ::: ## Srodne Funkcije diff --git a/frontend/i18n/de/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/de/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 07a456bbbaa..19a39513180 100644 --- a/frontend/i18n/de/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/de/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Wird in Filterscripts immer zuerst ausgeführt. Bei Nutzung von return 1 können ## Beispiele +**DIALOG_STYLE_MSGBOX** + ```c // Definieren der Dialog ID, mit der wie Antworten bearbeiten können #define DIALOG_REGELN 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Hier muss return 0 stehen! Genau wie bei OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // In einem Befehl @@ -79,8 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Hier muss return 0 stehen! Genau wie bei OnPlayerCommandText. } +``` +**DIALOG_STYLE_LIST** +```c #define DIALOG_WAFFEN 3 // In einem Befehl @@ -105,12 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Hier muss return 0 stehen! Genau wie bei OnPlayerCommandText. } +``` +**DIALOG_STYLE_TABLIST_HEADERS** +```c #define DIALOG_WAFFEN 3 // In einem Command -ShowPlayerDialog(playerid, DIALOG_WAFFEN, DIALOG_STYLE_LIST, "Waffen", +ShowPlayerDialog(playerid, DIALOG_WAFFEN, DIALOG_STYLE_TABLIST_HEADERS, "Waffen", "Waffe\tMunition\tPreis\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 0a3617d115d..703240ee3f9 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -26,6 +26,8 @@ Siempre se llama primero en filterscripts. ## Ejemplos +**DIALOG_STYLE_MSGBOX** + ```c // Definimos el ID del diálogo para poder controlar las respuestas #define DIALOG_RULES 1 @@ -50,6 +52,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TENÉS que devolver 0 acá! Como en OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // En algún comando @@ -82,6 +89,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TENÉS que devolver 0 acá! Como en OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // En algún comando @@ -106,10 +118,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TENÉS que devolver 0 acá! Como en OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // En algún comando -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Armas", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Armas", "Arma\tMunición\tPrecio\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md index 62ef2d67c4d..6616e1cb2ca 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md @@ -8,6 +8,10 @@ tags: [] Este callback es llamado cuando un gamemode termina, ya sea mediante 'gmx', cuando el servidor se apaga, o cuando se usa GameModeExit. +## Devoluciones + +Este callback no maneja returns. + ## Ejemplos ```c diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md index 8dd6e2a0999..7e3e536f22f 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md @@ -8,6 +8,10 @@ tags: [] Este callback es desencadenado cuando el gamemode inicia. +## Devoluciones + +Este callback no maneja returns. + ## Ejemplos ```c diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md index a840e0736a4..ecb7553cf70 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md @@ -15,6 +15,8 @@ Este callback se llama cuando un jugador ingresa un comando dentro de la ventana ## Devoluciones +Retornando 0 este callback será ejecutado en otro script o mostrará `SERVER: Unknown command.` si no hay scripts para pasarle este callback. + 1 - Prevendrá a otros filterscripts de recibir este callback. 0 - Indica que este callback será pasado al siguiente filterscript. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md index 9b82f918251..78c8cf04b4a 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerConnect.md @@ -14,9 +14,9 @@ Este callback se llama cuando un jugador se conecta al servidor. ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 810b9264665..b1f0d18b514 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -16,9 +16,9 @@ Este callback se llama cuando un jugador muere, ya sea suicidándose o siendo as ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. @@ -48,7 +48,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -La razón retornará 37 (lanzallamas) por cualquier origen de fuego (ej. molotov, 18). La razón retornará 51 de cualquier arma que cree una explosión (ej. Lanzamisiles, granada). No es necesario comprobar si killerid es válido antes de usarlo en SendDeathMessage, ya que INVALID_PLAYER_ID es un parámetro válido en esa función. playerid es el único que puede llamar el callback. (bueno saberlo para anti fake death) +- La razón retornará 37 (lanzallamas) por cualquier origen de fuego (ej. molotov, 18). +- La razón retornará 51 de cualquier arma que cree una explosión (ej. Lanzamisiles, granada). +- No es necesario comprobar si killerid es válido antes de usarlo en SendDeathMessage, ya que INVALID_PLAYER_ID es un parámetro válido en esa función. +- playerid es el único que puede llamar el callback. (bueno saberlo para anti fake death) ::: diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md index 3bec0390189..0a7aef51f85 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -15,9 +15,9 @@ Este callback se llama cuando un jugador se desconecta del servidor. ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md index 8a985c66a0f..d42a38f1d06 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md @@ -15,6 +15,8 @@ Se llama cuando un jugador cambia de clase en la selección de clase (y cuando l ## Devoluciones +Retornar 0 en este callback evitará que el jugador spawnee. Se puede forzar al jugador a spawnear usando la función [SpawnPlayer](../functions/SpawnPlayer). + Siempre se llama primero en filterscripts. ## Ejemplos diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md index a1b75f6d7dd..8b93682d5c9 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestSpawn.md @@ -14,9 +14,9 @@ Se llama cuando un jugador intenta spawnear vía selección de clase ya sea pres ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md index 59e39840311..c99c52f0ffd 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerSpawn.md @@ -14,9 +14,9 @@ Este callback se llama cuando un jugador spawnea. (ej. después de llamar la fun ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md index 6a8d9dcf2a9..6fed473ccb9 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md @@ -47,7 +47,9 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod } return 1; } +``` +```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md index 78a45b2e35d..4c21bfb944f 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md @@ -15,9 +15,11 @@ Se llama cuando un jugador envía un mensaje en el chat. ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +Retornar 0 en esta callback evitará que el texto escrito se muestre en el chat. -0 - Indica que este callback será pasado al siguiente filterscript. +0 - Prevendrá a otros filterscripts de recibir este callback. + +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 119feabb8db..7eca09dcfe4 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -14,9 +14,9 @@ Este callback se llama cada vez que un cliente/jugador actualiza su estado con e ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. @@ -48,6 +48,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md index ebcb02c0aaf..29f0bd40538 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerWeaponShot.md @@ -20,9 +20,9 @@ Este callback se llama cuando un jugador efectúa un disparo de un arma. Solo so ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index f7e5c359496..0c84fdd7fc0 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -14,6 +14,8 @@ Este callback se llama cuando un comando es enviado mediante la consola del serv ## Devoluciones +0 si el comando no fue procesado (de ser posible, el callback será llamado en otro script), 1 si el comando fue procesado. + 1 - Prevendrá a otros filterscripts de recibir este callback. 0 - Indica que este callback será pasado al siguiente filterscript. @@ -28,7 +30,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: Escribiste '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md index f4b1fef9224..1f2f034878b 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnUnoccupiedVehicleUpdate.md @@ -22,9 +22,11 @@ Este callback se llama cuando el cliente de un jugador actualiza/sincroniza la p ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +Retornar 0 en esta callback causará que el vehículo deje de sincronizar su posición a otros jugadores. -0 - Indica que este callback será pasado al siguiente filterscript. +0 - Prevendrá a otros filterscripts de recibir este callback. + +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md index d0eb95dfbfc..de00b1e4eb6 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleMod.md @@ -16,11 +16,9 @@ Este callback se llama cuando un vehículo es tuneado. ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. - -Siempre se llama primero en filterscripts. +Siempre se llama primero en el gamemode. ## Ejemplos diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md index 4466de98016..689a54b9c6d 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehiclePaintjob.md @@ -16,11 +16,9 @@ Se llama cuando un jugador obtiene una vista previa de una capa de pintura adent ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. - -Siempre se llama primero en filterscripts. +Siempre se llama primero en el gamemode. ## Ejemplos diff --git a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md index d038ee494c9..4ff0d782f9f 100644 --- a/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md +++ b/frontend/i18n/es/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleSpawn.md @@ -20,9 +20,9 @@ Este callback se llama cuando un vehículo reaparece. ## Devoluciones -1 - Prevendrá a otros filterscripts de recibir este callback. +0 - Prevendrá a otros filterscripts de recibir este callback. -0 - Indica que este callback será pasado al siguiente filterscript. +1 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 9aa061d42be..ad127dd4cde 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ tags: [] +**DIALOG_STYLE_MSGBOX** + ```c // Tarif kardane id dialog ke mikhahim ejra shavad #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Bayad inja return 0 konid, mesle OnPlayerCommandText } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // Dar yek dastoor @@ -79,6 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Bayad inja return 0 konid, mesle OnPlayerCommandText } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // Dar yek dastoor @@ -103,10 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Bayad inja return 0 konid, mesle OnPlayerCommandText } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // Dar yek dastoor -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md index 215d68a7ac9..6fc1de810cd 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md @@ -39,9 +39,7 @@ public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) :::note -در حال حاضر فقط یک 'منبع' (0 - `CLICK_SOURCE_SCOREBOARD`) وجود دارد. - -وجود این پارامتر پیشنهاد می‌کند که ممکن است منابع بیشتری در آینده پشتیبانی شوند. +در حال حاضر فقط یک 'منبع' (0 - `CLICK_SOURCE_SCOREBOARD`) وجود دارد. وجود این پارامتر پیشنهاد می‌کند که ممکن است منابع بیشتری در آینده پشتیبانی شوند. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index 01140f0f06e..3c62d232d64 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -64,8 +64,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- ناحیه قابل کلیک توسط [TextDrawTextSize](../functions/TextDrawTextSize) تعریف می‌شود. -- پارامترهای `x` و `y` ارسال شده به آن تابع نباید صفر یا منفی باشند. +- ناحیه قابل کلیک توسط [TextDrawTextSize](../functions/TextDrawTextSize) تعریف می‌شود. پارامترهای `x` و `y` ارسال شده به آن تابع نباید صفر یا منفی باشند. - از [CancelSelectTextDraw](../functions/CancelSelectTextDraw) بدون شرط در داخل این کالبک استفاده نکنید. این منجر به **حلقه بی‌نهایت** می‌شود. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index f37b15479cb..76fc5410379 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -دلیل مرگ 37 (شعله‌افکن) را از هر منبع آتش (مثل مولوتوف، 18) برمی‌گرداند. دلیل مرگ 51 را از هر سلاحی که انفجار ایجاد می‌کند (مثل RPG، نارنجک) برمی‌گرداند. شما نیازی ندارید که قبل از استفاده در [SendDeathMessage](../functions/SendDeathMessage) بررسی کنید که killerid معتبر است یا نه. INVALID_PLAYER_ID یک پارامتر killerid معتبر در آن تابع است. playerid تنها کسی است که می‌تواند این کالبک را فراخوانی کند. (برای ضد تقلب مرگ جعلی مفید است) +- دلیل مرگ 37 (شعله‌افکن) را از هر منبع آتش (مثل مولوتوف، 18) برمی‌گرداند. +- دلیل مرگ 51 را از هر سلاحی که انفجار ایجاد می‌کند (مثل RPG، نارنجک) برمی‌گرداند. +- شما نیازی ندارید که قبل از استفاده در [SendDeathMessage](../functions/SendDeathMessage) بررسی کنید که killerid معتبر است یا نه. INVALID_PLAYER_ID یک پارامتر killerid معتبر در آن تابع است. +- playerid تنها کسی است که می‌تواند این کالبک را فراخوانی کند. (برای ضد تقلب مرگ جعلی مفید است) ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 7602ad38279..e95ecd2acfa 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: You typed '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md index a3cddddf62e..89d6b2baee3 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -34,8 +34,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- این کالبک همچنین زمانی فراخوانده می‌شود که وسیله نقلیه وارد آب شود، اما وسیله نقلیه می‌تواند با teleportation یا رانندگی به بیرون از تخریب نجات پیدا کند (اگر فقط تا حدی غرق باشد). -- کالبک بار دوم فراخوانده نخواهد شد، و وسیله نقلیه ممکن است زمانی که راننده خارج شود یا پس از مدت کوتاهی ناپدید شود. +این کالبک همچنین زمانی فراخوانده می‌شود که وسیله نقلیه وارد آب شود، اما وسیله نقلیه می‌تواند با teleportation یا رانندگی به بیرون از تخریب نجات پیدا کند (اگر فقط تا حدی غرق باشد). کالبک بار دوم فراخوانده نخواهد شد، و وسیله نقلیه ممکن است زمانی که راننده خارج شود یا پس از مدت کوتاهی ناپدید شود. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 4160439d8ed..13746b28344 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## نکات :::note diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 4fa080d6bd9..8a9e57b8566 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## نکات :::note diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md index 4a848a07933..68865cb903f 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md @@ -36,9 +36,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::warning -این تابع [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) را با INVALID_TEXT_DRAW (65535) فراخوانی می‌کند. - -استفاده از این تابع درون OnPlayerClickTextDraw بدون گرفتن این حالت باعث می‌شود که کلاینت‌ها وارد حلقه بی‌نهایت شوند. +این تابع [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) را با INVALID_TEXT_DRAW (65535) فراخوانی می‌کند. استفاده از این تابع درون OnPlayerClickTextDraw بدون گرفتن این حالت باعث می‌شود که کلاینت‌ها وارد حلقه بی‌نهایت شوند. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md index 908b1c161d4..6298089447a 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -49,7 +49,7 @@ Player-textdraw ها هنگام قطع اتصال بازیکن خودکار حذ :::warning -کدهای نگاشت کلیدهای صفحه کلید (مثل ~k~~VEHICLE_ENTER_EXIT~) بعد از کاراکتر 255 کار نمی‌کنند. +کدهای نگاشت کلیدهای صفحه کلید (مثل `~k~~VEHICLE_ENTER_EXIT~`) بعد از کاراکتر 255 کار نمی‌کنند. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md index a7c8589070c..3b58cc17c39 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -57,8 +57,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::note - این تابع ردیف منوی مشخص شده را برای همه بازیکنان غیرفعال می‌کند. -- هیچ تابعی برای غیرفعال کردن ردیف منو برای بازیکن خاص وجود ندارد. -- باید دو منو ایجاد کنید - یکی با ردیف غیرفعال، و یکی بدون آن. یا یکی برای هر بازیکن. +- هیچ تابعی برای غیرفعال کردن ردیف منو برای بازیکن خاص وجود ندارد. باید دو منو ایجاد کنید - یکی با ردیف غیرفعال، و یکی بدون آن. یا یکی برای هر بازیکن. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md index 63ab0905b8e..4221269ff22 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md @@ -27,8 +27,7 @@ SendClientMessage(playerid, 0xFFFFFFFF, string); :::warning -- این تابع نمی‌تونه به جای MAX_PLAYERS استفاده بشه. -- نمی‌تونه در زمان compile استفاده بشه (مثل برای اندازه آرایه‌ها). +- این تابع نمی‌تونه به جای MAX_PLAYERS استفاده بشه. نمی‌تونه در زمان compile استفاده بشه (مثل برای اندازه آرایه‌ها). - `MAX_PLAYERS` همیشه باید دوباره تعریف بشه روی همون مقداری که 'max_players' میشه، یا بالاتر. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md index 33b4299032a..1d9c29b56f4 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md @@ -49,11 +49,7 @@ public OnPlayerConnect(playerid) :::note -اسم بازیکن می‌تونه با استفاده از [SetPlayerName](SetPlayerName) تا 24 کاراکتر طولانی باشه. - -این به عنوان `MAX_PLAYER_NAME` تعریف شده. - -ولی کلاینت فقط می‌تونه با نیک‌نیم بین 3 تا 20 کاراکتر join بشه، وگرنه connection رد میشه و بازیکن باید quit کنه تا اسم معتبری انتخاب کنه. +اسم بازیکن می‌تونه با استفاده از [SetPlayerName](SetPlayerName) تا 24 کاراکتر طولانی باشه. این به عنوان `MAX_PLAYER_NAME` تعریف شده. ولی کلاینت فقط می‌تونه با نیک‌نیم بین 3 تا 20 کاراکتر join بشه، وگرنه connection رد میشه و بازیکن باید quit کنه تا اسم معتبری انتخاب کنه. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md index 10754afa683..85baba5cd75 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md @@ -50,8 +50,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) :::warning - اگه صندلی نامعتبر باشه یا قبلاً گرفته شده باشه، کلاینت هنگ می‌کنه وقتی از وسیله نقلیه خارج می‌شه. -- قرار دادن بازیکن در وسیله نقلیه ای که stream نشده می‌تونه غیرقابل اعتماد باشه. این به خاطر مشکل احتمالی کلاینت هست که وسیله نقلیه ممکنه هنوز کاملاً در حافظه لود نشده باشه. -- این موضوع وقتی هم اعمال می‌شه که می‌خوای بازیکن رو در وسیله نقلیه ای بذاری که تازه ساخته شده. +- قرار دادن بازیکن در وسیله نقلیه ای که stream نشده می‌تونه غیرقابل اعتماد باشه. این به خاطر مشکل احتمالی کلاینت هست که وسیله نقلیه ممکنه هنوز کاملاً در حافظه لود نشده باشه. این موضوع وقتی هم اعمال می‌شه که می‌خوای بازیکن رو در وسیله نقلیه ای بذاری که تازه ساخته شده. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md index 93fbe52805a..f9e54eefa45 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -32,7 +32,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` +```c public OnPlayerConnect(playerid) { // Vaghti ke player vasel mishe, tamame objecthaye map hazf mishan. diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md index b2c5652b552..782cccd5415 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -28,7 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid, WEAPON_FIST); // aslaheharo khamosh mikone return 1; } +``` +```c // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md index 5864f133b3c..cd5fc208bbf 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -29,10 +29,6 @@ tags: ["vehicle"] ## مثال‌ها ```c -// balaaye script, yek global variable declare mikonim -new - gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; - // age yek parameter ro set mikoni, bayad parameteraaye felio begiri ta hame change nashe new bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; @@ -40,6 +36,12 @@ new // jayi ke vehicle ro create mikoni.. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // faghat engine param be VEHICLE_PARAMS_ON (1) taghir yaft +``` + +```c +// balaaye script, yek global variable declare mikonim +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; // tabe SetVehicleParamsEx_Fixed(vehicleid, &bool:engine, &bool:lights, &bool:alarm, &bool:doors, &bool:bonnet, &bool:boot, &bool:objective) diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md index c6ede3ed70a..beaa3920d02 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -36,7 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, false); +``` +```c // mashin khodesho baraye hame playera gholf mikone, joz playeri ke command ro zade. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -59,7 +61,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c // vehicle marker haro baraye playerayi ke stream mishan neshon mide 0.3a+ new bool:iVehicleObjective[MAX_VEHICLES][2]; @@ -82,7 +86,9 @@ public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` +```c //Top new myMarkedCar; diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md index 0ff97af0ab3..e03a61e88d8 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md @@ -63,7 +63,7 @@ public OnPlayerConnect(playerid) :::warning -کدهای mapping کلیدهای صفحه کلید (مانند ~k~~VEHICLE_ENTER_EXIT~) بعد از کاراکتر 255 کار نمی‌کنند. +کدهای mapping کلیدهای صفحه کلید (مانند `~k~~VEHICLE_ENTER_EXIT~`) بعد از کاراکتر 255 کار نمی‌کنند. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/random.md index 20e595699ed..7e2f43255af 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/random.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -23,6 +23,9 @@ tags: ["core"] new value = random(5); // 'value' mitune 0, 1, 2, 3 ya 4 bashe. (5 meghdar momken) +``` + +```c new Float:RandomSpawn[][4] = { // Pozisyonha, (X, Y, Z va Facing Angle) diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md index b1938e1b72c..a21e990a7c3 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -27,6 +27,9 @@ setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Value that was stored is: %d", value); +``` + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -35,6 +38,9 @@ strunpack(value, value, sizeof(value)); // we need to unpack the string first print(value); //should print :) +``` + +```c setproperty(.value = 123984334, .string = ":)"); // The rest is the same as above. diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md index 547c037b97b..ab5f85361d3 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md @@ -228,7 +228,7 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. -- روش Color-Embedding بعد از \n یا \t ریست میشود. اولین خط **info** شامل سر تیتر میشود. +- روش Color-Embedding بعد از \n یا \t ریست میشود. ::: diff --git a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/keys.md b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/keys.md index 8f507680560..be3a1394614 100644 --- a/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/keys.md +++ b/frontend/i18n/fa/docusaurus-plugin-content-docs/current/scripting/resources/keys.md @@ -12,32 +12,32 @@ sidebar_label: "دکمه ها" ::: -| کلان‌دستور (ماکرو) | مقدار | کد جایگذاری (روی زمین) (7) | کد جایگذاری (در ماشین) (7) | کلید پیشفرض (روی زمین) | کلید پیشفرض (در ماشین) | -| ------------------------ | --------- | -------------------------- | --------------------------- | ------------------------------------------------- | ---------------------- | -| KEY_ACTION | 1 | ~k~~PED_ANSWER_PHONE~ | ~k~~VEHICLE_FIREWEAPON_ALT~ | TAB | ALT GR / LCTRL / NUM0 | -| KEY_CROUCH | 2 | ~k~~PED_DUCK~ | ~k~~VEHICLE_HORN~ | C | H / CAPSLOCK | -| KEY_FIRE | 4 | ~k~~PED_FIREWEAPON~ | ~k~~VEHICLE_FIREWEAPON~ | LCTRL / LMB (دکمه چپ ماوس) | LALT | -| KEY_SPRINT | 8 | ~k~~PED_SPRINT~ | ~k~~VEHICLE_ACCELERATE~ | SPACE | W | -| KEY_SECONDARY_ATTACK | 16 | ~k~~VEHICLE_ENTER_EXIT~ | ~k~~VEHICLE_ENTER_EXIT~ | ENTER | ENTER | -| KEY_JUMP | 32 | ~k~~PED_JUMPING~ | ~k~~VEHICLE_BRAKE~ | LSHIFT | S | -| KEY_LOOK_RIGHT | 64 | - | ~k~~VEHICLE_LOOKRIGHT~ | - | E | -| KEY_HANDBRAKE/KEY_AIM(1) | 128 | ~k~~PED_LOCK_TARGET~ | ~k~~VEHICLE_HANDBRAKE~ | RMB (دکمه راست ماوس) | SPACE | -| KEY_LOOK_LEFT | 256 | - | ~k~~VEHICLE_LOOKLEFT~ | - | Q | -| KEY_LOOK_BEHIND | 512 | ~k~~PED_LOOKBEHIND~ | ~k~~VEHICLE_LOOKBEHIND~ | NUM1 / MMB (دکمه وسط ماوس - فشردن دکمه چرخش ماوس) | 2 | -| KEY_SUBMISSION | 512 | - | ~k~~TOGGLE_SUBMISSIONS~ | NUM1 / MMB (دکمه وسط ماوس - فشردن دکمه چرخش ماوس) | 2 / NUMPAD + | -| KEY_WALK | 1024 | ~k~~SNEAK_ABOUT~ | - | LALT | - | -| KEY_ANALOG_UP | 2048 | - | ~k~~VEHICLE_TURRETUP~ | NUM8(6) | NUM8 | -| KEY_ANALOG_DOWN | 4096 | - | ~k~~VEHICLE_TURRETDOWN~ | NUM2(6) | NUM2 | -| KEY_ANALOG_LEFT | 8192 | ~k~~VEHICLE_LOOKLEFT~ | ~k~~VEHICLE_TURRETLEFT~ | NUM4 | NUM4 | -| KEY_ANALOG_RIGHT | 16384 | ~k~~VEHICLE_LOOKRIGHT~ | ~k~~VEHICLE_TURRETRIGHT~ | NUM6 | NUM6 | -| KEY_YES(2) | 65536 | ~k~~CONVERSATION_YES~ | ~k~~CONVERSATION_YES~ | Y | Y | -| KEY_NO(2) | 131072 | ~k~~CONVERSATION_NO~ | ~k~~CONVERSATION_NO~ | N | N | -| KEY_CTRL_BACK(2) | 262144(4) | ~k~~GROUP_CONTROL_BWD~ | ~k~~GROUP_CONTROL_BWD~ | H | H | -| UNDEFINED(3) | - | ~k~~GROUP_CONTROL_FWD~ | ~k~~GROUP_CONTROL_FWD~ | G | G | -| KEY_UP | -128 | ~k~~GO_FORWARD~ | ~k~~VEHICLE_STEERUP~ | UP | UP | -| KEY_DOWN | 128 | ~k~~GO_BACK~ | ~k~~VEHICLE_STEERDOWN~ | DOWN | DOWN | -| KEY_LEFT | -128 | ~k~~GO_LEFT~ | ~k~~VEHICLE_STEERLEFT~ | LEFT | LEFT | -| KEY_RIGHT | 128 | ~k~~GO_RIGHT~ | ~k~~VEHICLE_STEERRIGHT~ | RIGHT | RIGHT | +| کلان‌دستور (ماکرو) | مقدار | کد جایگذاری (روی زمین) (7) | کد جایگذاری (در ماشین) (7) | کلید پیشفرض (روی زمین) | کلید پیشفرض (در ماشین) | +| ------------------------ | --------- | -------------------------- | ----------------------------- | ------------------------------------------------- | ---------------------- | +| KEY_ACTION | 1 | \~k~\~PED_ANSWER_PHONE~ | \~k~\~VEHICLE_FIREWEAPON_ALT~ | TAB | ALT GR / LCTRL / NUM0 | +| KEY_CROUCH | 2 | \~k~\~PED_DUCK~ | \~k~\~VEHICLE_HORN~ | C | H / CAPSLOCK | +| KEY_FIRE | 4 | \~k~\~PED_FIREWEAPON~ | \~k~\~VEHICLE_FIREWEAPON~ | LCTRL / LMB (دکمه چپ ماوس) | LALT | +| KEY_SPRINT | 8 | \~k~\~PED_SPRINT~ | \~k~\~VEHICLE_ACCELERATE~ | SPACE | W | +| KEY_SECONDARY_ATTACK | 16 | \~k~\~VEHICLE_ENTER_EXIT~ | \~k~\~VEHICLE_ENTER_EXIT~ | ENTER | ENTER | +| KEY_JUMP | 32 | \~k~\~PED_JUMPING~ | \~k~\~VEHICLE_BRAKE~ | LSHIFT | S | +| KEY_LOOK_RIGHT | 64 | - | \~k~\~VEHICLE_LOOKRIGHT~ | - | E | +| KEY_HANDBRAKE/KEY_AIM(1) | 128 | \~k~\~PED_LOCK_TARGET~ | \~k~\~VEHICLE_HANDBRAKE~ | RMB (دکمه راست ماوس) | SPACE | +| KEY_LOOK_LEFT | 256 | - | \~k~\~VEHICLE_LOOKLEFT~ | - | Q | +| KEY_LOOK_BEHIND | 512 | \~k~\~PED_LOOKBEHIND~ | \~k~\~VEHICLE_LOOKBEHIND~ | NUM1 / MMB (دکمه وسط ماوس - فشردن دکمه چرخش ماوس) | 2 | +| KEY_SUBMISSION | 512 | - | \~k~\~TOGGLE_SUBMISSIONS~ | NUM1 / MMB (دکمه وسط ماوس - فشردن دکمه چرخش ماوس) | 2 / NUMPAD + | +| KEY_WALK | 1024 | \~k~\~SNEAK_ABOUT~ | - | LALT | - | +| KEY_ANALOG_UP | 2048 | - | \~k~\~VEHICLE_TURRETUP~ | NUM8(6) | NUM8 | +| KEY_ANALOG_DOWN | 4096 | - | \~k~\~VEHICLE_TURRETDOWN~ | NUM2(6) | NUM2 | +| KEY_ANALOG_LEFT | 8192 | \~k~\~VEHICLE_LOOKLEFT~ | \~k~\~VEHICLE_TURRETLEFT~ | NUM4 | NUM4 | +| KEY_ANALOG_RIGHT | 16384 | \~k~\~VEHICLE_LOOKRIGHT~ | \~k~\~VEHICLE_TURRETRIGHT~ | NUM6 | NUM6 | +| KEY_YES(2) | 65536 | \~k~\~CONVERSATION_YES~ | \~k~\~CONVERSATION_YES~ | Y | Y | +| KEY_NO(2) | 131072 | \~k~\~CONVERSATION_NO~ | \~k~\~CONVERSATION_NO~ | N | N | +| KEY_CTRL_BACK(2) | 262144(4) | \~k~\~GROUP_CONTROL_BWD~ | \~k~\~GROUP_CONTROL_BWD~ | H | H | +| UNDEFINED(3) | - | \~k~\~GROUP_CONTROL_FWD~ | \~k~\~GROUP_CONTROL_FWD~ | G | G | +| KEY_UP | -128 | \~k~\~GO_FORWARD~ | \~k~\~VEHICLE_STEERUP~ | UP | UP | +| KEY_DOWN | 128 | \~k~\~GO_BACK~ | \~k~\~VEHICLE_STEERDOWN~ | DOWN | DOWN | +| KEY_LEFT | -128 | \~k~\~GO_LEFT~ | \~k~\~VEHICLE_STEERLEFT~ | LEFT | LEFT | +| KEY_RIGHT | 128 | \~k~\~GO_RIGHT~ | \~k~\~VEHICLE_STEERRIGHT~ | RIGHT | RIGHT | **(1)** این دکمه در include های سمپ تعریف نشده. شما باید diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 3af65a4b9c5..8b2f4c7d5c0 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Lagi itong na cacall una sa mga filterscript kaya kapag nag return ng 1 binobloc ## Mga Halimbawa +**DIALOG_STYLE_MSGBOX** + ```c // Dito ilalagay ang ID ng isang dialog #define DIALOG_RULES 1 @@ -47,7 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Kailangan mag return 0 dito! Kamuka lang ng sa OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** +```c // Panagalawang halimbawa #define DIALOG_LOGIN 2 @@ -81,7 +87,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Kailangan mag return 0 dito! Kamuka lang ng sa OnPlayerCommandText. } +``` +**DIALOG_STYLE_LIST** + +```c // Pangatlong halimbawa #define DIALOG_WEAPONS 3 @@ -107,12 +117,16 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Kailangan mag return 0 dito! Kamuka lang ng sa OnPlayerCommandText. } +``` +**DIALOG_STYLE_TABLIST_HEADERS** + +```c // Pangatlong halimbawa pero ibang paraan at ibang mga baril #define DIALOG_WEAPONS 3 // In some command -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 6cbf3195dd9..2c617c78748 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index ed7c0d1c8d8..68dd6964b11 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Notes :::note diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 5dc39ea912b..246e1434301 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Notes :::note diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index d3cf194f2f3..8da5b3c2c9c 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // Upang magpakita ng mensahe (hal. dahilan) para sa player bago isara ang koneksyon // kailangan mong gumamit ng timer para gumawa ng pagkaantala. Ang pagkaantala na ito ay kailangan lang ng ilang millisecond ang haba, // ngunit ang halimbawang ito ay gumagamit ng isang buong segundo para lamang maging ligtas. diff --git a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 1eb60404e8a..eb0908a5ea3 100644 --- a/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/fil/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +```c /*Upang magpakita ng mensahe (hal. dahilan) para sa player bago isara ang koneksyon kailangan mong gumamit ng timer para gumawa ng pagkaantala. Ang pagkaantala na ito ay kailangan lang ng ilang millisecond ang haba, ngunit ang halimbawang ito ay gumagamit ng isang buong segundo para lamang maging ligtas.*/ diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md index 4573471deb0..453d532a396 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md @@ -37,3 +37,9 @@ public OnActorStreamIn(actorid, forplayerid) ## Fonctions connexes + +- [OnPlayerStreamIn](OnPlayerStreamIn): Quand un joueur est chargé (devient visible) pour un autre joueur. +- [OnPlayerStreamOut](OnPlayerStreamOut): Quand un joueur est dé-chargé (devient invisible) pour un autre joueur. +- [OnActorStreamOut](OnActorStreamOut): Quand un actor est déchargé (n'est plus visible) pour un joueur. +- [OnVehicleStreamIn](OnVehicleStreamIn): Quand un véhicule est chargé (devient visible) pour un joueur. +- [OnVehicleStreamOut](OnVehicleStreamOut): Quand un véhicule est dé-chargé (devient invisible) pour un joueur. diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md index 725de563e74..4db429adedc 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md @@ -37,3 +37,9 @@ public OnActorStreamOut(actorid, forplayerid) ## Fonctions connexes + +- [OnPlayerStreamIn](OnPlayerStreamIn): Quand un joueur est chargé (devient visible) pour un autre joueur. +- [OnPlayerStreamOut](OnPlayerStreamOut): Quand un joueur est dé-chargé (devient invisible) pour un autre joueur. +- [OnActorStreamIn](OnActorStreamIn): Quand un actor est chargé (devient visible) pour un joueur. +- [OnVehicleStreamIn](OnVehicleStreamIn): Quand un véhicule est chargé (devient visible) pour un joueur. +- [OnVehicleStreamOut](OnVehicleStreamOut): Quand un véhicule est dé-chargé (devient invisible) pour un joueur. diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md index 21553e167ab..7c126b26359 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md @@ -9,6 +9,10 @@ tags: [gamemode, éteint, exit, ended] Cette callback est appelée quand le gamemode s'éteint. +## Valeur de retour + +Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. + ## Exemple ```c diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md index beb85bbd176..e2ae0916a97 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md @@ -9,6 +9,10 @@ tags: [gamemode, démarré, loaded, started, chargé] Cette callback est appelée quand le gamemode démarre. +## Valeur de retour + +Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. + ## Exemple ```c diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md index 03f7edc213c..07eaf5db4d5 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md @@ -16,6 +16,8 @@ Cette callback est appelée quand un joueur tape une commande. Les commandes dé ## Valeur de retour +Retournez 0 si aucune commande n'a été exécutée. Sinon, retournez 1. + La callback est toujours appelée en premier dans les filterscripts, donc return 1, faute de quoi les autres scripts ne pourront pas communiquer avec cette callback. ## Exemple diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index c666b867ec8..d0c94f60ac1 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -45,20 +45,16 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Les morts à raison d'une source de feu seront caractérisées par l'ID 37 (lance-flammes) ; -La raison pour les explosions avec une arme (RPG, grenade, ...) seront caractérisées par l'ID. - -Il faut toujours vérifier que le `killerid` est valide avant d'utiliser SendDeathMessage. `INVALID_PLAYER_ID` est un `playerid` valide. - -`playerid` est le seul à pouvoir appeler cette callback _(bon à savoir pour un anti fake death par exemple)_. +- Les morts à raison d'une source de feu seront caractérisées par l'ID 37 (lance-flammes) ; +- La raison pour les explosions avec une arme (RPG, grenade, ...) sera caractérisée par l'ID 51. +- Vous n'avez pas besoin de vérifier si `killerid` vaut `INVALID_PLAYER_ID` avant d'utiliser SendDeathMessage. `INVALID_PLAYER_ID` est un ID de tueur valide et s'affichera correctement. +- `playerid` est le seul à pouvoir appeler cette callback _(bon à savoir pour un anti fake death par exemple)_. ::: :::warning -Vous DEVEZ vérifier que `killerid` est valide (pas INVALID*PLAYER_ID) avant de l'utiliser dans un array *(n'importe où en réalité)\_, sinon le script OnPlayerDeath est susceptible de crash. - -C'est parce que INVALID*PLAYER_ID est défini comme ayant la valeur '65535' que si un array a seulement MAX_PLAYERS comme élément le script OnPlayerDeath va crash *(vous tentez d'indexer au-delà de la limite MAX*PLAYERS)*. +Vous DEVEZ vérifier que `killerid` est valide (pas `INVALID_PLAYER_ID`) avant de l'utiliser dans un array _(n'importe où en réalité)_, sinon le script OnPlayerDeath est susceptible de crash. C'est parce que `INVALID_PLAYER_ID` est défini comme ayant la valeur '65535' que si un array a seulement `MAX_PLAYERS` comme élément le script OnPlayerDeath va crash _(vous tentez d'indexer au-delà de la limite `MAX_PLAYERS`)_. ::: diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md index 1bcfc36e2a2..8075daf63a2 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md @@ -27,6 +27,8 @@ Elle est toujours appelée en premier dans le gamemode donc retourner **0** dans ## Exemples +**Exemple - Débogage** + ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { @@ -50,6 +52,8 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod } ``` +**Exemple - Lors d'un headshot au sniper le joueur meurt instantanément.** + ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 76ae4ba8019..ed464080a90 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -82,9 +82,7 @@ public OnPlayerUpdate(playerid) :::warning -Cette callback est appelée environ 30 fois par secondes, par joueur; à utiliser seulement quand vous savez exactement pourquoi. - -La fréquence à laquelle est appelée cette callback varie en fonction des joueurs, dépendant de ce que fait le joueur. La fréquence d'appel sera plus élevé quand le joueur conduira, tirera alors qu'elle sera plus basse quand le joueur sera statique. +Cette callback est appelée environ 30 fois par secondes, par joueur; à utiliser seulement quand vous savez exactement pourquoi. La fréquence à laquelle est appelée cette callback varie en fonction des joueurs, dépendant de ce que fait le joueur. La fréquence d'appel sera plus élevé quand le joueur conduira, tirera alors qu'elle sera plus basse quand le joueur sera statique. ::: diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 4c2d47cfe1d..3ecce0c619e 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Remarques :::note diff --git a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index cf1718a5e04..9a3319a7b21 100644 --- a/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/fr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -34,10 +34,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Remarques :::note diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 9bca76313ea..12d273e9624 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Ini akan selalu terpanggil pertama di filterscripts jadi mengembalikan nilai 1 a ## Contoh +**DIALOG_STYLE_MSGBOX** + ```c // Define dialog ID agar nantinya kita bisa mengelola responses #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Anda WAJIB return 0 disini! sama seperti OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // Di sebuah perintah @@ -79,6 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Anda WAJIB return 0 disini! sama seperti OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // In some command @@ -103,10 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Anda WAJIB return 0 disini! sama seperti OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // In some command -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 3fd2e6f9e88..d366b34c474 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Alasan akan mengembalikan nilai 37 (flame thrower) dari jenis api apapun (seperti molotov, 18) Alasan akan mengembalikan nilai 51 dari senjata apapun yang membuat ledakan (seperti RPG, grenade) Anda tidak perlu mengecek apakah killerid valid sebelum menggunakannya di SendDeathMessage. INVALID_PLAYER_ID adalah parameter killer ID yang valid didalam fungsi itu. playerid hanyalah satu-satunya yang dapat memanggil callback. (baik untuk anti fake death) +- Alasan akan mengembalikan nilai 37 (flame thrower) dari jenis api apapun (seperti molotov, 18) +- Alasan akan mengembalikan nilai 51 dari senjata apapun yang membuat ledakan (seperti RPG, grenade) +- Anda tidak perlu mengecek apakah killerid valid sebelum menggunakannya di SendDeathMessage. INVALID_PLAYER_ID adalah parameter killer ID yang valid didalam fungsi itu. +- playerid hanyalah satu-satunya yang dapat memanggil callback. (baik untuk anti fake death) ::: diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 45afc1f1496..979e3807bcf 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 5694196f4ef..04cb25d5d11 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Catatan :::note diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 7e7be593b5d..7d8e34556e0 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Notes :::note diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index 707da381920..8c638e24e20 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // Untuk memunculkan pesan (contoh: alasan) untuk player sebelum koneksi terputus // Anda harus menggunakan timer untuk membuat sebuah delay. Delay ini hanya membutuhkan beberapa milisekon saja, // akan tetapi contoh ini menggunakan satu detik penuh hanya untuk berjaga-jaga. diff --git a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 1ea3b52fc58..21ca6ed7e90 100644 --- a/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/id/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +```c /*Untuk memunculkan pesan (contoh: alasan) untuk player sebelum koneksi terputus Anda harus menggunakan timer untuk membuat sebuah delay. Delay ini hanya membutuhkan beberapa milisekon saja, akan tetapi contoh ini menggunakan satu detik penuh hanya untuk berjaga-jaga.*/ diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 4c6fe46b199..507539a41ca 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -126,13 +126,13 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -**DIALOG_STYLE_TABLIST** +**DIALOG_STYLE_TABLIST_HEADERS** ```c #define DIALOG_WEAPONS 3 // In some command -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index 3d9068dd43d..58ba573c2db 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -64,8 +64,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- Het klikbare gebied wordt gedefinieerd door [TextDrawTextSize](../functions/TextDrawTextSize). -- De `x` en `y` parameters die aan die functie worden doorgegeven mogen niet nul of negatief zijn. +- Het klikbare gebied wordt gedefinieerd door [TextDrawTextSize](../functions/TextDrawTextSize). De `x` en `y` parameters die aan die functie worden doorgegeven mogen niet nul of negatief zijn. - Gebruik [CancelSelectTextDraw](../functions/CancelSelectTextDraw) niet onvoorwaardelijk binnen deze callback. Dit resulteert in een **oneindige lus**. ::: diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 152f08b6cae..b201bccee97 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -De reason zal 37 (flame thrower) teruggeven van elke vuurbron (bijv. molotov, 18) De reason zal 51 teruggeven van elk wapen dat een explosie veroorzaakt (bijv. RPG, granaat) Je hoeft niet te controleren of killerid geldig is voordat je het gebruikt in [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID is een geldige killerid parameter in die functie. playerid is de enige die de callback kan aanroepen. (goed om te weten voor anti fake death) +- De reason zal 37 (flame thrower) teruggeven van elke vuurbron (bijv. molotov, 18) +- De reason zal 51 teruggeven van elk wapen dat een explosie veroorzaakt (bijv. RPG, granaat) +- Je hoeft niet te controleren of killerid geldig is voordat je het gebruikt in [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID is een geldige killerid parameter in die functie. +- playerid is de enige die de callback kan aanroepen. (goed om te weten voor anti fake death) ::: diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md index eab51cc8274..71d73983881 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -59,9 +59,7 @@ public OnPlayerDisconnect(playerid, reason) :::note -Sommige functies werken mogelijk niet correct wanneer ze in deze callback worden gebruikt omdat de speler al is verbroken wanneer de callback wordt aangeroepen. Dit betekent dat je geen ondubbelzinnige informatie kunt krijgen van functies zoals [GetPlayerIp](../functions/GetPlayerIp) en [GetPlayerPos](../functions/GetPlayerPos). - -Dit probleem is opgelost in de open.mp server. +Sommige functies werken mogelijk niet correct wanneer ze in deze callback worden gebruikt omdat de speler al is verbroken wanneer de callback wordt aangeroepen. Dit betekent dat je geen ondubbelzinnige informatie kunt krijgen van functies zoals [GetPlayerIp](../functions/GetPlayerIp) en [GetPlayerPos](../functions/GetPlayerPos). Dit probleem is opgelost in de open.mp server. ::: diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 4a58a63bb0e..b1521874d91 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: You typed '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md index 2163ccd4c62..82f00f04810 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -34,8 +34,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- Deze callback wordt ook aangeroepen wanneer een voertuig water ingaat, maar het voertuig kan worden gered van vernietiging door teleportatie of eruit rijden (als het slechts gedeeltelijk ondergedompeld is). -- De callback wordt niet een tweede keer aangeroepen, en het voertuig kan verdwijnen wanneer de bestuurder uitstapt, of na korte tijd. +Deze callback wordt ook aangeroepen wanneer een voertuig water ingaat, maar het voertuig kan worden gered van vernietiging door teleportatie of eruit rijden (als het slechts gedeeltelijk ondergedompeld is). De callback wordt niet een tweede keer aangeroepen, en het voertuig kan verdwijnen wanneer de bestuurder uitstapt, of na korte tijd. ::: diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/functions/format.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/functions/format.md index 041e09033cb..a337b758432 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/functions/format.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/functions/format.md @@ -43,12 +43,16 @@ format(result, sizeof(result), "The number is %i.", number); new str[] = "simple message"; format(result, sizeof(result), "This is a %s containing the number %i.", str, number); +``` +```c new t[32]; new h, m, s; gettime(h, m, s); format(t, sizeof(t), "The time is %02d:%02d:%02d.", h, m, s); +``` +```c new pct[32]; format(pct, sizeof(pct), "43%s of my shirts are black.", "%%"); ``` diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md index 1ede72526de..1dadb88a6ab 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md @@ -34,7 +34,7 @@ Vergelijkbaar met INPUT. `listitem = -1`; `inputtext` bevat de invoer (zonder kl ## Stijl 4: `DIALOG_STYLE_TABLIST` -`\t` maakt een nieuwe kolom; `\n` een nieuw item. Kleur‑embedding reset na `\n` en `\t`. Eerste rij is header. `listitem` is index; `inputtext` is tekst van de eerste kolom. +`\t` maakt een nieuwe kolom; `\n` een nieuw item. Kleur‑embedding reset na `\n` en `\t`. `listitem` is index; `inputtext` is tekst van de eerste kolom. ## Stijl 5: `DIALOG_STYLE_TABLIST_HEADERS` diff --git a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/keys.md b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/keys.md index f691da62a6c..ac2c63c113b 100644 --- a/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/keys.md +++ b/frontend/i18n/nl/docusaurus-plugin-content-docs/current/scripting/resources/keys.md @@ -15,30 +15,30 @@ SA-MP gebruikt bitmasking om te bepalen welke toetsen ingedrukt zijn. Zie: `http | Macro | Waarde | Embedding Code (te voet) (6) | Embedding Code (in voertuig) (6) | Standaardtoets (te voet) | Standaardtoets (in voertuig) | | ----------------------------------- | -------------------- | --------------------------------------- | ------------------------------------------- | ------------------------ | ---------------------------- | -| KEY_ACTION | 1 | ~k~~PED_ANSWER_PHONE~ | ~k~~VEHICLE_FIREWEAPON_ALT~ | TAB | ALT GR / LCTRL / NUM0 | -| KEY_CROUCH | 2 | ~k~~PED_DUCK~ | ~k~~VEHICLE_HORN~ | C | H / CAPSLOCK | -| KEY_FIRE | 4 | ~k~~PED_FIREWEAPON~ | ~k~~VEHICLE_FIREWEAPON~ | LCTRL / LMB | LALT | -| KEY_SPRINT | 8 | ~k~~PED_SPRINT~ | ~k~~VEHICLE_ACCELERATE~ | SPACE | W | -| KEY_SECONDARY_ATTACK | 16 | ~k~~VEHICLE_ENTER_EXIT~ | ~k~~VEHICLE_ENTER_EXIT~ | ENTER | ENTER | -| KEY_JUMP | 32 | ~k~~PED_JUMPING~ | ~k~~VEHICLE_BRAKE~ | LSHIFT | S | -| KEY_LOOK_RIGHT | 64 | - | ~k~~VEHICLE_LOOKRIGHT~ | - | E | -| KEY_HANDBRAKE/KEY_AIM(1) | 128 | ~k~~PED_LOCK_TARGET~ | ~k~~VEHICLE_HANDBRAKE~ | RMB | SPACE | -| KEY_LOOK_LEFT | 256 | - | ~k~~VEHICLE_LOOKLEFT~ | - | Q | -| KEY_LOOK_BEHIND | 512 | ~k~~PED_LOOKBEHIND~ | ~k~~VEHICLE_LOOKBEHIND~ | NUM1 / MMB | 2 | -| KEY_SUBMISSION | 512 | - | ~k~~TOGGLE_SUBMISSIONS~ | NUM1 / MMB | 2 / NUMPAD + | -| KEY_WALK | 1024 | ~k~~SNEAK_ABOUT~ | - | LALT | - | -| KEY_ANALOG_UP | 2048 | - | ~k~~VEHICLE_TURRETUP~ | NUM8(5) | NUM8 | -| KEY_ANALOG_DOWN | 4096 | - | ~k~~VEHICLE_TURRETDOWN~ | NUM2(5) | NUM2 | -| KEY_ANALOG_LEFT | 8192 | ~k~~VEHICLE_LOOKLEFT~ | ~k~~VEHICLE_TURRETLEFT~ | NUM4 | NUM4 | -| KEY_ANALOG_RIGHT | 16384 | ~k~~VEHICLE_LOOKRIGHT~ | ~k~~VEHICLE_TURRETRIGHT~ | NUM6 | NUM6 | -| KEY_YES(2) | 65536 | ~k~~CONVERSATION_YES~ | ~k~~CONVERSATION_YES~ | Y | Y | -| KEY_NO(2) | 131072 | ~k~~CONVERSATION_NO~ | ~k~~CONVERSATION_NO~ | N | N | -| KEY_CTRL_BACK(2) | 262144(4) | ~k~~GROUP_CONTROL_BWD~ | ~k~~GROUP_CONTROL_BWD~ | H | H | -| UNDEFINED(3) | - | ~k~~GROUP_CONTROL_FWD~ | ~k~~GROUP_CONTROL_FWD~ | G | G | -| KEY_UP | -128 | ~k~~GO_FORWARD~ | ~k~~VEHICLE_STEERUP~ | UP | UP | -| KEY_DOWN | 128 | ~k~~GO_BACK~ | ~k~~VEHICLE_STEERDOWN~ | DOWN | DOWN | -| KEY_LEFT | -128 | ~k~~GO_LEFT~ | ~k~~VEHICLE_STEERLEFT~ | LEFT | LEFT | -| KEY_RIGHT | 128 | ~k~~GO_RIGHT~ | ~k~~VEHICLE_STEERRIGHT~ | RIGHT | RIGHT | +| KEY_ACTION | 1 | \~k~\~PED_ANSWER_PHONE~ | \~k~\~VEHICLE_FIREWEAPON_ALT~ | TAB | ALT GR / LCTRL / NUM0 | +| KEY_CROUCH | 2 | \~k~\~PED_DUCK~ | \~k~\~VEHICLE_HORN~ | C | H / CAPSLOCK | +| KEY_FIRE | 4 | \~k~\~PED_FIREWEAPON~ | \~k~\~VEHICLE_FIREWEAPON~ | LCTRL / LMB | LALT | +| KEY_SPRINT | 8 | \~k~\~PED_SPRINT~ | \~k~\~VEHICLE_ACCELERATE~ | SPACE | W | +| KEY_SECONDARY_ATTACK | 16 | \~k~\~VEHICLE_ENTER_EXIT~ | \~k~\~VEHICLE_ENTER_EXIT~ | ENTER | ENTER | +| KEY_JUMP | 32 | \~k~\~PED_JUMPING~ | \~k~\~VEHICLE_BRAKE~ | LSHIFT | S | +| KEY_LOOK_RIGHT | 64 | - | \~k~\~VEHICLE_LOOKRIGHT~ | - | E | +| KEY_HANDBRAKE/KEY_AIM(1) | 128 | \~k~\~PED_LOCK_TARGET~ | \~k~\~VEHICLE_HANDBRAKE~ | RMB | SPACE | +| KEY_LOOK_LEFT | 256 | - | \~k~\~VEHICLE_LOOKLEFT~ | - | Q | +| KEY_LOOK_BEHIND | 512 | \~k~\~PED_LOOKBEHIND~ | \~k~\~VEHICLE_LOOKBEHIND~ | NUM1 / MMB | 2 | +| KEY_SUBMISSION | 512 | - | \~k~\~TOGGLE_SUBMISSIONS~ | NUM1 / MMB | 2 / NUMPAD + | +| KEY_WALK | 1024 | \~k~\~SNEAK_ABOUT~ | - | LALT | - | +| KEY_ANALOG_UP | 2048 | - | \~k~\~VEHICLE_TURRETUP~ | NUM8(5) | NUM8 | +| KEY_ANALOG_DOWN | 4096 | - | \~k~\~VEHICLE_TURRETDOWN~ | NUM2(5) | NUM2 | +| KEY_ANALOG_LEFT | 8192 | \~k~\~VEHICLE_LOOKLEFT~ | \~k~\~VEHICLE_TURRETLEFT~ | NUM4 | NUM4 | +| KEY_ANALOG_RIGHT | 16384 | \~k~\~VEHICLE_LOOKRIGHT~ | \~k~\~VEHICLE_TURRETRIGHT~ | NUM6 | NUM6 | +| KEY_YES(2) | 65536 | \~k~\~CONVERSATION_YES~ | \~k~\~CONVERSATION_YES~ | Y | Y | +| KEY_NO(2) | 131072 | \~k~\~CONVERSATION_NO~ | \~k~\~CONVERSATION_NO~ | N | N | +| KEY_CTRL_BACK(2) | 262144(4) | \~k~\~GROUP_CONTROL_BWD~ | \~k~\~GROUP_CONTROL_BWD~ | H | H | +| UNDEFINED(3) | - | \~k~\~GROUP_CONTROL_FWD~ | \~k~\~GROUP_CONTROL_FWD~ | G | G | +| KEY_UP | -128 | \~k~\~GO_FORWARD~ | \~k~\~VEHICLE_STEERUP~ | UP | UP | +| KEY_DOWN | 128 | \~k~\~GO_BACK~ | \~k~\~VEHICLE_STEERDOWN~ | DOWN | DOWN | +| KEY_LEFT | -128 | \~k~\~GO_LEFT~ | \~k~\~VEHICLE_STEERLEFT~ | LEFT | LEFT | +| KEY_RIGHT | 128 | \~k~\~GO_RIGHT~ | \~k~\~VEHICLE_STEERRIGHT~ | RIGHT | RIGHT | --- diff --git a/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index bb5003796b8..d0ec27e7812 100644 --- a/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Uwagi :::note diff --git a/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 99ef5453337..bccfb5a891d 100644 --- a/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/pl/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Uwagi :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index e3916c37c80..4b16e86a6cf 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Esta callback é chamada quando um jogador responde a um dialog mostrado usando ## Exemplos +**DIALOG_STYLE_MSGBOX** + ```c // Define the dialog ID so we can handle responses #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // DEVE-SE retornar 0 aqui! Como em OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // Em algum comando @@ -79,6 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // DEVE-SE retornar 0 aqui! Como em OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // Em um comando @@ -103,10 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // DEVE-SE retornar 0 aqui! Como em OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // Em um comando -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md index a367bf3777e..ed4362f4bc1 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeExit.md @@ -9,6 +9,10 @@ tags: [] Esta callback é chamada quando uma gamemode finaliza, também através do 'gmx', do servidor ser desligado ou GameModeExit. +## Retornos + +Esta callback não lida com retornos. + ## Exemplos ```c diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md index 1d44e1249c6..7973cafb1d7 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnGameModeInit.md @@ -9,6 +9,10 @@ tags: [] Esta callback é acionada quando uma gamemode inicia. +## Retornos + +Esta callback não lida com retornos. + ## Exemplos ```c diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index 0c2ac1de79c..1f5630e8f12 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -16,6 +16,8 @@ Esta callback é chamada quando um jogador clica em uma textdraw ou cancela a se ## Retorno +Retornando 1/true nesta callback irá impedi-la de ser chamada em outros scripts. Isso deve ser usado para sinalizar que a TextDraw em que foi clicada foi 'encontrada' e nenhum processamento adicional é necessário. Você deve retornar 0/false se a TextDraw em que clicou não foi encontrada, assim como em [OnPlayerCommandText](OnPlayerCommandText). + 1 - Irá previnir que outro filterscript receba esta callback. 0 - Indica que esta callback será passada para o próximo filterscript. diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md index f5e5d4747fa..3fb04e9d0f5 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerCommandText.md @@ -16,6 +16,8 @@ Esta callback é chamada quando o jogador entra com um comando na janela de chat ## Retorno +Retorna 1 se o comando foi processado, caso contrário 0. + 1 - Irá previnir que outro filterscript receba esta callback. 0 - Indica que esta callback será passada para o próximo filterscript. diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 025f2fcf08f..328e8be83a8 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -O motivo da morte retornará 37 (Lança Chamas) para qualquer fonte que utilize fogo (EX: Molotov). O motivo da morte retornará 51 para qualquer fonte que utilize explosões (EX: RPG, granada). Você não precisa verificar se o killerid é valido antes de usa-lo no SendDeathMessage. INVALID_PLAYER_ID é um parâmetro valido nesta função. playerid é o único que pode chamar esta callback. +- O motivo da morte retornará 37 (Lança Chamas) para qualquer fonte que utilize fogo (EX: Molotov). +- O motivo da morte retornará 51 para qualquer fonte que utilize explosões (EX: RPG, granada). +- Você não precisa verificar se o killerid é valido antes de usa-lo no SendDeathMessage. INVALID_PLAYER_ID é um parâmetro valido nesta função. +- playerid é o único que pode chamar esta callback. ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md index 87a9bf6621f..6ec38910312 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerRequestClass.md @@ -16,6 +16,8 @@ Chamado quando um jogador muda de classe na seleção de classe (e quando a sele ## Retorno +Retornando 0 nesta callback irá impedir que o player spawne. O player pode ser forçado a spawnar quando [SpawnPlayer](../functions/SpawnPlayer) for usado. + Sempre é chamada primeiro em Filterscripts. ## Exemplos diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md index b90a3eb30bf..1df4bf036ca 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerText.md @@ -16,6 +16,8 @@ Executada quando o Player envia uma mensagem no chat. ## Retornos +Retornando 0 nesta callback, a mensagem não será enviada. + Sempre executada primeiro nos filterscripts, ao retornar 0 bloqueia outros scripts de visualizarem a mesma. ## Exemplos diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index e4b1cb71cbf..efc2b01432f 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index e3730ecb6a3..030822b6d44 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: Você digitou '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index b767af95c4d..269c44cd65d 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -39,11 +39,6 @@ public OnGameModeInit() } ``` -```c - AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); - AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Notas :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 4504390f77f..eac0de6fb7a 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Notas :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index a37cc46118b..05926a37abe 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // Para exibir uma mensagem (por exemplo, motivo) para o jogador antes que a conexão seja fechada // você tem que usar um cronômetro (timer) para criar um atraso. Esse atraso precisa ser de apenas alguns milissegundos, // mas este exemplo usa um segundo inteiro apenas por garantia. diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 8f8606c60f3..df3135420c3 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,11 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +O seguinte exemplo de código mostra uma forma de exibir uma mensagem para o jogador, antes de serem banidos: + +```c // Para exibir uma mensagem (por exemplo, motivo) para o jogador antes que a conexão seja fechada // você tem que usar um cronômetro (timer) para criar um atraso. Esse atraso precisa ser de apenas alguns milissegundos, // mas este exemplo usa um segundo inteiro apenas por garantia. diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md index 62cd8d1eb90..6e21751c5e9 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md @@ -36,9 +36,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::warning -Esta função chama [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) com INVALID_TEXT_DRAW (65535). - -Usar esta função dentro de OnPlayerClickTextDraw sem capturar este caso fará com que os clientes entrem em um loop infinito. +Esta função chama [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) com INVALID_TEXT_DRAW (65535). Usar esta função dentro de OnPlayerClickTextDraw sem capturar este caso fará com que os clientes entrem em um loop infinito. ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md index 9aa34399c1b..7347f75af84 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreateObject.md @@ -20,6 +20,10 @@ Cria um objeto em coordenadas especificadas no mundo do jogo. | Float:rZ | A rotação Z para criar o objeto. | | Float:DrawDistance | (Opcional) A distância de renderização do objeto no mapa. 0.0 fará com que os objetos sejam renderizados em suas distâncias padrão. Utilizável desde 0.3b. Limitado a 300 antes de 0,3x. | +## Retornos + +O ID do objeto que foi criado. + ## Exemplos ```c diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md index 4e4254864be..21fe496bb2a 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -49,7 +49,7 @@ Textdraws de jogador são automaticamente destruídos quando um jogador se desco :::warning -Códigos de mapeamento de teclas do teclado (como ~k~~VEHICLE_ENTER_EXIT~) não funcionam além do 255º caractere. +Códigos de mapeamento de teclas do teclado (como `~k~~VEHICLE_ENTER_EXIT~`) não funcionam além do 255º caractere. ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md index b7612b0075f..ada0e5a3191 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -57,8 +57,7 @@ Causa crash se receber um ID de menu inválido. (Corrigido em open.mp) :::note - A linha é desativada para TODOS os jogadores -- Não existe função para desativar linha para um jogador específico -- Soluções alternativas incluem criar menus diferentes ou um menu por jogador +- Não existe função para desativar linha para um jogador específico. Soluções alternativas incluem criar menus diferentes ou um menu por jogador ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md index ee0e71735bb..4877dba6822 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/MoveObject.md @@ -5,21 +5,20 @@ description: "Mova um objeto para uma nova posição com uma velocidade definida tags: ["object"] --- - ## Descrição Mova um objeto para uma nova posição com uma velocidade definida. Jogadores/veículos irão ‘surfar’ no objeto enquanto ele se move. -| Nome | Descrição | -| --------------- | --------------------------------------------------------- | -| objectid | O ID do objeto a ser movido. | -| Float:targetX | A coordenada X para a qual mover o objeto. | -| Float:targetY | A coordenada Y para a qual mover o objeto. | -| Float:targetZ | A coordenada Z para a qual mover o objeto. | -| Float:speed | A velocidade na qual mover o objeto (unidades por segundo). | -| Float:rotationX | A rotação FINAL X (opcional). | -| Float:rotationY | A rotação FINAL Y (opcional). | -| Float:rotationZ | A rotação FINAL Z (opcional). | +| Nome | Descrição | +| --------------- | ----------------------------------------------------------- | +| objectid | O ID do objeto a ser movido. | +| Float:targetX | A coordenada X para a qual mover o objeto. | +| Float:targetY | A coordenada Y para a qual mover o objeto. | +| Float:targetZ | A coordenada Z para a qual mover o objeto. | +| Float:speed | A velocidade na qual mover o objeto (unidades por segundo). | +| Float:rotationX | A rotação FINAL X (opcional). | +| Float:rotationY | A rotação FINAL Y (opcional). | +| Float:rotationZ | A rotação FINAL Z (opcional). | ## Retornos @@ -51,6 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 0; } ``` + ## Notas :::warning diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md index 2d34ac13508..90931a562f8 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md @@ -5,15 +5,14 @@ description: "Verifica se um NPC ID é válido." tags: ["npc"] --- - ## Descrição Verifica se um NPC ID é válido e se o NPC existe. -| Nome | Descrição | -| ----- | -------------------- | +| Nome | Descrição | +| ----- | ------------------------ | | npcid | O NPC ID para verificar. | ## Retornos @@ -39,12 +38,12 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 0; } ``` + ## Notas :::tip -- Sempre verifique se um NPC é válido antes de realizar operações nele. -- Isso evita erros de execução e travamentos. +- Sempre verifique se um NPC é válido antes de realizar operações nele. Isso evita erros de execução e travamentos. - Use isso em loops ao iterar pelo potencial NPC IDs. ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md index ded66195ff7..e18ed2f190e 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -32,7 +32,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` +```c public OnPlayerConnect(playerid) { // Quando o jogador se conectar, todos os objetos do mapa serão removidos. diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md index d6272b11067..5a6c6ea61cd 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -5,14 +5,13 @@ description: "Define qual arma (que o jogador já possui) o jogador está segura tags: ["player"] --- - ## Descrição Define qual arma (que o jogador já possui) o jogador está segurando. -| Nome | Descrição | -| --------------- | ------------------------------------------------------------------------------------ | -| playerid | O ID do jogador para se armar com uma arma. | +| Nome | Descrição | +| --------------- | ------------------------------------------------------------------------------ | +| playerid | O ID do jogador para se armar com uma arma. | | WEAPON:weaponid | O ID da [arma](../resources/weaponids) com a qual o jogador deve estar armado. | ## Retornos @@ -29,7 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid, WEAPON_FIST); // desativa as armas return 1; } +``` +```c // Drive-by com SMG por [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { @@ -45,6 +46,7 @@ public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstat return 1; } ``` + ## Notas :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md index ecf7be5f231..fd4ca4f3619 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -5,15 +5,14 @@ description: "Defina a skin de um jogador." tags: ["player"] --- - ## Descrição Defina a skin de um jogador. A pele de um jogador é o modelo de seu personagem. -| Nome | Descrição | +| Nome | Descrição | | -------- | ----------------------------------------------------- | | playerid | O ID do jogador cujo skin será definido. | -| skinid | A [skin](../resources/skins) que o jogador deve usar. | +| skinid | A [skin](../resources/skins) que o jogador deve usar. | ## Retornos @@ -36,7 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) @@ -84,6 +85,7 @@ SetPlayerSkinFix(playerid, skinid) } } ``` + ## Notas :::warning diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md index 8e20a51f3c4..812f5a4dd89 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -5,21 +5,20 @@ description: "Define os parâmetros de um veículo para todos os jogadores." tags: ["vehicle"] --- - ## Descrição Define os parâmetros de um veículo para todos os jogadores. -| Nome | Descrição | -| --------- | --------------------------------------------------------------- | -| vehicleid | O ID do veículo para definir os parâmetros. | -| engine | Estado do motor. 0 - Desligado, 1 - Ligado. | -| lights | Estado leve. 0 - Desligado, 1 - Ligado. | -| alarm | Status do alarme do veículo. Se estiver ativado, o alarme será iniciado. 0 - Desligado, 1 - Ligado. | -| doors | Estado da fechadura da porta. 0 - Desbloqueado, 1 - Bloqueado. | -| bonnet | Status do capô (capô). 0 - Fechado, 1 - Aberto. | -| boot | Status de inicialização/tronco. 0 - Fechado, 1 - Aberto. | -| objective | Alterne a seta objetiva acima do veículo. 0 - Desligado, 1 - Ligado. | +| Nome | Descrição | +| --------- | --------------------------------------------------------------------------------------------------- | +| vehicleid | O ID do veículo para definir os parâmetros. | +| engine | Estado do motor. 0 - Desligado, 1 - Ligado. | +| lights | Estado leve. 0 - Desligado, 1 - Ligado. | +| alarm | Status do alarme do veículo. Se estiver ativado, o alarme será iniciado. 0 - Desligado, 1 - Ligado. | +| doors | Estado da fechadura da porta. 0 - Desbloqueado, 1 - Bloqueado. | +| bonnet | Status do capô (capô). 0 - Fechado, 1 - Aberto. | +| boot | Status de inicialização/tronco. 0 - Fechado, 1 - Aberto. | +| objective | Alterne a seta objetiva acima do veículo. 0 - Desligado, 1 - Ligado. | ## Retornos @@ -30,10 +29,6 @@ Define os parâmetros de um veículo para todos os jogadores. ## Exemplos ```c -// No topo do nosso script, declarando uma variável global -new - gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; - // Se estiver configurando um único parâmetro, obtenha os parâmetros atuais para que eles não sejam todos alterados new engine, lights, alarm, doors, bonnet, boot, objective; @@ -41,6 +36,12 @@ new // Em algum lugar onde você cria o veículo. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // Somente o parâmetro do motor foi alterado para VEHICLE_PARAMS_ON (1) +``` + +```c +// No topo do nosso script, declarando uma variável global +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; // A função SetVehicleParamsEx_Fixed(vehicleid, &bool:engine, &bool:lights, &bool:alarm, &bool:doors, &bool:bonnet, &bool:boot, &bool:objective) @@ -71,11 +72,12 @@ public DisableVehicleAlarm(vehicleid) gVehicleAlarmTimer[vehicleid] = 0; } ``` + ## Definições --`VEHICLE_PARAMS_UNSET` (-1) --`VEHICLE_PARAMS_OFF` (0) --`VEHICLE_PARAMS_ON` (1) +- `VEHICLE_PARAMS_UNSET` (-1) +- `VEHICLE_PARAMS_OFF` (0) +- `VEHICLE_PARAMS_ON` (1) ## Notas diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md index d7cb809f95b..f165fa558e9 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -5,16 +5,15 @@ description: "Defina os parâmetros de um veículo para um jogador." tags: ["player", "vehicle"] --- - ## Descrição Defina os parâmetros de um veículo para um jogador. -| Nome | Descrição | -| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | -| vehicle | O ID do veículo para definir os parâmetros. | -| playerid | O ID do jogador para o qual definir os parâmetros do veículo. | -| objective | VEHICLE_PARAMS_OFF para desativar o objetivo ou VEHICLE_PARAMS_ON para mostrá-lo. Esta é uma seta amarela oscilante acima do veículo. | +| Nome | Descrição | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| vehicle | O ID do veículo para definir os parâmetros. | +| playerid | O ID do jogador para o qual definir os parâmetros do veículo. | +| objective | VEHICLE_PARAMS_OFF para desativar o objetivo ou VEHICLE_PARAMS_ON para mostrá-lo. Esta é uma seta amarela oscilante acima do veículo. | | doorslocked | VEHICLE_PARAMS_OFF para destravar as portas ou VEHICLE_PARAMS_ON para travá-las. | ## Retornos @@ -37,7 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, VEHICLE_PARAMS_OFF); +``` +```c // Bloqueia o próprio carro de todos os jogadores, exceto o jogador que usou o comando. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -60,7 +61,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c // Mostrará marcadores de veículos para jogadores fazendo streaming para 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; @@ -83,7 +86,9 @@ public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` +```c // No topo new myMarkedCar; @@ -103,6 +108,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) return 1; } ``` + ## Notas :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md index 7de484391e1..463993fad83 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md @@ -145,7 +145,8 @@ else :::warning -Se você usar `io_read` e o arquivo não existir, ele retornará uma referência NULL. Usar referências inválidas em funções de arquivo irá travar seu servidor! +- Esta função não pode acessar arquivos fora da pasta 'scriptfiles'! +- Se você usar `io_read` e o arquivo não existir, ele retornará uma referência NULL. Usar referências inválidas em funções de arquivo irá travar seu servidor! ::: diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md index 759a9244ede..d256e105d1c 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/ftemp.md @@ -10,6 +10,10 @@ tags: ["file management"] Cria um arquivo no diretório “tmp”, “temp” ou raiz com nome aleatório para leitura e escrita. O arquivo é excluído após fclose() ser usado no arquivo. +## Retornos + +O identificador do arquivo temporário. 0 se falhar. + ## Exemplos ```c diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/random.md index 5705caafda8..2f62965e9c5 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/random.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -5,14 +5,13 @@ description: "Obtenha um número pseudo-aleatório." tags: ["core"] --- - ## Descrição Obtenha um número pseudo-aleatório. -| Nome | Descrição | -| ---- | -------------------------------------------------------------------------- | -| max | O intervalo de valores (de 0 a este valor menos um) que pode ser retornado. | +| Nome | Descrição | +| ---- | --------------------------------------------------------------------------- | +| max | O intervalo de valores (de 0 a este valor menos um) que pode ser retornado. | ## Retornos @@ -24,6 +23,9 @@ Um número aleatório variando de 0 a no máximo 1. new value = random(5); // 'value' pode ser 0, 1, 2, 3 ou 4 (5 valores possíveis) +``` + +```c new Float:RandomSpawn[][4] = { // Posições, (X, Y, Z e ângulo de face) @@ -45,6 +47,7 @@ public OnPlayerSpawn(playerid) return 1; } ``` + ## Notas :::note diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md index 767d9eb8c07..d0406d7161e 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -5,17 +5,16 @@ description: "Adicione uma nova propriedade ou altere uma propriedade existente. tags: ["core", "property"] --- - ## Descrição Adicione uma nova propriedade ou altere uma propriedade existente. -| Nome | Descrição | -| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | A máquina virtual a ser usada, você deve manter este zero. _(opcional=0)_ | -| name[] | Usado em combinação com valor ao armazenar números inteiros; não use isso se quiser armazenar uma string. | -| valor | O valor inteiro a ser armazenado ou o ID exclusivo da propriedade, se estiver armazenando uma string. Use a função hash para calculá-lo a partir de uma string. _(opcional=célulamin)_ | -| string[] | O valor da propriedade, como uma string. Não use isso se quiser armazenar um número inteiro. | +| Nome | Descrição | +| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id | A máquina virtual a ser usada, você deve manter este zero. _(opcional=0)_ | +| name[] | Usado em combinação com valor ao armazenar números inteiros; não use isso se quiser armazenar uma string. | +| valor | O valor inteiro a ser armazenado ou o ID exclusivo da propriedade, se estiver armazenando uma string. Use a função hash para calculá-lo a partir de uma string. _(opcional=célulamin)_ | +| string[] | O valor da propriedade, como uma string. Não use isso se quiser armazenar um número inteiro. | ## Retornos @@ -28,6 +27,9 @@ setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Value that was stored is: %d", value); +``` + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -36,10 +38,14 @@ strunpack(value, value, sizeof(value)); // precisamos descompactar a string prim print(value); //deveria imprimir:) +``` + +```c setproperty(.value = 123984334, .string = ":)"); // O resto é igual ao anterior. ``` + ## Notas :::tip diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md index afe38a1538e..8121859bff3 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/colorslist.md @@ -177,7 +177,7 @@ Game text colour tags can be used to form different colours easily. The below co [![Image:Blueandred.png](https://assets.open.mp/assets/images/colorList/Blueandred.png) -Now these colors are pretty dark. You can make them brighter by using **~h~** after the color code: +Now these colors are pretty dark. You can make them brighter by using **`~h~`** after the color code: ```c ~w~Hello this is ~b~~h~blue ~w~and this is ~r~~h~red diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/start.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/start.md index edd7292684a..af3ccd33882 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/start.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/scripting/resources/start.md @@ -500,7 +500,7 @@ new myTag: variable = 0, AppleTag: another = 1; ``` -Isso é perfeitamente válido, entretanto, ao adicionar essas duas variáveis ​​_diretamente_, você deve usar '\_:' para 'desetiquetá-las', caso contrário o compilador produzirá um aviso de 'tag incompatível'. +Isso é perfeitamente válido, entretanto, ao adicionar essas duas variáveis _diretamente_, você deve usar '\_:' para 'desetiquetá-las', caso contrário o compilador produzirá um aviso de 'tag incompatível'. --- diff --git a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md index 7fcd7f5f1f3..ea8b357c6bf 100644 --- a/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md +++ b/frontend/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md @@ -45,6 +45,7 @@ Você também pode predefinir valores constantes para poder usá-los várias vez // declarando uma string com o tamanho do valor de STRING_SIZE new str_3[STRING_SIZE]; ``` + :::note No tempo de compilação, o compilador substituirá todas as ocorrências de `STRING_SIZE` pelo valor `20`, este método economiza tempo e é mais legível na maioria dos casos, lembre-se de que o valor atribuído à constante `STRING_SIZE` deve ser um número inteiro, caso contrário, ocorrerá um erro de compilação. @@ -311,6 +312,7 @@ Examinaremos mais de perto alguns deles, aqueles que são usados ​​com mais strval("here we go, 2018"); // Retorna “0”. strval("2017 ended, welcome 2018"); // Retorna “2017”. ``` + :::tip Existem muitas bibliotecas feitas pela comunidade que você pode baixar e que têm a ver com manipulação de strings. Não consigo pensar em uma inclusão melhor do que [strlib](https://github.com/oscar-broman/strlib). @@ -695,8 +697,8 @@ Você pode usar outra combinação de personagens para brincar com misturas de c | ------------------------------ | -------------- | | \~r\~\~h\~ | Vermelho mais claro | | \~r\~\~h\~\~h\~ | Rosa vermelho | -| \~r\~\~h\~\~h~\~h\~ | Vermelho escuro | -| \~r\~\~h\~~h~~h~~h\~ | Rosa vermelho claro | +| \~r\~\~h\~\~h\~\~h\~ | Vermelho escuro | +| \~r\~\~h\~\~h\~\~h\~\~h\~ | Rosa vermelho claro | | \~r\~\~h\~\~h\~\~h\~\~h\~\~h\~ | Rosa | | \~g\~\~h\~ | Verde claro | @@ -904,6 +906,7 @@ print("Hello \\ World"); ``` Hello \ World ``` + :::caution Warning A saída irá desconsiderar a primeira barra invertida e imprimir a segunda, já que a primeira está escapando da segunda e enganando o programa para vê-la como um caractere bruto. Uma barra invertida só pode escapar de um caractere por vez, portanto, fazer o seguinte gerará um erro de compilação. diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 0dcc1ab97f7..0a85386c26a 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Mereu este apelat primul în filterscript-uri deci returnează 1 și blochează ## Exemple +**DIALOG_STYLE_MSGBOX** + ```c // Definim ID-ul dialogului pentru a putea prelucra răspunsurile #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TREBUIE să returnezi 0 aici! La fel ca OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // În ceva comandă @@ -79,6 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TREBUIE să returnezi 0 aici! La fel ca OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // În ceva comandă @@ -103,10 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // TREBUIE să returnezi 0 aici! La fel ca OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // În ceva comandă -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index bd5eef4d620..5e0c4e296e4 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Motivul va returna 37 (aruncător de flăcări) din orice sursă de foc (de ex. molotov, 18) Motivul va returna 51 de la orice armă care creează o explozie (de ex. RPG, grenadă) Nu trebuie să verificați dacă Killerid este valid înainte de ao folosi în [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID este un parametru valid ID killerid în acea funcție. playerid este singurul care poate apela înapoi. (Bine de știut pentru anti moartea falsă) +- Motivul va returna 37 (aruncător de flăcări) din orice sursă de foc (de ex. molotov, 18) +- Motivul va returna 51 de la orice armă care creează o explozie (de ex. RPG, grenadă) +- Nu trebuie să verificați dacă Killerid este valid înainte de ao folosi în [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID este un parametru valid ID killerid în acea funcție. +- playerid este singurul care poate apela înapoi. (Bine de știut pentru anti moartea falsă) ::: diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index ca06f265c53..682b3fa92ca 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { nou Float:fHealth; diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 3cf90bd7c51..e3c8d7b596d 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: ați tastat „/rcon %s”!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 852aba9aa26..c6d5d5b5948 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Note :::note diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index a6371e4aacc..3104d2e67fa 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Note :::note diff --git a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md index ef09402fcef..0c21bff3aba 100644 --- a/frontend/i18n/ro/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md +++ b/frontend/i18n/ro/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md @@ -744,8 +744,8 @@ Puteți utiliza o altă combinație de caractere pentru a vă juca cu combinați | ------------------------------ | ---------------- | | \~r\~\~h\~ | Roșu mai deschis | | \~r\~\~h\~\~h\~ | Roșu roz | -| \~r\~\~h\~\~h~\~h\~ | Roșu-închis | -| \~r\~\~h\~~h~~h~~h\~ | Roz roșu deschis | +| \~r\~\~h\~\~h\~\~h\~ | Roșu-închis | +| \~r\~\~h\~\~h\~\~h\~\~h\~ | Roz roșu deschis | | \~r\~\~h\~\~h\~\~h\~\~h\~\~h\~ | Roz | | \~g\~\~h\~ | Verde deschis | @@ -1025,7 +1025,9 @@ print("Single quote \'"); Oricum ar fi, ieșirea va fi aceeași: -"" Citat unic: ' "" +``` +Citat unic: ' +``` Singura utilizare la care mă pot gândi în legătură cu acest lucru este setarea unei variabile a caracterului `** '**`, așa că, evident, dacă faceți următoarele, veți provoca o eroare de compilare; diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md index f033d030286..ae9e4fa5133 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamIn.md @@ -37,3 +37,6 @@ public OnActorStreamIn(actorid, forplayerid) ## Функции + +- [OnActorStreamOut](OnActorStreamOut): Вызывается, когда актёр пропадает из зоны стрима клиента. +- [OnPlayerStreamIn](OnPlayerStreamIn): Вызывается, когда игрок попадает в зону стрима другого игрока. diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md index 0d90fdff112..8decacad92c 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnActorStreamOut.md @@ -37,3 +37,6 @@ public OnActorStreamOut(actorid, forplayerid) ## Функции + +- [OnActorStreamIn](OnActorStreamIn): Вызывается, когда актёр попадает в зону стрима клиента. +- [OnPlayerStreamOut](OnPlayerStreamOut): Вызывается, когда игрок пропадает из зоны стрима другого игрока. diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 116b2ba6aa3..32650f0fac1 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -25,6 +25,8 @@ tags: [] ## Пример +**DIALOG_STYLE_MSGBOX** + ```c // Макрос ID диалога, с которым будет взаимодействие #define DIALOG_RULES 1 @@ -49,7 +51,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Вы ДОЛЖНЫ возвращать 0 здесь! Прямо как в OnPlayerCommandText. } +``` + +**DIALOG_STYLE_INPUT** +```c #define DIALOG_LOGIN 2 // В каком-либо месте кода @@ -82,6 +88,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Вы ДОЛЖНЫ возвращать 0 здесь! Прямо как в OnPlayerCommandText. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // In some command @@ -106,10 +117,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0;// Вы ДОЛЖНЫ возвращать 0 здесь! Прямо как в OnPlayerCommandText. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // In some command -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index d52d01f5708..4cac2d6414e 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Примечания :::note diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 1da80a98eb4..8a243b95938 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -33,10 +33,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Примечания :::note diff --git a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md index 11a4604e02d..074811c1c15 100644 --- a/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md +++ b/frontend/i18n/ru/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -35,7 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) diff --git a/frontend/i18n/sl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/sl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index f338c742b47..da95151e9d5 100644 --- a/frontend/i18n/sl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/sl/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Vedno je bila povabljena prva v "filterscript" torej vrnite 1 tam blokira ostale ## Primeri +**DIALOG_STYLE_MSGBOX** + ```c // Določimo ID pogovornega okna, da lahko upravljamo odzive #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText". } +``` + +**DIALOG_STYLE_INPUT** + +```c // definiramo drug dialog, mu damo eno večjo vrednost kot prejšnjemu #define DIALOG_LOGIN 2 @@ -80,6 +87,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText". } +``` + +**DIALOG_STYLE_LIST** + +```c // definiramo tretje pogovorno okno, spet je vrednost večja od vrednosti prejšnjega pogovornega okna #define DIALOG_WEAPONS 3 @@ -105,11 +117,16 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText". } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c // to je še en način prikaza in upravljanja za tretje pogovorno okno #define DIALOG_WEAPONS 3 // Prikažemo ga v ukazu -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Orožje", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Orožje", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 0072cce4d62..f0a4500752e 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -126,13 +126,13 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -**DIALOG_STYLE_TABLIST** +**DIALOG_STYLE_TABLIST_HEADERS** ```c #define DIALOG_WEAPONS 3 // У некој команди -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Weapons", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Weapons", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md index b2fe3ec7592..2e83758454c 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md @@ -39,9 +39,7 @@ public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) :::note -Тренутно постоји само један 'извор' (0 - `CLICK_SOURCE_SCOREBOARD`). - -Присуство овог аргумента сугерише да ће у будућности бити подржани и други извори. +Тренутно постоји само један 'извор' (0 - `CLICK_SOURCE_SCOREBOARD`). Присуство овог аргумента сугерише да ће у будућности бити подржани и други извори. ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index 5fdc919b1e3..afcb5f0807f 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -64,8 +64,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- Подручје клика је дефинисано са [TextDrawTextSize](../functions/TextDrawTextSize). -- `x` и `y` параметри прослеђени тој функцији не смеју бити нула или негативни. +- Подручје клика је дефинисано са [TextDrawTextSize](../functions/TextDrawTextSize). `x` и `y` параметри прослеђени тој функцији не смеју бити нула или негативни. - Не користите [CancelSelectTextDraw](../functions/CancelSelectTextDraw) безусловно унутар ове функције. То може довести до **бесконачне петље**. ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 3d4de35d8b1..43dc3028c63 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Разлог ће враћати 37 (пламен метак) од било којих извора ватре (нпр. молотов, 18). Разлог ће враћати 51 од било ког оружја које ствара експлозију (нпр. RPG, граната). Не морате да проверавате да ли је killerid валидан пре него што га користите у [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID је валидан killerid ID параметар у тој функцији. Само playerid може да позове ову функцију (добро је знати за анти-фејк смрт). +- Разлог ће враћати 37 (пламен метак) од било којих извора ватре (нпр. молотов, 18). +- Разлог ће враћати 51 од било ког оружја које ствара експлозију (нпр. RPG, граната). +- Не морате да проверавате да ли је killerid валидан пре него што га користите у [SendDeathMessage](../functions/SendDeathMessage). INVALID_PLAYER_ID је валидан killerid ID параметар у тој функцији. +- Само playerid може да позове ову функцију (добро је знати за анти-фејк смрт). ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md index b5977ec6e36..b2d96938a14 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -59,9 +59,7 @@ public OnPlayerDisconnect(playerid, reason) :::note -Неке функције можда неће радити исправно када се користе у овој функцији јер је играч већ искључен када се функција позива. То значи да не можете добити недвосмислене информације из функција као што су [GetPlayerIp](../functions/GetPlayerIp) и [GetPlayerPos](../functions/GetPlayerPos). - -Овај проблем је решен на open.mp серверу. +Неке функције можда неће радити исправно када се користе у овој функцији јер је играч већ искључен када се функција позива. То значи да не можете добити недвосмислене информације из функција као што су [GetPlayerIp](../functions/GetPlayerIp) и [GetPlayerPos](../functions/GetPlayerPos). Овај проблем је решен на open.mp серверу. ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 0f0d43ea0bf..d126ff46c5f 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: You typed '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) @@ -48,9 +50,7 @@ public OnRconCommand(cmd[]) :::warning -У SA-MP-у ћете морати да укључите ову функцију у учитаној филтерскрипти да би функционисала у главној скрипти! - -Али је исправљено у open.mp +У SA-MP-у ћете морати да укључите ову функцију у учитаној филтерскрипти да би функционисала у главној скрипти! Али је исправљено у open.mp ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md index 09c6cc7ac24..bd35b4deece 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -34,8 +34,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- Ова повратна функција ће се такође позвати када возило уђе у воду, али возило може бити спасено од уништења телепортацијом или изласком (ако је само делимично потопљено). -- Повратна функција неће бити позвана други пут, а возило може нестати када возач изађе или после кратког времена. +Ова повратна функција ће се такође позвати када возило уђе у воду, али возило може бити спасено од уништења телепортацијом или изласком (ако је само делимично потопљено). Повратна функција неће бити позвана други пут, а возило може нестати када возач изађе или после кратког времена. ::: diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index fc62a6b742a..35df70bb1c3 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -43,7 +43,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` +```c // Да би приказали поруку ( разлог ) играчу пре него сто га избаци са сервера // морамо користити тајмер да би направили размак. Овај размак мора бити само пар милисекунди, // али овај пример користи пуну секунду чисто да би били сигурни. diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index c25ed1bdac5..fafee793293 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -39,7 +39,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` +```c // Да би приказали поруку ( разлог ) играчу пре него што га избаци са сервера // морамо користити тајмер да би направили размак. Овај размак мора бити само пар милисекунди, // али овај пример користи пуну секунду чисто да би били сигурни. diff --git a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md index c3baff2dd2c..11cc6bf3b9c 100644 --- a/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/i18n/sr/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -48,7 +48,7 @@ Player textdraw-ovi се аутоматски униште када се игр :::warning -Key mapping кодови ( као што су ~k~~VEHICLE_ENTER_EXIT~ ) не раде преко 255ог карактера. +Key mapping кодови ( као што су `~k~~VEHICLE_ENTER_EXIT~` ) не раде преко 255ог карактера. ::: diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index fbf993e1cec..e66ce179d89 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Callback นี้ถูกเรียกเมื่อผู้เล่น ## ตัวอย่าง +**DIALOG_STYLE_MSGBOX** + ```c // กำหนดไอดีกล่องโต้ตอบ เพื่อให้เราสามารถควบคุมการตอบสนองได้ #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // คุณต้องส่งค่าคืนเป็น 0 ตรงนี้! เหมือนกับ OnPlayerCommandText } +``` + +**DIALOG_STYLE_INPUT** + +```c #define DIALOG_LOGIN 2 // คำสั่งประมาณนี้ @@ -79,6 +86,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // คุณต้องส่งค่าคืนเป็น 0 ตรงนี้! เหมือนกับ OnPlayerCommandText } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // คำสั่งประมาณนี้ @@ -103,10 +115,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // คุณต้องส่งค่าคืนเป็น 0 ตรงนี้! เหมือนกับ OnPlayerCommandText } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // คำสั่งประมาณนี้ -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "อาวุธ", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "อาวุธ", "อาวุธ\tกระสุน\tราคา\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index ecb13029ee9..afc0d5be99e 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -The reason will return 37 (flame thrower) from any fire sources (e.g. molotov, 18) The reason will return 51 from any weapon that creates an explosion (e.g. RPG, grenade) You do not need to check whether killerid is valid before using it in SendDeathMessage. INVALID_PLAYER_ID is a valid killerid ID parameter in that function. playerid is the only one who can call the callback. (good to know for anti fake death) +- The reason will return 37 (flame thrower) from any fire sources (e.g. molotov, 18) +- The reason will return 51 from any weapon that creates an explosion (e.g. RPG, grenade) +- You do not need to check whether killerid is valid before using it in SendDeathMessage. INVALID_PLAYER_ID is a valid killerid ID parameter in that function. +- playerid is the only one who can call the callback. (good to know for anti fake death) ::: diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md index b894d6e3355..27373edcfea 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerKeyStateChange.md @@ -29,26 +29,41 @@ if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)) if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH)) if ((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH)) +``` + +```c // HOLDING(keys) #define HOLDING(%0) \ ((newkeys & (%0)) == (%0)) if (HOLDING( KEY_FIRE )) if (HOLDING( KEY_FIRE | KEY_CROUCH )) +``` + +```c // PRESSED(keys) #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) if (PRESSED( KEY_FIRE )) if (PRESSED( KEY_FIRE | KEY_CROUCH )) +``` + +```c // PRESSING(keyVariable, keys) #define PRESSING(%0,%1) \ (%0 & (%1)) if (PRESSING( newkeys, KEY_FIRE )) if (PRESSING( newkeys, KEY_FIRE | KEY_CROUCH )) +``` + +```c // RELEASED(keys) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) if (RELEASED( KEY_FIRE )) if (RELEASED( KEY_FIRE | KEY_CROUCH )) +``` + +```c public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_FIRE)) @@ -60,6 +75,9 @@ public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) } return 1; } +``` + +```c public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_JUMP)) @@ -73,6 +91,9 @@ public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) } return 1; } +``` + +```c new Float:gPlayerHealth[MAX_PLAYERS]; diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 44cfe3a3dc8..f78e28a5d16 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,6 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` + +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index c3122eccb54..88bc4cb7f58 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,6 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: You typed '/rcon %s'!", cmd); return 0; } +``` + +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 143481c92ef..f27530a7f07 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -39,11 +39,6 @@ public OnGameModeInit() } ``` -``` -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## บันทึก :::note diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 863ffabddf5..449f8885ae2 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -39,10 +39,6 @@ public OnGameModeInit() } ``` -``` -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## บันทึก :::note diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index b399e610575..085a07f43b2 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // In order to display a message (eg. reason) for the player before the connection is closed // you have to use a timer to create a delay. This delay needs only to be a few milliseconds long, // but this example uses a full second just to be on the safe side. diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 5978c535c75..5f7a796b7b2 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +```c /*In order to display a message (eg. reason) for the player before the connection is closed you have to use a timer to create a delay. This delay needs only to be a few milliseconds long, but this example uses a full second just to be on the safe side.*/ diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md index f9e5e0174d7..d9fa6d69ce3 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/CreatePlayerTextDraw.md @@ -47,7 +47,7 @@ Player-textdraws are automatically destroyed when a player disconnects. :::warning -Keyboard key mapping codes (such as ~k~~VEHICLE_ENTER_EXIT~ Doesn't work beyond 255th character. +Keyboard key mapping codes (such as `~k~~VEHICLE_ENTER_EXIT~` Doesn't work beyond 255th character. ::: diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md index 5cc71ae684e..2b26a54229e 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -46,8 +46,7 @@ Crashes when passed an invalid menu ID. (Fixed in open.mp) :::note - This function disabled the specified menu row for all players. -- There is no function to disable a menu row for a specific player. -- You'd have to create two menus - one with a row disabled, and one without. Or one per player. +- There is no function to disable a menu row for a specific player. You'd have to create two menus - one with a row disabled, and one without. Or one per player. ::: diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md index 8fe91842845..2a107688ea1 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -38,6 +38,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` + +```c public OnPlayerConnect(playerid) { // When the player connects, all map objects will be removed. diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md index 97b534176aa..2c739f4bc84 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -28,6 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid,0); // disables weapons return 1; } +``` + +```c // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md index a014b2794f6..9755d5a0f4d 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -35,6 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` + +```c stock SetPlayerSkinFix(playerid, skinid) { new diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md index ca3d272defb..81d46c7bf79 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -33,6 +33,9 @@ Sets a vehicle's parameters for all players. new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed to VEHICLE_PARAMS_ON (1) +``` + +```c new Timer_VehAlarm[MAX_VEHICLES]; SetVehicleParamsEx_Fixed(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective) diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md index 4d92adcb34f..85033647cbb 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -36,6 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, 0); +``` + +```c // Locks own car for all players, except the player who used the command. public OnPlayerCommandText(playerid, cmdtext[]) { @@ -51,6 +54,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` + +```c // Will show vehicle markers for players streaming in for 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; @@ -73,6 +79,9 @@ public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` + +```c //Top new myMarkedCar; diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md index 25901919546..fb564045be6 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/TextDrawCreate.md @@ -59,7 +59,7 @@ It is recommended to use WHOLE numbers instead of decimal positions when creatin :::warning -Keyboard key mapping codes (such as ~k~~VEHICLE_ENTER_EXIT~ don't work beyond 255th character. +Keyboard key mapping codes (such as `~k~~VEHICLE_ENTER_EXIT~` don't work beyond 255th character. ::: diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md index 05e4261f936..2baa1e4d65e 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fopen.md @@ -43,6 +43,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Open "file.txt" in "write only" mode new File:handle = fopen("file.txt", io_write); @@ -62,6 +65,9 @@ else // Error print("Failed to open file \"file.txt\"."); } +``` + +```c // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt"), @@ -90,6 +96,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/format.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/format.md index cb2cb53c91c..327642c49df 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/format.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/format.md @@ -29,14 +29,23 @@ format(result,sizeof(result), "The number is %i.",number); //-> The number is 4 new string[]= "simple message"; format(result,sizeof(result), "This is a %s containing the number %i.", string, number); // This is a simple message containing the number 42. +``` + +```c new string[64]; format(string,sizeof(string),"Your score is: %d",GetPlayerScore(playerid)); SendClientMessage(playerid,0xFFFFFFAA,string); +``` + +```c new hour, minute, second, string[32]; gettime(hour, minute, second); format(string, sizeof(string), "The time is %02d:%02d:%02d.", hour, minute, second); // will output something like 09:45:02 SendClientMessage(playerid, -1, string); +``` + +```c new string[35]; format(string,sizeof(string),"43%s of my shirts are black.","%%"); SendClientMessage(playerid,0xFFFFFAA,string); diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fread.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fread.md index 6192832991d..a473306616f 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fread.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fread.md @@ -45,6 +45,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt"), diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md index a301beac39b..4af88eff7b3 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/fwrite.md @@ -40,6 +40,9 @@ else // Error print("Failed to open file \"file.txt\"."); } +``` + +```c // Open "file.txt" in "read and write" mode new File:handle = fopen("file.txt"), @@ -68,6 +71,9 @@ else // Error print("The file \"file.txt\" does not exists, or can't be opened."); } +``` + +```c // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/random.md index 74e6d8ea9b5..18656b08b92 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/random.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -23,6 +23,9 @@ A random number ranging from 0 to max-1. new value = random(5); // 'value' might be 0, 1, 2, 3 or 4. 5 possible values. +``` + +```c new Float:RandomSpawn[][4] = { // Positions, (X, Y, Z and Facing Angle) diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md index 033aa049eaa..3973e844b77 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -27,6 +27,9 @@ setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Value that was stored is: %d", value); +``` + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -35,6 +38,9 @@ strunpack(value, value, sizeof(value)); // we need to unpack the string first print(value); //should print :) +``` + +```c setproperty(.value = 123984334, .string = ":)"); // The rest is the same as above. diff --git a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md index 73bb2a9c538..ad94acd7139 100644 --- a/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md +++ b/frontend/i18n/th/docusaurus-plugin-content-docs/current/scripting/functions/valstr.md @@ -25,6 +25,15 @@ This function does not return any specific values. new string[4]; new iValue = 250; valstr(string,iValue); // string is now "250" +``` + +## บันทึก + +:::warning + +Passing a high value to this function can cause the server to freeze/crash. Fixes are available. Below is a fix that can be put straight in to your script (before valstr is used anywhere). open.mp includes this fix. + +```c // valstr fix by Slice stock FIX_valstr(dest[], value, bool:pack = false) { @@ -39,12 +48,6 @@ stock FIX_valstr(dest[], value, bool:pack = false) #define valstr FIX_valstr ``` -## บันทึก - -:::warning - -Passing a high value to this function can cause the server to freeze/crash. Fixes are available. Below is a fix that can be put straight in to your script (before valstr is used anywhere). open.mp includes this fix. - ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 251b9c8e098..6dc6d45d003 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -23,6 +23,8 @@ Filterscriptler içerisinde 1 olarak döndürmek diğer filterscripts'lerin bunu ## Örnek +**DIALOG_STYLE_MSGBOX** + ```c // Dialog ID'sini tanımlayalım. #define DIALOG_RULES 1 @@ -47,6 +49,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Burada return 0 döndürmelisiniz. Tıpkı OnPlayerCommandText'de gösterilen örnek gibi. } +``` + +**DIALOG_STYLE_INPUT** + +```c // Tekrar dialog ID'sini tanımlıyoruz. #define DIALOG_LOGIN 2 @@ -80,6 +87,11 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Burada return 0 döndürmelisiniz. Tıpkı OnPlayerCommandText'de gösterilen örnek gibi. } +``` + +**DIALOG_STYLE_LIST** + +```c #define DIALOG_WEAPONS 3 // Herhangi bir komutun veya eventin içerisine yerleştirelim. @@ -104,10 +116,15 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) return 0; // Burada return 0 döndürmelisiniz. Tıpkı OnPlayerCommandText'de gösterilen örnek gibi. } +``` + +**DIALOG_STYLE_TABLIST_HEADERS** + +```c #define DIALOG_WEAPONS 3 // Herhangi bir komutun veya eventin içerisine yerleştirelim. -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Silahlar", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Silahlar", "Silahlar\tMermi\tFiyat\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index 84829457974..20b1be2bc2d 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -49,7 +49,10 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) :::note -Herhangi bir ateş kaynağından gelen hasarlarda(örnek: molotov, 18) weaponid değeri 37 (flame thrower) olarak döndürülür. Herhangi bir patlama kaynağından gelen hasarlarda (örnek: roketatar, el bombası) weapondid değeri 51 olarak geri döndürülür. SendDeathMessage fonksiyonunu kullanmadan önce killerid'nin geçerli olup olmadığını kontrol etmenize gerek yok. INVALID_PLAYER_ID geçerli bir killerid ID parametresidir. Yalnızca playerid tarafından çağırılabilir. (anti fake death için bilmeniz iyi olur.) +- Herhangi bir ateş kaynağından gelen hasarlarda(örnek: molotov, 18) weaponid değeri 37 (flame thrower) olarak döndürülür. +- Herhangi bir patlama kaynağından gelen hasarlarda (örnek: roketatar, el bombası) weapondid değeri 51 olarak geri döndürülür. +- SendDeathMessage fonksiyonunu kullanmadan önce killerid'nin geçerli olup olmadığını kontrol etmenize gerek yok. INVALID_PLAYER_ID geçerli bir killerid ID parametresidir. +- Yalnızca playerid tarafından çağırılabilir. (anti fake death için bilmeniz iyi olur.) ::: diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md index 5d365e39858..766d00cdd0b 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerTakeDamage.md @@ -48,7 +48,9 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod } return 1; } +``` +```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) // Hasar veren kişi kendi değilse, silah ID'si keskin nişancı tüfeğine (34) eşitse ve vurulan vücut parçası 9 ise... diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md index 97cd2603f83..8739923b0e6 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerUpdate.md @@ -49,7 +49,9 @@ stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) SendClientMessage(playerid, 0xFFFFFFFF, s); } +``` +```c public OnPlayerUpdate(playerid) { new Float:fHealth; diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 853aa43f8a9..5bdba6296f2 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: '/rcon %s' komutu girildi!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "merhaba", true)) diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 3123c3cf985..bd2af5d46df 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -32,11 +32,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## Notlar :::note diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index 62a133331ce..87b702ca07c 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -39,10 +39,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## Notlar :::note diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md index 51e731033e0..e14cbf9732d 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/Ban.md @@ -29,6 +29,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) return 1; } } +``` + +```c // Oyuncuyu yasaklamadan önce bir mesaj (örn. yasaklanma açıklaması) göndermek için // bir zamanlayıcı (timer) oluşturmanız gerekir. Bu zamanlayıcının bir kaç milisaniye olması yeterlidir, // ancak alt taraftaki örnekte güvenli olması açısından tam bir saniye kullanılmıştır. diff --git a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md index 7ef4d42d054..c1adc8e17ad 100644 --- a/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md +++ b/frontend/i18n/tr/docusaurus-plugin-content-docs/current/scripting/functions/BanEx.md @@ -30,6 +30,9 @@ public OnPlayerCommandText( playerid, cmdtext[] ) return 1; } } +``` + +```c // Oyuncuyu yasaklamadan önce bir mesaj (örn. yasaklanma açıklaması) göndermek için // bir zamanlayıcı (timer) oluşturmanız gerekir. Bu zamanlayıcının bir kaç milisaniye olması yeterlidir, // ancak alt taraftaki örnekte güvenli olması açısından tam bir saniye kullanılmıştır. diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 4369b84915f..eb06d6fed9a 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -126,13 +126,13 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -**DIALOG_STYLE_TABLIST** +**DIALOG_STYLE_TABLIST_HEADERS** ```c #define DIALOG_WEAPONS 3 // Trong một lệnh nào đó -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Vũ Khí", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Vũ Khí", "Vũ khí\tĐạn\tGiá\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md index 73b107e5e86..73e5f831eeb 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickPlayer.md @@ -39,9 +39,7 @@ public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) :::note -Hiện tại chỉ có một 'source' (0 - `CLICK_SOURCE_SCOREBOARD`). - -Sự tồn tại của tham số này gợi ý rằng có thể có nhiều nguồn khác được hỗ trợ trong tương lai. +Hiện tại chỉ có một 'source' (0 - `CLICK_SOURCE_SCOREBOARD`). Sự tồn tại của tham số này gợi ý rằng có thể có nhiều nguồn khác được hỗ trợ trong tương lai. ::: diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index d83aecd5e25..f9196f342a7 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -64,8 +64,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- Khu vực có thể nhấp được xác định bởi [TextDrawTextSize](../functions/TextDrawTextSize). -- Các tham số `x` và `y` được truyền vào hàm đó không được bằng 0 hoặc âm. +- Khu vực có thể nhấp được xác định bởi [TextDrawTextSize](../functions/TextDrawTextSize). Các tham số `x` và `y` được truyền vào hàm đó không được bằng 0 hoặc âm. - Không nên sử dụng [CancelSelectTextDraw](../functions/CancelSelectTextDraw) một cách không điều kiện trong callback này. Điều này sẽ dẫn đến một **vòng lặp vô hạn**. ::: diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md index afae48e4dd7..025615869ff 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -59,9 +59,7 @@ public OnPlayerDisconnect(playerid, reason) :::note -Một số hàm có thể không hoạt động chính xác khi sử dụng trong callback này vì người chơi đã bị ngắt kết nối khi callback được gọi. Điều này có nghĩa là bạn không thể lấy thông tin rõ ràng từ các hàm như [GetPlayerIp](../functions/GetPlayerIp) và [GetPlayerPos](../functions/GetPlayerPos). - -Vấn đề này được giải quyết trong server open.mp. +Một số hàm có thể không hoạt động chính xác khi sử dụng trong callback này vì người chơi đã bị ngắt kết nối khi callback được gọi. Điều này có nghĩa là bạn không thể lấy thông tin rõ ràng từ các hàm như [GetPlayerIp](../functions/GetPlayerIp) và [GetPlayerPos](../functions/GetPlayerPos). Vấn đề này được giải quyết trong server open.mp. ::: diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index a98b0cb06ad..56943ebfcf9 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -25,7 +25,9 @@ public OnRconCommand(cmd[]) log("RCON command executed: %s", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "broadcast", true)) @@ -48,9 +50,7 @@ public OnRconCommand(cmd[]) :::warning -Trong SA-MP, bạn cần phải bao gồm callback này trong một filterscript đã được tải để nó hoạt động trong gamemode! - -Nhưng điều này đã được sửa trong open.mp. +Trong SA-MP, bạn cần phải bao gồm callback này trong một filterscript đã được tải để nó hoạt động trong gamemode! Nhưng điều này đã được sửa trong open.mp. ::: diff --git a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md index 474773566c6..c3d19e598f8 100644 --- a/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/i18n/vi/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -33,8 +33,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- Callback này cũng sẽ được gọi khi một xe vào nước, nhưng xe có thể được cứu khỏi sự phá hủy bằng cách dịch chuyển hoặc lái ra (nếu chỉ bị ngập một phần). -- Callback sẽ không được gọi lần thứ hai, và xe có thể biến mất khi người lái thoát ra hoặc sau một khoảng thời gian ngắn. +Callback này cũng sẽ được gọi khi một xe vào nước, nhưng xe có thể được cứu khỏi sự phá hủy bằng cách dịch chuyển hoặc lái ra (nếu chỉ bị ngập một phần). Callback sẽ không được gọi lần thứ hai, và xe có thể biến mất khi người lái thoát ra hoặc sau một khoảng thời gian ngắn. ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md index 98604552d48..2a0ac1cd322 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnDialogResponse.md @@ -124,13 +124,13 @@ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) } ``` -**表格列表样式 (DIALOG_STYLE_TABLIST)** +**带表头的表格列表样式 (DIALOG_STYLE_TABLIST_HEADERS)** ```c #define DIALOG_WEAPONS 3 // 在某个指令中 -ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "武器商店", +ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "武器商店", "武器\t弹药\t价格\n\ M4\t120\t500\n\ MP5\t90\t350\n\ diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md index 8415e18aa67..80f6530467e 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerClickTextDraw.md @@ -64,8 +64,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid) :::warning -- 点击区域由[TextDrawTextSize](../functions/TextDrawTextSize)定义 -- 此函数的x/y参数值不可为零或负数 +- 点击区域由[TextDrawTextSize](../functions/TextDrawTextSize)定义。此函数的x/y参数值不可为零或负数 - 禁止无条件调用[CancelSelectTextDraw](../functions/CancelSelectTextDraw),否则会导致无限循环 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md index aec7d1fd0a6..69d4a9693ec 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDeath.md @@ -54,9 +54,9 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason) 特殊原因ID说明: - 火焰伤害(如燃烧瓶/武器18)会返回37(火焰喷射器ID) -- 爆炸伤害(如RPG/手雷)会返回51 - [SendDeathMessage](../functions/SendDeathMessage)函数可直接使用INVALID_PLAYER_ID作为参数 - 只有实际死亡的玩家会触发此回调(可用于反伪造死亡检测) +- 爆炸伤害(如RPG/手雷)会返回51 +- [SendDeathMessage](../functions/SendDeathMessage)函数可直接使用INVALID_PLAYER_ID作为参数 +- 只有实际死亡的玩家会触发此回调(可用于反伪造死亡检测) ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md index 1df04a194ec..b15a5b4a518 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnPlayerDisconnect.md @@ -58,11 +58,7 @@ public OnPlayerDisconnect(playerid, reason) :::note -由于玩家已断开连接,部分函数可能无法正常工作: - -- [GetPlayerIp](../functions/GetPlayerIp) 获取IP -- [GetPlayerPos](../functions/GetPlayerPos) 获取坐标 - 该问题已在open.mp服务端修复 +由于玩家已断开连接,部分函数可能无法正常工作:[GetPlayerIp](../functions/GetPlayerIp) 获取IP、[GetPlayerPos](../functions/GetPlayerPos) 获取坐标。该问题已在open.mp服务端修复 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md index 091ca496522..ae69f971e76 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnRconCommand.md @@ -29,7 +29,9 @@ public OnRconCommand(cmd[]) printf("[RCON]: 你输入了 '/rcon %s'!", cmd); return 0; } +``` +```c public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md index b6b438057dc..701fbc671a0 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnVehicleDeath.md @@ -37,8 +37,7 @@ public OnVehicleDeath(vehicleid, killerid) :::note -- 车辆部分浸没水中时也会触发此回调,此时通过传送或驶出水域仍可挽救车辆 -- 车辆完全摧毁后,当驾驶员离开或经过短暂时间,车辆会消失且不会再次触发此回调 +车辆部分浸没水中时也会触发此回调,此时通过传送或驶出水域仍可挽救车辆。车辆完全摧毁后,当驾驶员离开或经过短暂时间,车辆会消失且不会再次触发此回调 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md index 345af5b1e34..7c61865cef9 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddCharModel.md @@ -35,11 +35,6 @@ public OnGameModeInit() } ``` -```c -AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); -AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); -``` - ## 注意事项 :::note diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md index bb3ede1e1fb..c161b8f85b3 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/AddSimpleModel.md @@ -35,10 +35,6 @@ public OnGameModeInit() } ``` -```c -AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); -``` - ## 注意事项 :::note diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md index 09b3463be18..a9cc5369ef9 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/CancelSelectTextDraw.md @@ -36,9 +36,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::warning -此函数会触发 [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) 回调并传入 INVALID_TEXT_DRAW (65535) - -在 OnPlayerClickTextDraw 回调中使用此函数时,若未处理该无效值情况会导致客户端进入无限循环 +此函数会触发 [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw) 回调并传入 INVALID_TEXT_DRAW (65535)。在 OnPlayerClickTextDraw 回调中使用此函数时,若未处理该无效值情况会导致客户端进入无限循环 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md index ffc93622dc9..0666e3ccb43 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/DisableMenuRow.md @@ -57,8 +57,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::note - 此函数会对所有玩家生效 -- 没有针对单个玩家的行禁用功能 -- 可通过创建多个菜单实现差异化效果(如:包含禁用行的菜单和普通菜单) +- 没有针对单个玩家的行禁用功能。可通过创建多个菜单实现差异化效果(如:包含禁用行的菜单和普通菜单) ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md index c64f81f21f6..f1eccfae827 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetMaxPlayers.md @@ -21,8 +21,7 @@ SendClientMessage(playerid, 0xFFFFFFFF, string); // 向玩家发送服务器最 :::warning -- 此函数不能替代 MAX_PLAYERS 宏定义 -- 不可用于编译时数组大小定义 +- 此函数不能替代 MAX_PLAYERS 宏定义,不可用于编译时数组大小定义 - 应始终将 MAX_PLAYERS 宏定义为与 max_players 配置相同或更大的值 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md index 9174045d037..c608c1dd48f 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/GetPlayerName.md @@ -42,9 +42,7 @@ public OnPlayerConnect(playerid) :::note -通过 [SetPlayerName](SetPlayerName) 设置玩家昵称时,最大长度为 24 个字符(定义为`MAX_PLAYER_NAME`) - -客户端实际可使用的昵称长度为 3-20 个字符,超出范围的昵称会被服务器拒绝连接 +通过 [SetPlayerName](SetPlayerName) 设置玩家昵称时,最大长度为 24 个字符(定义为`MAX_PLAYER_NAME`)。客户端实际可使用的昵称长度为 3-20 个字符,超出范围的昵称会被服务器拒绝连接 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md index e0ec9a4957b..bee0dbe271e 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/NPC_IsValid.md @@ -43,8 +43,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) :::tip -- 在对 NPC 执行操作前始终检查其是否有效。 -- 这可以防止运行时错误和崩溃。 +- 在对 NPC 执行操作前始终检查其是否有效。这可以防止运行时错误和崩溃。 - 在遍历潜在 NPC ID 的循环中使用此函数。 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md index 41572e5f5b8..25ed03f1c28 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/PutPlayerInVehicle.md @@ -50,8 +50,7 @@ public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) :::warning - 若指定非法座位或座位已被占用,玩家离开车辆时会导致客户端崩溃 -- 将玩家放置到尚未流加载的车辆中可能不可靠,因客户端可能未完成车辆资源加载 -- 此问题同样适用于刚创建的车辆 +- 将玩家放置到尚未流加载的车辆中可能不可靠,因客户端可能未完成车辆资源加载。此问题同样适用于刚创建的车辆 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md index df6770cba89..df65172cee3 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/RemoveBuildingForPlayer.md @@ -31,7 +31,9 @@ public OnPlayerConnect(playerid) RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0); return 1; } +``` +```c public OnPlayerConnect(playerid) { // 当玩家连接时,移除6000.0半径范围内的所有地图物体 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md index e66ea6e59dc..953010ae731 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerArmedWeapon.md @@ -28,7 +28,9 @@ public OnPlayerUpdate(playerid) SetPlayerArmedWeapon(playerid, WEAPON_FIST); // 禁用武器 return 1; } +``` +```c // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md index b1abf6ae8c5..3d5560ece6d 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerFacingAngle.md @@ -38,11 +38,7 @@ SetPlayerFacingAngle(playerid, 0.0); // 玩家面向北方 :::warning -GTA:SA 中的角度方向与现实世界相反: - -- 现实中的 90 度对应东方,但在游戏中对应西方 -- 北方和南方仍保持 0/360 度和 180 度 - 转换公式:游戏角度 = 360 - 实际角度 +GTA:SA 中的角度方向与现实世界相反:现实中的 90 度对应东方,但在游戏中对应西方;北方和南方仍保持 0/360 度和 180 度。转换公式:游戏角度 = 360 - 实际角度 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md index 25e4eca3ec3..e2da3914a8a 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetPlayerSkin.md @@ -35,7 +35,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c SetPlayerSkinFix(playerid, skinid) { if (!IsPlayerConnected(playerid)) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md index e2af055a638..7edde0994e3 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetTimer.md @@ -39,10 +39,7 @@ public OneSecondTimer() :::warning -- SA-MP 存在定时器精度问题(误差约 25%),可参考以下修复方案: - - [精度修复方案 1](https://sampforum.blast.hk/showthread.php?tid=289675) - - [精度修复方案 2](https://sampforum.blast.hk/showthread.php?tid=650736) - (open.mp 已修复此问题) +- SA-MP 存在定时器精度问题(误差约 25%),可参考以下修复方案:[精度修复方案 1](https://sampforum.blast.hk/showthread.php?tid=289675)、[精度修复方案 2](https://sampforum.blast.hk/showthread.php?tid=650736)(open.mp 已修复此问题) - 大量使用定时器会增加服务器 CPU/内存消耗 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md index 815c1cdbe43..8bc365ed979 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsEx.md @@ -29,10 +29,6 @@ tags: ["车辆"] ## 示例代码 ```c -// 全局变量声明 -new - gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; - // 修改单个参数时需先获取当前状态 new bool:engine, bool:lights, bool:alarm, bool:doors, bool:bonnet, bool:boot, bool:objective; @@ -40,6 +36,12 @@ new // 创建车辆时的设置 GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective); // 仅修改引擎状态 +``` + +```c +// 全局变量声明 +new + gVehicleAlarmTimer[MAX_VEHICLES] = {0, ...}; // 带警报自动关闭的增强函数 SetVehicleParamsEx_Fixed(vehicleid, &bool:engine, &bool:lights, &bool:alarm, &bool:doors, &bool:bonnet, &bool:boot, &bool:objective) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md index cfa6ea3d25d..c0858553968 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/SetVehicleParamsForPlayer.md @@ -36,7 +36,9 @@ new GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, false); +``` +```c // 锁定自己车辆(排除自己) public OnPlayerCommandText(playerid, cmdtext[]) { @@ -56,7 +58,9 @@ public OnPlayerCommandText(playerid, cmdtext[]) } return 0; } +``` +```c // 0.3a+版本流加载处理示例 new bool:iVehicleObjective[MAX_VEHICLES][2]; @@ -80,7 +84,9 @@ public OnVehicleStreamIn(vehicleid, forplayerid) // 车辆流加载时重新应用参数 SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } +``` +```c // 标记特定车辆示例 new myMarkedCar; @@ -111,8 +117,7 @@ public OnVehicleStreamIn(vehicleid, forplayerid) :::warning -- 必须通过[OnVehicleStreamIn](../callbacks/OnVehicleStreamIn)回调重新应用参数设置 -- 参数设置在车辆流加载时需要重新应用 +必须通过[OnVehicleStreamIn](../callbacks/OnVehicleStreamIn)回调重新应用参数设置 ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md index 51bee749672..a7372f6cc99 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/UsePlayerPedAnims.md @@ -9,6 +9,10 @@ tags: ["玩家"] 启用全局标准角色动画系统,所有玩家将统一使用 CJ 模型的骨骼动画,覆盖各皮肤自带的特殊动画(例如滑板皮肤将禁用滑行动作)。 +## 返回值 + +此函数不返回任何特定的值。 + ## 示例代码 ```c diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md index 237632789c1..d866a612dc1 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/random.md @@ -23,6 +23,9 @@ tags: ["核心"] new value = random(5); // 'value' 可能为 0, 1, 2, 3 或 4 (共5种可能值) +``` + +```c new Float:RandomSpawn[][4] = { // 坐标数组 (X, Y, Z 及朝向角度) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md index 409f3bd3aa9..44995bbcdd8 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/functions/setproperty.md @@ -27,6 +27,9 @@ setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("存储的整数值为: %d", value); +``` + +```c setproperty(0, "", 123984334, ":)"); new value[4]; @@ -35,6 +38,9 @@ strunpack(value, value, sizeof(value)); // 需要先解压字符串 print(value); // 应该打印 :) +``` + +```c setproperty(.value = 123984334, .string = ":)"); // 其余操作与上述示例相同 diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md index bbfec6cabb2..f1424380872 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/dialogstyles.md @@ -9,7 +9,7 @@ sidebar_label: 对话框样式 - 按下**button1**会将**response**设为**1** - 按下**button2**会将**response**设为**0** - 所有对话框都可选配按钮 2,留空则不显示(如首个示例)。玩家无法点击隐藏按钮,但按 ESC 键仍会触发[OnDialogResponse](../callbacks/OnDialogResponse)且**response**=**0** -- [ShowPlayerDialog](../functions/ShowPlayerDialog)支持在以下字符串中使用颜色嵌入:​**caption**​(标题)、**info**​(内容)、**button1**和**button2** +- [ShowPlayerDialog](../functions/ShowPlayerDialog)支持在以下字符串中使用颜色嵌入:**caption**(标题)、**info**(内容)、**button1**和**button2** ::: @@ -35,8 +35,8 @@ public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) :::note -- ​**\t**​ 添加制表符(增加间距) -- ​**\n**​ 创建新行 +- **\t** 添加制表符(增加间距) +- **\n** 创建新行 - [颜色嵌入](colorslist#颜色嵌入)效果在换行后依然持续 ::: @@ -49,8 +49,8 @@ ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_MSGBOX, "标题", "信息 :::note -- ​**listitem**​ 固定为 ​**-1** -- ​**inputtext**​ 始终为空 +- **listitem** 固定为 **-1** +- **inputtext** 始终为空 ::: @@ -72,8 +72,8 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = :::note -- ​**\t**​ 添加制表符(增加间距) -- ​**\n**​ 创建新行 +- **\t** 添加制表符(增加间距) +- **\n** 创建新行 - [颜色嵌入](colorslist#颜色嵌入)效果在换行后依然持续 ::: @@ -86,8 +86,8 @@ ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_INPUT, "标题", "在下 :::note -- ​**listitem**​ 固定为 ​**-1** -- ​**inputtext**​ 包含用户输入的文本(含颜色代码) +- **listitem** 固定为 **-1** +- **inputtext** 包含用户输入的文本(含颜色代码) ::: @@ -109,8 +109,8 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = :::note -- ​**\t**​ 添加制表符(增加间距) -- ​**\n**​ 创建新行 +- **\t** 添加制表符(增加间距) +- **\n** 创建新行 - [颜色嵌入](colorslist#颜色嵌入)效果在制表符后依然持续 ::: @@ -123,8 +123,8 @@ ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_LIST, "Caption", "项 0\n :::note -- ​**listitem**​ 表示选中项的索引(从 0 开始) -- ​**inputtext**​ 返回选中项的文本内容(不含颜色代码) +- **listitem** 表示选中项的索引(从 0 开始) +- **inputtext** 返回选中项的文本内容(不含颜色代码) ::: @@ -142,7 +142,7 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = :::note -- 功能类似 ​**DIALOG_STYLE_INPUT** +- 功能类似 **DIALOG_STYLE_INPUT** ::: @@ -152,8 +152,8 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = :::note -- ​**\t**​ 添加制表符(增加间距) -- ​**\n**​ 创建新行 +- **\t** 添加制表符(增加间距) +- **\n** 创建新行 ::: @@ -165,8 +165,8 @@ ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_PASSWORD, "标题", "在 :::note -- ​**listitem**​ 固定为 ​**-1** -- ​**inputtext**​ 返回用户输入的明文 +- **listitem** 固定为 **-1** +- **inputtext** 返回用户输入的明文 ::: @@ -184,7 +184,7 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = :::note -- 功能类似 ​**DIALOG_STYLE_LIST** +- 功能类似 **DIALOG_STYLE_LIST** ::: @@ -194,10 +194,9 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = :::note -- ​**\t**​ 创建新列 -- ​**\n**​ 创建新行 +- **\t** 创建新列 +- **\n** 创建新行 - [颜色嵌入](colorslist#颜色嵌入)效果在换行/制表后重置 -- 首行内容作为表头显示 ::: @@ -211,8 +210,8 @@ Pistol\t$1000\t50", :::note -- ​**listitem**​ 表示选中项的索引(从 0 开始) -- ​**inputtext**​ 返回选中项首列文本(不含颜色代码) +- **listitem** 表示选中项的索引(从 0 开始) +- **inputtext** 返回选中项首列文本(不含颜色代码) ::: @@ -230,7 +229,7 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = :::note -- 功能类似 ​**DIALOG_STYLE_LIST** +- 功能类似 **DIALOG_STYLE_LIST** ::: @@ -240,8 +239,8 @@ playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = :::note -- ​**\t**​ 创建新列 -- ​**\n**​ 创建新行 +- **\t** 创建新列 +- **\n** 创建新行 - [颜色嵌入](colorslist#颜色嵌入)效果在换行/制表后重置 - 首行内容作为固定表头显示 @@ -257,8 +256,8 @@ ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_TABLIST_HEADERS, "标题" :::note -- ​**listitem**​ 表示选中项的索引(从 0 开始) -- ​**inputtext**​ 返回选中项首列文本(不含颜色代码) +- **listitem** 表示选中项的索引(从 0 开始) +- **inputtext** 返回选中项首列文本(不含颜色代码) ::: diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md index 11b984e1e95..1a3873aaf91 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-door-status.md @@ -10,31 +10,31 @@ description: 车辆车门状态定义表。 ::: -| 定义 | 数值 | -| ----------------------------------------------------------------------------------------- | ---------- | -| UNKNOWN_VEHICLE_DOOR_STATUS(未知车辆车门状态) | -1 | -| VEHICLE_DOOR_STATUS_NONE ​**/**​ CARDOOR_NONE(无车门异常) | 0 | -| VEHICLE_DOOR_STATUS_BONNET_OPEN ​**/**​ CARDOOR_BONNET_OPEN(引擎盖开启) | 0x00000001 | -| VEHICLE_DOOR_STATUS_BONNET_DAMAGED ​**/**​ CARDOOR_BONNET_DAMAGED(引擎盖损坏) | 0x00000002 | -| VEHICLE_DOOR_STATUS_BONNET_MISSING ​**/**​ CARDOOR_BONNET_MISSING(引擎盖缺失) | 0x00000004 | -| VEHICLE_DOOR_STATUS_HOOD_OPEN ​**/**​ CARDOOR_HOOD_OPEN(发动机罩开启) | 0x00000001 | -| VEHICLE_DOOR_STATUS_HOOD_DAMAGED ​**/**​ CARDOOR_HOOD_DAMAGED(发动机罩损坏) | 0x00000002 | -| VEHICLE_DOOR_STATUS_HOOD_MISSING ​**/**​ CARDOOR_HOOD_MISSING(发动机罩缺失) | 0x00000004 | -| VEHICLE_DOOR_STATUS_BOOT_OPEN ​**/**​ CARDOOR_BOOT_OPEN(后备箱开启) | 0x00000100 | -| VEHICLE_DOOR_STATUS_BOOT_DAMAGED ​**/**​ CARDOOR_BOOT_DAMAGED(后备箱损坏) | 0x00000200 | -| VEHICLE_DOOR_STATUS_BOOT_MISSING ​**/**​ CARDOOR_BOOT_MISSING(后备箱缺失) | 0x00000400 | -| VEHICLE_DOOR_STATUS_TRUNK_OPEN ​**/**​ CARDOOR_TRUNK_OPEN(行李箱开启) | 0x00000100 | -| VEHICLE_DOOR_STATUS_TRUNK_DAMAGED ​**/**​ CARDOOR_TRUNK_DAMAGED(行李箱损坏) | 0x00000200 | -| VEHICLE_DOOR_STATUS_TRUNK_MISSING ​**/**​ CARDOOR_TRUNK_MISSING(行李箱缺失) | 0x00000400 | -| VEHICLE_DOOR_STATUS_FRONT_LEFT_OPEN ​**/**​ CARDOOR_FRONT_LEFT_OPEN(左前门开启) | 0x00010000 | -| VEHICLE_DOOR_STATUS_FRONT_LEFT_DAMAGED ​**/**​ CARDOOR_FRONT_LEFT_DAMAGED(左前门损坏) | 0x00020000 | -| VEHICLE_DOOR_STATUS_FRONT_LEFT_MISSING ​**/**​ CARDOOR_FRONT_LEFT_MISSING(左前门缺失) | 0x00040000 | -| VEHICLE_DOOR_STATUS_DRIVER_OPEN ​**/**​ CARDOOR_DRIVER_OPEN(驾驶门开启) | 0x00010000 | -| VEHICLE_DOOR_STATUS_DRIVER_DAMAGED ​**/**​ CARDOOR_DRIVER_DAMAGED(驾驶门损坏) | 0x00020000 | -| VEHICLE_DOOR_STATUS_DRIVER_MISSING ​**/**​ CARDOOR_DRIVER_MISSING(驾驶门缺失) | 0x00040000 | -| VEHICLE_DOOR_STATUS_FRONT_RIGHT_OPEN ​**/**​ CARDOOR_FRONT_RIGHT_OPEN(右前门开启) | 0x01000000 | -| VEHICLE_DOOR_STATUS_FRONT_RIGHT_DAMAGED ​**/**​ CARDOOR_FRONT_RIGHT_DAMAGED(右前门损坏) | 0x02000000 | -| VEHICLE_DOOR_STATUS_FRONT_RIGHT_MISSING ​**/**​ CARDOOR_FRONT_RIGHT_MISSING(右前门缺失) | 0x04000000 | -| VEHICLE_DOOR_STATUS_PASSENGER_OPEN ​**/**​ CARDOOR_PASSENGER_OPEN(乘客门开启) | 0x01000000 | -| VEHICLE_DOOR_STATUS_PASSENGER_DAMAGED ​**/**​ CARDOOR_PASSENGER_DAMAGED(乘客门损坏) | 0x02000000 | -| VEHICLE_DOOR_STATUS_PASSENGER_MISSING ​**/**​ CARDOOR_PASSENGER_MISSING(乘客门缺失) | 0x04000000 | +| 定义 | 数值 | +| --------------------------------------------------------------------------------------- | ---------- | +| UNKNOWN_VEHICLE_DOOR_STATUS(未知车辆车门状态) | -1 | +| VEHICLE_DOOR_STATUS_NONE **/** CARDOOR_NONE(无车门异常) | 0 | +| VEHICLE_DOOR_STATUS_BONNET_OPEN **/** CARDOOR_BONNET_OPEN(引擎盖开启) | 0x00000001 | +| VEHICLE_DOOR_STATUS_BONNET_DAMAGED **/** CARDOOR_BONNET_DAMAGED(引擎盖损坏) | 0x00000002 | +| VEHICLE_DOOR_STATUS_BONNET_MISSING **/** CARDOOR_BONNET_MISSING(引擎盖缺失) | 0x00000004 | +| VEHICLE_DOOR_STATUS_HOOD_OPEN **/** CARDOOR_HOOD_OPEN(发动机罩开启) | 0x00000001 | +| VEHICLE_DOOR_STATUS_HOOD_DAMAGED **/** CARDOOR_HOOD_DAMAGED(发动机罩损坏) | 0x00000002 | +| VEHICLE_DOOR_STATUS_HOOD_MISSING **/** CARDOOR_HOOD_MISSING(发动机罩缺失) | 0x00000004 | +| VEHICLE_DOOR_STATUS_BOOT_OPEN **/** CARDOOR_BOOT_OPEN(后备箱开启) | 0x00000100 | +| VEHICLE_DOOR_STATUS_BOOT_DAMAGED **/** CARDOOR_BOOT_DAMAGED(后备箱损坏) | 0x00000200 | +| VEHICLE_DOOR_STATUS_BOOT_MISSING **/** CARDOOR_BOOT_MISSING(后备箱缺失) | 0x00000400 | +| VEHICLE_DOOR_STATUS_TRUNK_OPEN **/** CARDOOR_TRUNK_OPEN(行李箱开启) | 0x00000100 | +| VEHICLE_DOOR_STATUS_TRUNK_DAMAGED **/** CARDOOR_TRUNK_DAMAGED(行李箱损坏) | 0x00000200 | +| VEHICLE_DOOR_STATUS_TRUNK_MISSING **/** CARDOOR_TRUNK_MISSING(行李箱缺失) | 0x00000400 | +| VEHICLE_DOOR_STATUS_FRONT_LEFT_OPEN **/** CARDOOR_FRONT_LEFT_OPEN(左前门开启) | 0x00010000 | +| VEHICLE_DOOR_STATUS_FRONT_LEFT_DAMAGED **/** CARDOOR_FRONT_LEFT_DAMAGED(左前门损坏) | 0x00020000 | +| VEHICLE_DOOR_STATUS_FRONT_LEFT_MISSING **/** CARDOOR_FRONT_LEFT_MISSING(左前门缺失) | 0x00040000 | +| VEHICLE_DOOR_STATUS_DRIVER_OPEN **/** CARDOOR_DRIVER_OPEN(驾驶门开启) | 0x00010000 | +| VEHICLE_DOOR_STATUS_DRIVER_DAMAGED **/** CARDOOR_DRIVER_DAMAGED(驾驶门损坏) | 0x00020000 | +| VEHICLE_DOOR_STATUS_DRIVER_MISSING **/** CARDOOR_DRIVER_MISSING(驾驶门缺失) | 0x00040000 | +| VEHICLE_DOOR_STATUS_FRONT_RIGHT_OPEN **/** CARDOOR_FRONT_RIGHT_OPEN(右前门开启) | 0x01000000 | +| VEHICLE_DOOR_STATUS_FRONT_RIGHT_DAMAGED **/** CARDOOR_FRONT_RIGHT_DAMAGED(右前门损坏) | 0x02000000 | +| VEHICLE_DOOR_STATUS_FRONT_RIGHT_MISSING **/** CARDOOR_FRONT_RIGHT_MISSING(右前门缺失) | 0x04000000 | +| VEHICLE_DOOR_STATUS_PASSENGER_OPEN **/** CARDOOR_PASSENGER_OPEN(乘客门开启) | 0x01000000 | +| VEHICLE_DOOR_STATUS_PASSENGER_DAMAGED **/** CARDOOR_PASSENGER_DAMAGED(乘客门损坏) | 0x02000000 | +| VEHICLE_DOOR_STATUS_PASSENGER_MISSING **/** CARDOOR_PASSENGER_MISSING(乘客门缺失) | 0x04000000 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md index 9a67c575b8f..0e231354c2f 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-light-status.md @@ -10,12 +10,12 @@ description: 车辆灯光状态定义表。 ::: -| 定义 | 数值 | -| ----------------------------------------------------------------------------------------- | ---- | -| UNKNOWN_VEHICLE_LIGHT_STATUS(未知车辆灯光状态) | 0 | -| VEHICLE_LIGHT_STATUS_NONE(无灯光损坏) | 0 | -| VEHICLE_LIGHT_STATUS_FRONT_LEFT_BROKEN ​**/**​ CARLIGHT_FRONT_LEFT_BROKEN(左前灯损坏) | 1 | -| VEHICLE_LIGHT_STATUS_FRONT_RIGHT_BROKEN ​**/**​ CARLIGHT_FRONT_RIGHT_BROKEN(右前灯损坏) | 4 | -| VEHICLE_LIGHT_STATUS_DRIVER_BROKEN ​**/**​ CARLIGHT_DRIVER_BROKEN(驾驶侧灯光损坏) | 1 | -| VEHICLE_LIGHT_STATUS_PASSENGER_BROKEN ​**/**​ CARLIGHT_PASSENGER_BROKEN(乘客侧灯光损坏) | 4 | -| VEHICLE_LIGHT_STATUS_REAR_BROKEN ​**/**​ CARLIGHT_REAR_BROKEN(后灯损坏) | 64 | +| 定义 | 数值 | +| --------------------------------------------------------------------------------------- | ---- | +| UNKNOWN_VEHICLE_LIGHT_STATUS(未知车辆灯光状态) | 0 | +| VEHICLE_LIGHT_STATUS_NONE(无灯光损坏) | 0 | +| VEHICLE_LIGHT_STATUS_FRONT_LEFT_BROKEN **/** CARLIGHT_FRONT_LEFT_BROKEN(左前灯损坏) | 1 | +| VEHICLE_LIGHT_STATUS_FRONT_RIGHT_BROKEN **/** CARLIGHT_FRONT_RIGHT_BROKEN(右前灯损坏) | 4 | +| VEHICLE_LIGHT_STATUS_DRIVER_BROKEN **/** CARLIGHT_DRIVER_BROKEN(驾驶侧灯光损坏) | 1 | +| VEHICLE_LIGHT_STATUS_PASSENGER_BROKEN **/** CARLIGHT_PASSENGER_BROKEN(乘客侧灯光损坏) | 4 | +| VEHICLE_LIGHT_STATUS_REAR_BROKEN **/** CARLIGHT_REAR_BROKEN(后灯损坏) | 64 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md index e570d198784..d3ab8c20d68 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/resources/vehicle-tire-status.md @@ -10,15 +10,15 @@ description: 车辆轮胎状态定义表。 ::: -| 定义 | 数值 | -| --------------------------------------------------------------------------------------- | ---- | -| UNKNOWN_VEHICLE_TYRE_STATUS(未知车辆轮胎状态) | -1 | -| VEHICLE_TYRE_STATUS_NONE(无轮胎损伤) | 0 | -| VEHICLE_TYRE_STATUS_FRONT_LEFT_POPPED ​**/**​ CARTYRE_FRONT_LEFT_POPPED(左前轮爆胎) | 8 | -| VEHICLE_TYRE_STATUS_FRONT_RIGHT_POPPED ​**/**​ CARTYRE_FRONT_RIGHT_POPPED(右前轮爆胎) | 2 | -| VEHICLE_TYRE_STATUS_REAR_LEFT_POPPED ​**/**​ CARTYRE_REAR_LEFT_POPPED(左后轮爆胎) | 4 | -| VEHICLE_TYRE_STATUS_REAR_RIGHT_POPPED ​**/**​ CARTYRE_REAR_RIGHT_POPPED(右后轮爆胎) | 1 | -| VEHICLE_TIRE_STATUS_FRONT_LEFT_POPPED ​**/**​ CARTIRE_FRONT_LEFT_POPPED(左前轮爆胎) | 8 | -| VEHICLE_TIRE_STATUS_FRONT_RIGHT_POPPED ​**/**​ CARTIRE_FRONT_RIGHT_POPPED(右前轮爆胎) | 2 | -| VEHICLE_TIRE_STATUS_REAR_LEFT_POPPED ​**/**​ CARTIRE_REAR_LEFT_POPPED(左后轮爆胎) | 4 | -| VEHICLE_TIRE_STATUS_REAR_RIGHT_POPPED ​**/**​ CARTIRE_REAR_RIGHT_POPPED(右后轮爆胎) | 1 | +| 定义 | 数值 | +| ------------------------------------------------------------------------------------- | ---- | +| UNKNOWN_VEHICLE_TYRE_STATUS(未知车辆轮胎状态) | -1 | +| VEHICLE_TYRE_STATUS_NONE(无轮胎损伤) | 0 | +| VEHICLE_TYRE_STATUS_FRONT_LEFT_POPPED **/** CARTYRE_FRONT_LEFT_POPPED(左前轮爆胎) | 8 | +| VEHICLE_TYRE_STATUS_FRONT_RIGHT_POPPED **/** CARTYRE_FRONT_RIGHT_POPPED(右前轮爆胎) | 2 | +| VEHICLE_TYRE_STATUS_REAR_LEFT_POPPED **/** CARTYRE_REAR_LEFT_POPPED(左后轮爆胎) | 4 | +| VEHICLE_TYRE_STATUS_REAR_RIGHT_POPPED **/** CARTYRE_REAR_RIGHT_POPPED(右后轮爆胎) | 1 | +| VEHICLE_TIRE_STATUS_FRONT_LEFT_POPPED **/** CARTIRE_FRONT_LEFT_POPPED(左前轮爆胎) | 8 | +| VEHICLE_TIRE_STATUS_FRONT_RIGHT_POPPED **/** CARTIRE_FRONT_RIGHT_POPPED(右前轮爆胎) | 2 | +| VEHICLE_TIRE_STATUS_REAR_LEFT_POPPED **/** CARTIRE_REAR_LEFT_POPPED(左后轮爆胎) | 4 | +| VEHICLE_TIRE_STATUS_REAR_RIGHT_POPPED **/** CARTIRE_REAR_RIGHT_POPPED(右后轮爆胎) | 1 | diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md index b1a499382be..710a348e41e 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/stringmanipulation.md @@ -745,8 +745,8 @@ ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "注意", "{"COL_GREEN"}你 | ------------------------------ | ------ | | \~r\~\~h\~ | 亮红色 | | \~r\~\~h\~\~h\~ | 粉红色 | -| \~r\~\~h\~\~h~\~h\~ | 暗红色 | -| \~r\~\~h\~~h~~h~~h\~ | 亮粉色 | +| \~r\~\~h\~\~h\~\~h\~ | 暗红色 | +| \~r\~\~h\~\~h\~\~h\~\~h\~ | 亮粉色 | | \~r\~\~h\~\~h\~\~h\~\~h\~\~h\~ | 粉色 | | \~g\~\~h\~ | 亮绿色 |