From e5b317e54c426705abd10bd23d892874e6627cec Mon Sep 17 00:00:00 2001 From: Aldrin John Olaer Manalansan <39627255+Aldrin-John-Olaer-Manalansan@users.noreply.github.com> Date: Sun, 2 Mar 2025 18:27:08 +0800 Subject: [PATCH] :memo: update commands --- sa/enums.json | 14 +- sa/sa.json | 294 +++++++++++++++++++-------------- sa/snippets/SAMPFUNCS/0B5D.txt | 2 + sa/snippets/SAMPFUNCS/0B5E.txt | 1 + sa/snippets/SAMPFUNCS/0B5F.txt | 2 + sa/snippets/SAMPFUNCS/0B60.txt | 1 + sa/snippets/SAMPFUNCS/0B61.txt | 4 + sa/snippets/SAMPFUNCS/0B62.txt | 7 + sa/snippets/SAMPFUNCS/0B63.txt | 1 + sa/snippets/SAMPFUNCS/0B64.txt | 4 + sa/snippets/SAMPFUNCS/0B65.txt | 7 + sa/snippets/SAMPFUNCS/0B66.txt | 2 + sa/snippets/SAMPFUNCS/0B67.txt | 2 + sa/snippets/SAMPFUNCS/0B69.txt | 1 + sa/snippets/SAMPFUNCS/0B6A.txt | 1 + sa/snippets/SAMPFUNCS/0B8C.txt | 4 + sa/snippets/SAMPFUNCS/0B8D.txt | 1 + sa/snippets/SAMPFUNCS/0B8E.txt | 1 + sa/version.txt | 2 +- 19 files changed, 217 insertions(+), 134 deletions(-) create mode 100644 sa/snippets/SAMPFUNCS/0B5D.txt create mode 100644 sa/snippets/SAMPFUNCS/0B5E.txt create mode 100644 sa/snippets/SAMPFUNCS/0B5F.txt create mode 100644 sa/snippets/SAMPFUNCS/0B60.txt create mode 100644 sa/snippets/SAMPFUNCS/0B61.txt create mode 100644 sa/snippets/SAMPFUNCS/0B62.txt create mode 100644 sa/snippets/SAMPFUNCS/0B63.txt create mode 100644 sa/snippets/SAMPFUNCS/0B64.txt create mode 100644 sa/snippets/SAMPFUNCS/0B65.txt create mode 100644 sa/snippets/SAMPFUNCS/0B66.txt create mode 100644 sa/snippets/SAMPFUNCS/0B67.txt create mode 100644 sa/snippets/SAMPFUNCS/0B69.txt create mode 100644 sa/snippets/SAMPFUNCS/0B6A.txt create mode 100644 sa/snippets/SAMPFUNCS/0B8C.txt create mode 100644 sa/snippets/SAMPFUNCS/0B8D.txt create mode 100644 sa/snippets/SAMPFUNCS/0B8E.txt diff --git a/sa/enums.json b/sa/enums.json index 51b3ff99..2fdcaadd 100644 --- a/sa/enums.json +++ b/sa/enums.json @@ -3853,13 +3853,6 @@ "Tablist": null, "TablistHeaders": null }, - "SampCursorModes": { - "Disabled": null, - "LockkeysNocursor": null, - "LockCamAndControl": null, - "LockCam": null, - "LockCamNoCursor": null - }, "SampRakNetHookParam": { "Bitstream": null, "Packetid": null, @@ -3887,5 +3880,12 @@ "Short": 2, "Int": 4, "Float": 4 + }, + "SampCursorMode": { + "Disabled": null, + "LockkeysNocursor": null, + "LockCamAndControl": null, + "LockCam": null, + "LockCamNoCursor": null } } \ No newline at end of file diff --git a/sa/sa.json b/sa/sa.json index a2ccbc2f..bea18d06 100644 --- a/sa/sa.json +++ b/sa/sa.json @@ -1,7 +1,7 @@ { "meta": { - "last_update": 1740773262767, - "version": "0.869", + "last_update": 1740911072455, + "version": "0.870", "url": "https://library.sannybuilder.com/#/sa" }, "extensions": [ @@ -61208,76 +61208,90 @@ "short_desc": "Evaluates as logical true if the specified player is in paused state (or AFK)" }, { - "id": "0B5D", - "name": "SAMP_TOGGLE_CURSOR", - "num_params": 1, "input": [ { - "name": "_p1", - "type": "int" + "name": "isvisible", + "type": "bool" } - ] + ], + "id": "0B5D", + "name": "SAMP_SET_CURSOR_VISIBILITY", + "num_params": 1, + "short_desc": "Sets the visibility status of mouse cursor" }, { - "id": "0B5E", - "name": "SAMP_GET_CURSOR_POS", - "num_params": 2, - "input": [ + "output": [ { - "name": "_p1", - "type": "int" + "name": "windowscreencoordx", + "type": "int", + "source": "var_any" }, { - "name": "_p2", - "type": "int" + "name": "windowscreencoordy", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B5E", + "name": "SF_GET_CURSOR_COORD", + "num_params": 2, + "short_desc": "Returns the mouse cursor's window screen coordinates in pixels" }, { "input": [ { - "name": "_p1", + "name": "windowscreencoordx", "type": "int" }, { - "name": "_p2", + "name": "windowscreencoordy", "type": "int" - }, + } + ], + "output": [ { - "name": "_p3", - "type": "int" + "name": "gamescreencoordx", + "type": "float", + "source": "var_any" }, { - "name": "_p4", - "type": "int" + "name": "gamescreencoordy", + "type": "float", + "source": "var_any" } ], "id": "0B5F", - "name": "SAMP_CONVERT_WINDOW_SCREEN_COORDS_TO_GAME_SCREEN_COORDS", - "num_params": 4 + "name": "SF_CONVERT_WINDOW_SCREEN_COORDS_TO_GAME_SCREEN_COORDS", + "num_params": 4, + "short_desc": "Returns the GameScreen Coordinates counterpart of the specified WindowScreen Coordinates" }, { - "id": "0B60", - "name": "SAMP_CONVERT_GAME_SCREEN_COORDS_TO_WINDOW", - "num_params": 4, "input": [ { - "name": "_p1", - "type": "int" + "name": "gamescreencoordx", + "type": "float" }, { - "name": "_p2", - "type": "int" - }, + "name": "gamescreencoordy", + "type": "float" + } + ], + "output": [ { - "name": "_p3", - "type": "int" + "name": "windowscreencoordx", + "type": "int", + "source": "var_any" }, { - "name": "_p4", - "type": "int" + "name": "windowscreencoordy", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B60", + "name": "SF_CONVERT_GAME_SCREEN_COORDS_TO_WINDOW_SCREEN_COORDS", + "num_params": 4, + "short_desc": "Returns the WindowScreen Coordinates counterpart of the specified GameScreen Coordinates" }, { "id": "0B61", @@ -61285,125 +61299,147 @@ "num_params": 0, "attrs": { "is_condition": true - } + }, + "short_desc": "Evaluates as logical true if our local player has been spawned already" }, { + "input": [ + { + "name": "playerid", + "type": "int" + } + ], + "output": [ + { + "name": "specialactionid", + "type": "SampSpecialAction", + "source": "var_any" + } + ], "id": "0B62", "name": "SAMP_GET_PLAYER_SPECIAL_ACTION", "num_params": 2, "attrs": { "is_condition": true }, + "short_desc": "Returns the special action ID of the specified player" + }, + { "input": [ { - "name": "_p1", - "type": "int" - }, - { - "name": "_p2", - "type": "int" + "name": "chatcommand", + "type": "string" } - ] - }, - { + ], "id": "0B63", - "name": "SAMP_UNREGISTER_CLIENT_COMMAND", + "name": "SAMP_UNREGISTER_CLIENT_SIDED_COMMAND", "num_params": 1, "attrs": { "is_condition": true }, + "short_desc": "Removes all callbacks hooked from a client sided chat command created by Opcode 0B63, suppressing all its callback's operation " + }, + { "input": [ { - "name": "_p1", + "name": "playerid", "type": "int" } - ] - }, - { + ], "id": "0B64", "name": "SAMP_IS_PLAYER_NPC", "num_params": 1, "attrs": { "is_condition": true }, + "short_desc": "Checks if the specified player is an NPC" + }, + { "input": [ { - "name": "_p1", + "name": "playerid", "type": "int" } - ] - }, - { + ], + "output": [ + { + "name": "score", + "type": "int", + "source": "var_any" + } + ], "id": "0B65", "name": "SAMP_GET_PLAYER_SCORE", "num_params": 2, "attrs": { "is_condition": true }, - "input": [ - { - "name": "_p1", - "type": "int" - }, - { - "name": "_p2", - "type": "int" - } - ] + "short_desc": "Returns the current score of the specified player" }, { - "id": "0B66", - "name": "SAMP_FROM_ARGB", - "num_params": 5, "input": [ { - "name": "_p1", + "name": "color", "type": "int" - }, + } + ], + "output": [ { - "name": "_p2", - "type": "int" + "name": "alpha", + "type": "int", + "source": "var_any" }, { - "name": "_p3", - "type": "int" + "name": "red", + "type": "int", + "source": "var_any" }, { - "name": "_p4", - "type": "int" + "name": "green", + "type": "int", + "source": "var_any" }, { - "name": "_p5", - "type": "int" + "name": "blue", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B66", + "name": "SF_HEX_TO_ARGB", + "num_params": 5, + "short_desc": "Splits 0xAARRGGBB colorcode format into individial color channels" }, { - "id": "0B67", - "name": "SAMP_TO_ARGB", - "num_params": 5, "input": [ { - "name": "_p1", + "name": "alpha", "type": "int" }, { - "name": "_p2", + "name": "red", "type": "int" }, { - "name": "_p3", + "name": "green", "type": "int" }, { - "name": "_p4", + "name": "blue", "type": "int" - }, + } + ], + "output": [ { - "name": "_p5", - "type": "int" + "name": "color", + "type": "int", + "source": "var_any" } - ] + ], + "id": "0B67", + "name": "SAMP_ARGB_TO_HEX", + "num_params": 5, + "short_desc": "mixes color channels into 0xAARRGGBB colorcode format" }, { "input": [ @@ -61438,66 +61474,68 @@ "short_desc": "Draws a line between two window screen coordinates" }, { - "id": "0B69", - "name": "SAMP_RENDER_DRAW_BOX", - "num_params": 5, "input": [ { - "name": "_p1", + "name": "coordx", "type": "int" }, { - "name": "_p2", + "name": "coordy", "type": "int" }, { - "name": "_p3", + "name": "width", "type": "int" }, { - "name": "_p4", + "name": "height", "type": "int" }, { - "name": "_p5", + "name": "color", "type": "int" } - ] + ], + "id": "0B69", + "name": "SF_RENDER_DRAW_BOX_NO_BORDER", + "num_params": 5, + "short_desc": "Draws a rectangular area at the specified coordinates" }, { - "id": "0B6A", - "name": "SAMP_RENDER_DRAW_BOX_WITH_BORDER", - "num_params": 7, "input": [ { - "name": "_p1", + "name": "coordx", "type": "int" }, { - "name": "_p2", + "name": "coordy", "type": "int" }, { - "name": "_p3", + "name": "width", "type": "int" }, { - "name": "_p4", + "name": "height", "type": "int" }, { - "name": "_p5", + "name": "color", "type": "int" }, { - "name": "_p6", + "name": "bordersize", "type": "int" }, { - "name": "_p7", + "name": "bordercolor", "type": "int" } - ] + ], + "id": "0B6A", + "name": "SF_RENDER_DRAW_BOX_WITH_BORDER", + "num_params": 7, + "short_desc": "Draws a rectangular area with border at the specified coordinates" }, { "id": "0B6B", @@ -62175,32 +62213,36 @@ "num_params": 0, "attrs": { "is_condition": true - } + }, + "short_desc": "Checks if the mouse cursor is visible" }, { - "id": "0B8D", - "name": "SAMP_SET_CURSOR_MODE", - "num_params": 1, "input": [ { - "name": "_p1", - "type": "int" + "name": "mode", + "type": "SampCursorMode" } - ] + ], + "id": "0B8D", + "name": "SAMP_SET_CURSOR_MODE", + "num_params": 1, + "short_desc": "Sets the cursor mode" }, { + "output": [ + { + "name": "mode", + "type": "SampCursorMode", + "source": "var_any" + } + ], "id": "0B8E", "name": "SAMP_GET_CURSOR_MODE", "num_params": 1, "attrs": { "is_condition": true }, - "input": [ - { - "name": "_p1", - "type": "int" - } - ] + "short_desc": "Returns the current mouse cursor mode" }, { "id": "0B8F", diff --git a/sa/snippets/SAMPFUNCS/0B5D.txt b/sa/snippets/SAMPFUNCS/0B5D.txt new file mode 100644 index 00000000..a51404ad --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B5D.txt @@ -0,0 +1,2 @@ +SAMP_SET_CURSOR_VISIBILITY true // show the mouse cursor +SAMP_SET_CURSOR_VISIBILITY false // hide the mouse cursor \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B5E.txt b/sa/snippets/SAMPFUNCS/0B5E.txt new file mode 100644 index 00000000..6905dabc --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B5E.txt @@ -0,0 +1 @@ +int coordX,coordY = SF_GET_CURSOR_COORD \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B5F.txt b/sa/snippets/SAMPFUNCS/0B5F.txt new file mode 100644 index 00000000..4326e2f6 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B5F.txt @@ -0,0 +1,2 @@ +int myWindowScreenCoordX, myWindowScreenCoordY = SF_GET_SCREEN_RESOLUTION +float myGameScreenCoordX, myGameScreenCoordY = SF_CONVERT_WINDOW_SCREEN_COORDS_TO_GAME_SCREEN_COORDS {windowscreencoordx} myWindowScreenCoordX {windowscreencoordy} myWindowScreenCoordY \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B60.txt b/sa/snippets/SAMPFUNCS/0B60.txt new file mode 100644 index 00000000..ff978171 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B60.txt @@ -0,0 +1 @@ +int myWindowScreenCoordX, myWindowScreenCoordY = SF_CONVERT_GAME_SCREEN_COORDS_TO_WINDOW_SCREEN_COORDS {gamescreencoordx} 315.19 {gamescreencoordy} 98.89 \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B61.txt b/sa/snippets/SAMPFUNCS/0B61.txt new file mode 100644 index 00000000..6da2544e --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B61.txt @@ -0,0 +1,4 @@ +if SAMP_IS_LOCAL_PLAYER_SPAWNED +then // our local player had spawned already +else // our local player hasn't spawned yet +end \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B62.txt b/sa/snippets/SAMPFUNCS/0B62.txt new file mode 100644 index 00000000..6f8fbbb4 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B62.txt @@ -0,0 +1,7 @@ +int mySpecialAction +int myPlayerID = SAMP_GET_PLAYER_ID $scplayer +if mySpecialAction = SAMP_GET_PLAYER_SPECIAL_ACTION myPlayerID +then + // do something to mySpecialAction +else // myPlayerID is not connected +end \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B63.txt b/sa/snippets/SAMPFUNCS/0B63.txt new file mode 100644 index 00000000..ce652e74 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B63.txt @@ -0,0 +1 @@ +SAMP_UNREGISTER_CLIENT_SIDED_COMMAND {chatcommand} "greedisgood" \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B64.txt b/sa/snippets/SAMPFUNCS/0B64.txt new file mode 100644 index 00000000..e823f9c9 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B64.txt @@ -0,0 +1,4 @@ +if SAMP_IS_PLAYER_NPC {playerid} 17 +then // player 17 is an NPC +else // player 17 is not an NPC +end \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B65.txt b/sa/snippets/SAMPFUNCS/0B65.txt new file mode 100644 index 00000000..ba7a6ae6 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B65.txt @@ -0,0 +1,7 @@ +int mySpecialAction +int myPlayerID = SAMP_GET_PLAYER_ID $scplayer +if myScore = SAMP_GET_PLAYER_SCORE myPlayerID +then + // do something to myScore +else // myPlayerID is not connected +end \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B66.txt b/sa/snippets/SAMPFUNCS/0B66.txt new file mode 100644 index 00000000..6fa78a16 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B66.txt @@ -0,0 +1,2 @@ +int a, r, g, b = SF_HEX_TO_ARGB {color} 0xFF00FF37 +// expected: a = 0xFF, r = 0x00, g = 0xFF, b = 0x37 \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B67.txt b/sa/snippets/SAMPFUNCS/0B67.txt new file mode 100644 index 00000000..22e586d4 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B67.txt @@ -0,0 +1,2 @@ +int colorCode = SAMP_ARGB_TO_HEX {alpha} 0xFF {red} 0x5A {green} 0x14 {blue} 0xCA +// expected: colorCode = 0xFF5A14CA \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B69.txt b/sa/snippets/SAMPFUNCS/0B69.txt new file mode 100644 index 00000000..3a1a9195 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B69.txt @@ -0,0 +1 @@ +SF_RENDER_DRAW_BOX_NO_BORDER {coordx} 10 {coordy} 300 {width} 600 {height} 400 {color} 0xFFFF7F00 // create orange rectangle \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B6A.txt b/sa/snippets/SAMPFUNCS/0B6A.txt new file mode 100644 index 00000000..9492cc05 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B6A.txt @@ -0,0 +1 @@ +SF_RENDER_DRAW_BOX_WITH_BORDER {coordx} 10 {coordy} 300 {width} 600 {height} 400 {color} 0xFFFF7F00 {bordersize} 10 {bordercolor} 0xFFFF00FF // create orange rectangle with purple border \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B8C.txt b/sa/snippets/SAMPFUNCS/0B8C.txt new file mode 100644 index 00000000..6439bdf5 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B8C.txt @@ -0,0 +1,4 @@ +if SAMP_IS_CURSOR_ACTIVE +then // mouse cursor is visible +else // mouse cursor is hidden +end \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B8D.txt b/sa/snippets/SAMPFUNCS/0B8D.txt new file mode 100644 index 00000000..a7c0f790 --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B8D.txt @@ -0,0 +1 @@ +SAMP_SET_CURSOR_MODE SampCursorMode.LockCamAndControl // Enables the Mouse Cursor \ No newline at end of file diff --git a/sa/snippets/SAMPFUNCS/0B8E.txt b/sa/snippets/SAMPFUNCS/0B8E.txt new file mode 100644 index 00000000..a5fa3f1d --- /dev/null +++ b/sa/snippets/SAMPFUNCS/0B8E.txt @@ -0,0 +1 @@ +int cursorMode = SAMP_GET_CURSOR_MODE \ No newline at end of file diff --git a/sa/version.txt b/sa/version.txt index 0f10d236..165b894a 100644 --- a/sa/version.txt +++ b/sa/version.txt @@ -1 +1 @@ -0.869 \ No newline at end of file +0.870 \ No newline at end of file