diff --git a/functions/Camera/fadeCamera.yaml b/functions/Camera/fadeCamera.yaml index 20c5460a..e374a8ff 100644 --- a/functions/Camera/fadeCamera.yaml +++ b/functions/Camera/fadeCamera.yaml @@ -1,4 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FadeCamera +client: + name: fadeCamera + description: This function will fade a player's camera to a color or back to normal + over a specified time period. This will also affect the sound volume for the player + (50% faded \= 50% volume, full fade \= no sound). For clientside scripts you can + perform 2 fade ins or fade outs in a row, but for serverside scripts you must + use one then the other. + parameters: + - name: fadeIn + type: bool + description: Should the camera be faded in our out? Pass true to fade the camera + in, false to fade it out to a color. + - name: timeToFade + type: float + description: The number of seconds it should take to fade. + default: '1.0' + - name: red + type: int + description: The amount of red in the color that the camera fades out to (0 - + 255). Not required for fading in. + default: '0' + - name: green + type: int + description: The amount of green in the color that the camera fades out to (0 + - 255). Not required for fading in. + default: '0' + - name: blue + type: int + description: The amount of blue in the color that the camera fades out to (0 - + 255). Not required for fading in. + default: '0' + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the camera was faded successfully, false if invalid + arguments were passed to the function. + oop: &id001 + element: player + method: fadeCamera + static: false + notes: &id002 + - type: info + content: The speed of the effect depends directly on the current gamespeed. + requires_review: true server: name: fadeCamera description: This function will fade a player's camera to a color or back to normal @@ -6,13 +52,44 @@ server: (50% faded \= 50% volume, full fade \= no sound). For clientside scripts you can perform 2 fade ins or fade outs in a row, but for serverside scripts you must use one then the other. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose camera you wish to fade. + - name: fadeIn + type: bool + description: Should the camera be faded in or out? Pass true to fade the camera + in, false to fade it out to a color. + - name: timeToFade + type: float + description: The number of seconds it should take to fade. + default: '1.0' + - name: red + type: int + description: The amount of red in the color that the camera fades out to (0 - + 255). Not required for fading in. + default: '0' + - name: green + type: int + description: The amount of green in the color that the camera fades out to (0 + - 255). Not required for fading in. + default: '0' + - name: blue + type: int + description: The amount of blue in the color that the camera fades out to (0 - + 255). Not required for fading in. + default: '0' examples: - path: examples/fadeCamera-1.lua description: When a player gets damaged, place a quick fade-to-red effect on his screen. side: server - notes: - - type: info - content: The speed of the effect depends directly on the current gamespeed. - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the camera was faded successfully, false if invalid + arguments were passed to the function. + oop: *id001 + notes: *id002 + requires_review: true diff --git a/functions/Camera/getCamera.yaml b/functions/Camera/getCamera.yaml index 7c96cc82..db0d17ea 100644 --- a/functions/Camera/getCamera.yaml +++ b/functions/Camera/getCamera.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCamera -client: +shared: name: getCamera description: This function returns an [element](/wiki/Element "Element") that corresponds to the game camera @@ -8,6 +8,11 @@ client: - path: examples/getCamera-1.lua description: This example attaches (fixes) the camera to a vehicle. side: client + returns: + values: + - type: element + name: value + description: Returns an element that corresponds to the game camera notes: - type: info content: Using attachElements with the camera and the main player can interfere @@ -15,4 +20,4 @@ client: - type: info content: Using setElementPosition/Rotation/Matrix on the camera element will automatically clear any target set with setCameraTarget - incomplete: true + requires_review: true diff --git a/functions/Camera/getCameraClip.yaml b/functions/Camera/getCameraClip.yaml index 5487bee6..5546f277 100644 --- a/functions/Camera/getCameraClip.yaml +++ b/functions/Camera/getCameraClip.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraClip -client: +shared: name: getCameraClip description: This function checks if the camera will "collide" with any objects or vehicles in its way. Read more about this [here](/wiki/SetCameraClip "SetCameraClip"). @@ -8,5 +8,16 @@ client: - path: examples/getCameraClip-1.lua description: This function checks the clip status. side: client + returns: + values: + - type: bool + name: value1 + - type: bool + name: value2 + description: This function checks the clip status. + oop: + element: Camera + method: ) + static: true pair: setCameraClip - incomplete: true + requires_review: true diff --git a/functions/Camera/getCameraDrunkLevel.yaml b/functions/Camera/getCameraDrunkLevel.yaml index 33be2130..0343d0e4 100644 --- a/functions/Camera/getCameraDrunkLevel.yaml +++ b/functions/Camera/getCameraDrunkLevel.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraDrunkLevel -client: +shared: name: getCameraDrunkLevel description: This function gets the camera drunk level set by [setCameraDrunkLevel](/wiki/SetCameraDrunkLevel "SetCameraDrunkLevel"). This function was renamed from [getCameraShakeLevel](/wiki/GetCameraShakeLevel @@ -10,4 +10,13 @@ client: description: This example checks for changes in the camera drunk level of any player every frame and outputs different messages according to it. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer representing the camera drunk level, from 0 (no + drunk effect) to 255 (maximum drunk effect). By default, the camera has no drunk + effect. Drunk effect is a wavy motion of the camera depicting the player being + drunk. This function used to be called getCameraShakeLevel which has since been + deprecated. + requires_review: true diff --git a/functions/Camera/getCameraFieldOfView.yaml b/functions/Camera/getCameraFieldOfView.yaml index ea225e14..221f5246 100644 --- a/functions/Camera/getCameraFieldOfView.yaml +++ b/functions/Camera/getCameraFieldOfView.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraFieldOfView -client: +shared: name: getCameraFieldOfView description: This function returns the field of view of the *dynamic camera* as set by [setCameraFieldOfView](/wiki/SetCameraFieldOfView "SetCameraFieldOfView"). - parameters: [] + parameters: + - name: cameraMode + type: string + description: 'the camera mode to get the field of view of: "player": whilst walking/running + "vehicle": whilst in vehicle "vehicle_max": the max the field of view can go + to when the vehicle is moving at a high speed (must be higher than "vehicle")' examples: - path: examples/getCameraFieldOfView-1.lua description: In this example, the field of view is output to the chat whenever the /getfov command is written side: client + returns: + values: + - type: float + name: value + description: Returns one float - the field of view angle + oop: + element: Camera + method: getFieldOfView + variable: fov + static: true pair: setCameraFieldOfView - incomplete: true + requires_review: true diff --git a/functions/Camera/getCameraGoggleEffect.yaml b/functions/Camera/getCameraGoggleEffect.yaml index 75c22de8..17024ca1 100644 --- a/functions/Camera/getCameraGoggleEffect.yaml +++ b/functions/Camera/getCameraGoggleEffect.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraGoggleEffect -client: +shared: name: getCameraGoggleEffect description: This function returns what goggle effect is currently affecting the camera. @@ -9,5 +9,16 @@ client: description: This example adds a command to enable or disable the nightvision effect. side: client + returns: + values: + - type: string + name: value + description: This example adds a command to enable or disable the nightvision + effect. + oop: + element: Camera + method: getGoggleEffect + variable: goggleEffect + static: true pair: setCameraGoggleEffect - incomplete: true + requires_review: true diff --git a/functions/Camera/getCameraInterior.yaml b/functions/Camera/getCameraInterior.yaml index 68251b37..c03a9199 100644 --- a/functions/Camera/getCameraInterior.yaml +++ b/functions/Camera/getCameraInterior.yaml @@ -8,8 +8,12 @@ server: - path: examples/getCameraInterior-1.lua description: '' side: server + oop: + element: player + method: getCameraInterior + variable: cameraInterior + static: false pair: setCameraInterior - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -19,3 +23,4 @@ server: - Missing section: Object-oriented ' + requires_review: true diff --git a/functions/Camera/getCameraTarget.yaml b/functions/Camera/getCameraTarget.yaml index 3eaa0913..7945080a 100644 --- a/functions/Camera/getCameraTarget.yaml +++ b/functions/Camera/getCameraTarget.yaml @@ -1,12 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraTarget -server: +client: name: getCameraTarget description: This function returns an [element](/wiki/Element "Element") that corresponds to the current target of the specified player's camera (i.e. what it is following). parameters: [] + examples: [] + returns: + values: + - type: element + name: value + description: This example checks whether a player's camera's target is another + player, and returns true or false accordingly. + oop: &id001 + element: player + method: getCameraTarget + variable: cameraTarget + static: false + pair: setCameraTarget + requires_review: true +server: + name: getCameraTarget + description: This function returns an [element](/wiki/Element "Element") that corresponds + to the current target of the specified player's camera (i.e. what it is following). + parameters: + - name: thePlayer + type: player + description: The player whose camera you wish to receive the target of. examples: - path: examples/getCameraTarget-1.lua description: '' side: server + returns: + values: + - type: element + name: value + description: This example checks whether a player's camera's target is another + player, and returns true or false accordingly. + oop: *id001 pair: setCameraTarget - incomplete: true + requires_review: true diff --git a/functions/Camera/getCameraViewMode.yaml b/functions/Camera/getCameraViewMode.yaml index 1889af5f..74963bac 100644 --- a/functions/Camera/getCameraViewMode.yaml +++ b/functions/Camera/getCameraViewMode.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCameraViewMode -client: +shared: name: getCameraViewMode description: This function allows you to get the active camera view modes. This indicates at what distance the camera will follow the player or vehicle. @@ -9,5 +9,18 @@ client: description: This example tells the player their current camera view when they change it side: client + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns two ints indicating the current vehicle and ped camera view + mode respectively. Their meanings can be seen below. + oop: + element: Camera + method: getCameraViewMode + variable: viewMode + static: true pair: setCameraViewMode - incomplete: true + requires_review: true diff --git a/functions/Camera/resetShakeCamera.yaml b/functions/Camera/resetShakeCamera.yaml index 9d5d8139..6fc535fc 100644 --- a/functions/Camera/resetShakeCamera.yaml +++ b/functions/Camera/resetShakeCamera.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetShakeCamera -client: +shared: name: resetShakeCamera description: This function cancels the shaking effect caused by **shakeCamera** parameters: [] @@ -8,4 +8,9 @@ client: description: This example allows you to trigger huge camera shake effect near you and then cancels the effect after 5 seconds. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/Camera/setCameraClip.yaml b/functions/Camera/setCameraClip.yaml index 02939828..d809c788 100644 --- a/functions/Camera/setCameraClip.yaml +++ b/functions/Camera/setCameraClip.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraClip -client: +shared: name: setCameraClip description: This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that. - parameters: [] + parameters: + - name: objects + type: bool + description: Sets if you want the camera to clip on objects. + default: 'true' + - name: vehicles + type: bool + description: Sets if you want the camera to clip on vehicles. + default: 'true' examples: - path: examples/setCameraClip-1.lua description: This function enables it to look through cars side: client + returns: + values: + - type: bool + name: value + description: Always returns true . + oop: + element: Camera + method: ) + static: true pair: getCameraClip - incomplete: true + requires_review: true diff --git a/functions/Camera/setCameraDrunkLevel.yaml b/functions/Camera/setCameraDrunkLevel.yaml index 2548a467..c952bfdc 100644 --- a/functions/Camera/setCameraDrunkLevel.yaml +++ b/functions/Camera/setCameraDrunkLevel.yaml @@ -1,13 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraDrunkLevel -client: +shared: name: setCameraDrunkLevel description: Drunk effect is a wavy motion of the camera depicting the player being drunk. This function used to be called [setCameraShakeLevel](/wiki/SetCameraShakeLevel "SetCameraShakeLevel") which has since been deprecated. - parameters: [] + parameters: + - name: shakeLevel + type: int + description: MISSING_PARAM_DESC examples: - path: examples/setCameraDrunkLevel-1.lua description: This example adds a/camdrunkcommand which allows any player to manually change its camera drunk level. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the camera drunk level was changed, false if the + required argument is incorrect or missing. + requires_review: true diff --git a/functions/Camera/setCameraFieldOfView.yaml b/functions/Camera/setCameraFieldOfView.yaml index bbfc5b58..84895424 100644 --- a/functions/Camera/setCameraFieldOfView.yaml +++ b/functions/Camera/setCameraFieldOfView.yaml @@ -1,16 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraFieldOfView -client: +shared: name: setCameraFieldOfView description: This function sets the field of view of the *dynamic camera* \- this is the field of view of the *non\-fixed camera* \- yes, the camera that the user can control whilst on foot or in a vehicle. The higher the field of view angle, the more you will be able to see to your sides. - parameters: [] + parameters: + - name: cameraMode + type: string + description: 'the camera mode to set the field of view of: "player": whilst walking/running + "vehicle": whilst in vehicle "vehicle_max": the max the field of view can go + to when the vehicle is moving at a high speed (must be higher than "vehicle" + | the normal difference between "vehicle" and "vehicle_max" is 10)' + - name: fieldOfView + type: float + description: The field of view angle, 0 to 179. + - name: instant + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setCameraFieldOfView-1.lua description: In this example, the field of view for 'player walking/running' camera is set to 20, once resource fully starts. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the arguments are valid, false otherwise. + oop: + element: Camera + method: setFieldOfView + static: true pair: getCameraFieldOfView notes: - type: info @@ -19,4 +41,4 @@ client: - type: info content: 'It doesn''t affect the FOV for the following camera modes: 1) Player aiming 2) Vehicle front bumper camera 3) Fixed camera' - incomplete: true + requires_review: true diff --git a/functions/Camera/setCameraGoggleEffect.yaml b/functions/Camera/setCameraGoggleEffect.yaml index 4a66b0f8..f9a1b64d 100644 --- a/functions/Camera/setCameraGoggleEffect.yaml +++ b/functions/Camera/setCameraGoggleEffect.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraGoggleEffect -client: +shared: name: setCameraGoggleEffect description: This function allows you to set the camera's current goggle effect. This means you can activate nightvision or infrared effects by script - parameters: [] + parameters: + - name: goggleEffect + type: string + description: the goggle effect you wish to set + - name: noiseEnabled + type: bool + description: MISSING_PARAM_DESC + default: 'true' examples: - path: examples/setCameraGoggleEffect-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: true if the effect was set correctly. false otherwise. + oop: + element: Camera + method: setGoggleEffect + variable: goggleEffect + static: true pair: getCameraGoggleEffect - incomplete: true + requires_review: true diff --git a/functions/Camera/setCameraInterior.yaml b/functions/Camera/setCameraInterior.yaml index b56687b0..a68fa558 100644 --- a/functions/Camera/setCameraInterior.yaml +++ b/functions/Camera/setCameraInterior.yaml @@ -1,17 +1,52 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraInterior +client: + name: setCameraInterior + description: Sets the interior of the local camera. Only the interior of the camera + is changed, the local player stays in the interior he was in. + parameters: + - name: interior + type: int + description: the interior to place the camera in. + examples: + - path: examples/setCameraInterior-2.lua + description: This example make a command to change your cam interior to a selected + one. + side: client + returns: + values: + - type: bool + name: value + description: Returns true if the camera's interior was changed successfully, false + otherwise. + oop: &id001 + element: player + method: setCameraInterior + variable: cameraInterior + static: false + pair: getCameraInterior + requires_review: true server: name: setCameraInterior description: Sets the interior of the local camera. Only the interior of the camera is changed, the local player stays in the interior he was in. - parameters: [] + parameters: + - name: thePlayer + type: player + description: the player whose camera interior will be set. + - name: interior + type: int + description: the interior to place the camera in. examples: - path: examples/setCameraInterior-1.lua description: This example make a command to change your cam interior to a selected one. side: server - - path: examples/setCameraInterior-2.lua - description: This example make a command to change your cam interior to a selected - one. - side: client + returns: + values: + - type: bool + name: value + description: Returns true if the camera's interior was changed successfully, false + otherwise. + oop: *id001 pair: getCameraInterior - incomplete: true + requires_review: true diff --git a/functions/Camera/setCameraTarget.yaml b/functions/Camera/setCameraTarget.yaml index 0c293f3d..8b5b14d6 100644 --- a/functions/Camera/setCameraTarget.yaml +++ b/functions/Camera/setCameraTarget.yaml @@ -1,12 +1,53 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraTarget -server: +client: name: setCameraTarget description: 'This function allows you to set a player''s camera to follow other elements instead. Currently supported element type is:' - parameters: [] + parameters: + - name: targetX + type: float + description: MISSING_PARAM_DESC + - name: targetY + type: float + description: MISSING_PARAM_DESC + - name: targetZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setCameraTarget-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: &id001 + element: player + method: setCameraTarget + variable: cameraTarget + static: false + pair: getCameraTarget + requires_review: true +server: + name: setCameraTarget + description: 'This function allows you to set a player''s camera to follow other + elements instead. Currently supported element type is:' + parameters: + - name: thePlayer + type: player + description: The player whose camera you wish to modify. + - name: target + type: element + description: The element who you want the camera to follow. If none is specified, + the camera will target the player. + default: nil + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: *id001 pair: getCameraTarget - incomplete: true + requires_review: true diff --git a/functions/Camera/setCameraViewMode.yaml b/functions/Camera/setCameraViewMode.yaml index 60e6b82b..3ebc9cec 100644 --- a/functions/Camera/setCameraViewMode.yaml +++ b/functions/Camera/setCameraViewMode.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCameraViewMode -client: +shared: name: setCameraViewMode description: This function allows you to set the camera view modes. This indicates at what distance the camera will follow the player or vehicle. - parameters: [] + parameters: + - name: vehicleCameraMode + type: int + description: The view mode you wish to use when inside vehicles. + - name: pedCameraMode + type: int + description: The view mode you wish to use when you are not inside vehicles. examples: - path: examples/setCameraViewMode-1.lua description: This example sets the camera to bumper view when the local player enters any vehicle. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the view(s) were set correctly, false otherwise. + oop: + element: Camera + method: setCameraViewMode + variable: viewMode + static: true pair: getCameraViewMode - incomplete: true + requires_review: true diff --git a/functions/Camera/shakeCamera.yaml b/functions/Camera/shakeCamera.yaml index 7c1035af..8f02e8ea 100644 --- a/functions/Camera/shakeCamera.yaml +++ b/functions/Camera/shakeCamera.yaml @@ -1,17 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ShakeCamera -client: +shared: name: shakeCamera description: This function allows you to trigger camera shake effect (just like explosion does). - parameters: [] + parameters: + - name: force + type: float + description: Intensity and time of the shake. The higher the value, the longer + the camera shakes + - name: x + type: float + description: Center X coordinate of the shake. + - name: "y" + type: float + description: Center Y coordinate of the shake. + - name: z + type: float + description: Center Z coordinate of the shake. examples: - path: examples/shakeCamera-1.lua description: This example allows you to constantly trigger camera shake effect in center of the map, the closer you are to center the stronger effect will be. side: client + returns: + values: + - type: bool + name: value + description: Always returns true . notes: - type: info content: The camera shaking duration depends on the force. High values ​​can result in very long durations - incomplete: true + requires_review: true diff --git a/functions/Clothes_and_body/addClothingModel.yaml b/functions/Clothes_and_body/addClothingModel.yaml index ea1c47e6..9bcefe86 100644 --- a/functions/Clothes_and_body/addClothingModel.yaml +++ b/functions/Clothes_and_body/addClothingModel.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddClothingModel -server: +shared: name: addClothingModel description: This function adds a new wearable clothing item for CJ. - parameters: [] + parameters: + - name: clothesTexture + type: string + description: A string determining the clothes texture that will be added. + - name: clothesModel + type: string + description: A string determining the clothes model that will be added. + - name: clothesType + type: int + description: A integer representing the clothes slot/type the clothes should be + added to. See the clothes catalog . examples: - path: examples/addClothingModel-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the clothing was added, and false otherwise. + requires_review: true diff --git a/functions/Clothes_and_body/getBodyPartName.yaml b/functions/Clothes_and_body/getBodyPartName.yaml index 2226681b..26b69087 100644 --- a/functions/Clothes_and_body/getBodyPartName.yaml +++ b/functions/Clothes_and_body/getBodyPartName.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetBodyPartName -server: +shared: name: getBodyPartName description: This function is used to get the name of a body part on a player. - parameters: [] + parameters: + - name: bodyPartID + type: int + description: 'An integer representing the body part ID you wish to retrieve the + name of. 3: Torso 4: Ass 5: Left Arm 6: Right Arm 7: Left Leg 8: Right Leg 9: + Head' examples: - path: examples/getBodyPartName-1.lua description: This example prints the killer and body part to the chat on the wasted/kill event. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: This function returns a string containing the body part name if the + ID is valid, false otherwise. + requires_review: true diff --git a/functions/Clothes_and_body/getClothesByTypeIndex.yaml b/functions/Clothes_and_body/getClothesByTypeIndex.yaml index 15593937..2cba5d0b 100644 --- a/functions/Clothes_and_body/getClothesByTypeIndex.yaml +++ b/functions/Clothes_and_body/getClothesByTypeIndex.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetClothesByTypeIndex -server: +shared: name: getClothesByTypeIndex description: 'This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).' - parameters: [] + parameters: + - name: clothesType + type: int + description: An integer representing the clothes slot/type to scan through. + - name: clothesIndex + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getClothesByTypeIndex-1.lua description: This example gets the current clothes of a certain type on a player, then swaps with the next in the clothes list. side: server - incomplete: true + returns: + values: + - type: string string + name: value + description: This function returns 2 strings, a texture and model respectively, + false if invalid arguments were passed to the function. + requires_review: true diff --git a/functions/Clothes_and_body/getClothesTypeName.yaml b/functions/Clothes_and_body/getClothesTypeName.yaml index 6f2cc3b8..41112cf9 100644 --- a/functions/Clothes_and_body/getClothesTypeName.yaml +++ b/functions/Clothes_and_body/getClothesTypeName.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetClothesTypeName -server: +shared: name: getClothesTypeName description: This function is used to get the name of a certain clothes type. - parameters: [] + parameters: + - name: clothesType + type: int + description: An integer determining the type of clothes you want to get the clothes + of. examples: - path: examples/getClothesTypeName-1.lua description: This example is used to output in the chatbox what clothes type the player who uses the 'clothes' command is wearing. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: This function returns a string (the name of the clothes type) if + found, false otherwise. + requires_review: true diff --git a/functions/Clothes_and_body/getTypeIndexFromClothes.yaml b/functions/Clothes_and_body/getTypeIndexFromClothes.yaml index 1c81dffc..98a79aeb 100644 --- a/functions/Clothes_and_body/getTypeIndexFromClothes.yaml +++ b/functions/Clothes_and_body/getTypeIndexFromClothes.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTypeIndexFromClothes -server: +shared: name: getTypeIndexFromClothes description: 'This function is used to get the clothes type and index from the texture and model. (Scans through the list of clothes for the specific type).' - parameters: [] + parameters: + - name: clothesTexture + type: string + description: A string determining the clothes texture that you wish to retrieve + the type and index from. See the clothes catalog . + - name: clothesModel + type: string + description: A string determining the corresponding clothes model that you wish + to retrieve the type and index from. See the clothes catalog . examples: - path: examples/getTypeIndexFromClothes-1.lua description: This example gets the current clothes of a certain type on a player, then swaps with the previous in the clothes list. side: server - incomplete: true + returns: + values: + - type: int int + name: value + description: This function returns two integers, type and index respectively, + false if invalid arguments were passed to the function. + requires_review: true diff --git a/functions/Colshape/addColPolygonPoint.yaml b/functions/Colshape/addColPolygonPoint.yaml index e66db885..e9ba0bf4 100644 --- a/functions/Colshape/addColPolygonPoint.yaml +++ b/functions/Colshape/addColPolygonPoint.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddColPolygonPoint -server: +shared: name: addColPolygonPoint description: This function is used to add a new point to an existing [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon you wish add a point to. + - name: fX + type: float + description: The X position of the new bound point. + - name: fY + type: float + description: The Y position of the new bound point. + - name: index + type: int + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/addColPolygonPoint-1.lua description: This examples adds a point to an existing polygon shape by a command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the polygon was changed, false if invalid arguments + were passed. + oop: + element: colshape + method: addPoint + static: false pair: removeColPolygonPoint - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColCircle.yaml b/functions/Colshape/createColCircle.yaml index 109f4c71..e7cc0cae 100644 --- a/functions/Colshape/createColCircle.yaml +++ b/functions/Colshape/createColCircle.yaml @@ -1,17 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColCircle -server: +shared: name: createColCircle description: This function creates a collision circle. This is a shape that has a position and a radius and infinite height that you can use to detect a player's presence. Events will be triggered when a player enters or leaves it. - parameters: [] + parameters: + - name: fX + type: float + description: The collision circle's center point's X axis position. + - name: fY + type: float + description: The collision circle's center point's Y axis position. + - name: radius + type: float + description: The radius of the collision circle. Can not be smaller than 0.1. examples: - path: examples/createColCircle-1.lua description: This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console functionset_zone. side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Circle + static: true notes: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColCuboid.yaml b/functions/Colshape/createColCuboid.yaml index faefaf5c..5db6256a 100644 --- a/functions/Colshape/createColCuboid.yaml +++ b/functions/Colshape/createColCuboid.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColCuboid -server: +shared: name: createColCuboid description: This function creates a collision cuboid. This is a shape that has a position, width, depth and height. See [Wikipedia](http://en.wikipedia.org/wiki/Cuboid) for a definition of a cuboid. The XYZ of the col starts at the southwest bottom corner of the shape. - parameters: [] + parameters: + - name: fX + type: float + description: The X position of the collision cuboid's western side. + - name: fY + type: float + description: The Y position of the collision cuboid's southern side. + - name: fZ + type: float + description: The Z position of the collision cuboid's lowest side. + - name: fWidth + type: float + description: The collision cuboid's width. + - name: fDepth + type: float + description: The collision cuboid's depth. + - name: fHeight + type: float + description: The collision cuboid's height. examples: - path: examples/createColCuboid-1.lua description: This example displays a chat message when a player enters the colshape @@ -14,6 +32,16 @@ server: - path: examples/createColCuboid-2.lua description: This function creates a cuboid and centers it to given coordinates side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Cuboid + static: true notes: - type: info content: Attaching a cuboid colshape to another element may give unexpected results @@ -22,4 +50,4 @@ server: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColPolygon.yaml b/functions/Colshape/createColPolygon.yaml index 5773a7f9..a9a34ada 100644 --- a/functions/Colshape/createColPolygon.yaml +++ b/functions/Colshape/createColPolygon.yaml @@ -1,12 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColPolygon -server: +shared: name: createColPolygon description: This function creates a collision polygon. See [Wikipedia](http://en.wikipedia.org/wiki/Polygon) for a definition of a polygon. The first set of X Y of this shape is not part of the colshape bounds, so can set anywhere in the game world, however for performance, place it as close to the centre of the polygon as you can. It should be noted this shape is **2D**. There should be at least 3 bound points set. - parameters: [] + parameters: + - name: fCenterX + type: float + description: The X position of the collision polygon's position - the position + that will be returned from getElementPosition . + - name: fCenterY + type: float + description: The Y position of the collision polygon's position - the position + that will be returned from getElementPosition . + - name: fX1 + type: float + description: The 1st X position of the collision polygon's bound point + - name: fY1 + type: float + description: The 1st Y position of the collision polygon's bound point + - name: fX2 + type: float + description: The 2nd X position of the collision polygon's bound point + - name: fY2 + type: float + description: The 2nd Y position of the collision polygon's bound point + - name: fX3 + type: float + description: The 3rd X position of the collision polygon's bound point + - name: fY3 + type: float + description: The 3rd Y position of the collision polygon's bound point + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/createColPolygon-1.lua description: This example displays a chat message when any element hits the colshape @@ -16,6 +45,16 @@ server: description: This example displays a chat message when any element hits the colshape and allows the colshape to be created using a console functionset_wall. side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Polygon + static: true notes: - type: info content: For this function to work correctly, get/set your bound points in an @@ -26,4 +65,4 @@ server: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColRectangle.yaml b/functions/Colshape/createColRectangle.yaml index 81aa6e48..09685289 100644 --- a/functions/Colshape/createColRectangle.yaml +++ b/functions/Colshape/createColRectangle.yaml @@ -1,15 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColRectangle -server: +shared: name: createColRectangle description: This function creates a collision rectangle. This is a shape that has a position and a width and a depth. See [Rectangle](http://en.wikipedia.org/wiki/Rectangle) for a definition of a rectangle. XY marks on the south west corner of the colshape. - parameters: [] + parameters: + - name: fX + type: float + description: The X position of the collision rectangle's west side. + - name: fY + type: float + description: The Y position of the collision rectangle's south side. + - name: fWidth + type: float + description: The collision rectangle's width. + - name: fHeight + type: float + description: The collision rectangle's height. examples: - path: examples/createColRectangle-1.lua description: This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console functionset_zone. side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Rectangle + static: true notes: - type: info content: Attaching a rectangle colshape to another element may give unexpected @@ -18,4 +40,4 @@ server: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColSphere.yaml b/functions/Colshape/createColSphere.yaml index aa688cd5..b141aa37 100644 --- a/functions/Colshape/createColSphere.yaml +++ b/functions/Colshape/createColSphere.yaml @@ -1,17 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColSphere -server: +shared: name: createColSphere description: This function creates a collision sphere. This is a shape that has a position and a radius. See [Wikipedia](http://en.wikipedia.org/wiki/Sphere) for a definition of a sphere. - parameters: [] + parameters: + - name: fX + type: float + description: The collision sphere's center point's X axis position. + - name: fY + type: float + description: The collision sphere's center point's Y axis position. + - name: fZ + type: float + description: The collision sphere's center point's Z axis position. + - name: fRadius + type: float + description: The collision sphere's radius. examples: - path: examples/createColSphere-1.lua description: Example 1:This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console functionset_zone. side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Sphere + static: true notes: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/createColTube.yaml b/functions/Colshape/createColTube.yaml index 4d4fd901..e26b301a 100644 --- a/functions/Colshape/createColTube.yaml +++ b/functions/Colshape/createColTube.yaml @@ -1,19 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateColTube -server: +shared: name: createColTube description: This function creates a collision tube. This is a shape that has a position and a 2D (X/Y) radius and a height. See [Cylinder](http://en.wikipedia.org/wiki/Cylinder_(geometry)) for a definition of a tube. A tube is similar to a colcircle, except that it has a limited height, this means you can limit the distance above the position defined by (fX, fY, fZ) that the collision is detected. - parameters: [] + parameters: + - name: fX + type: float + description: The position of the base of the tube's center on the X axis. + - name: fY + type: float + description: The position of the base of the tube's center on the Y axis. + - name: fZ + type: float + description: The position of the base of the tube's center on the Z axis. + - name: fRadius + type: float + description: The collision tube's radius. + - name: fHeight + type: float + description: The collision tube's height. examples: - path: examples/createColTube-1.lua description: This example displays a chat message when a player enters the colshape and allows the colshape to be created using a console functionset_zone. side: server + returns: + values: + - type: colshape + name: value + description: Returns a colshape element if successful, false if invalid arguments + were passed to the function. + oop: + element: ColShape + method: Tube + static: true notes: - type: tip content: To visualize a colshape when writing scripts, use the client console command showcol - incomplete: true + requires_review: true diff --git a/functions/Colshape/getColPolygonHeight.yaml b/functions/Colshape/getColPolygonHeight.yaml index 35c1f72a..fad68d78 100644 --- a/functions/Colshape/getColPolygonHeight.yaml +++ b/functions/Colshape/getColPolygonHeight.yaml @@ -1,14 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColPolygonHeight -server: +shared: name: getColPolygonHeight description: 'This function is used to get the height of an existing [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). By default, a colshape polygon is infinitely tall.' - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon. examples: - path: examples/getColPolygonHeight-1.lua description: This example creates a polygon colshape and show height of it with command 'getpolyheight'. side: server - incomplete: true + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns two floats , indicating the floor and ceiling of the colshape + height, false if invalid arguments were passed. + oop: + element: colshape + method: getHeight + static: false + requires_review: true diff --git a/functions/Colshape/getColPolygonPointPosition.yaml b/functions/Colshape/getColPolygonPointPosition.yaml index 35807af5..c0b7cc90 100644 --- a/functions/Colshape/getColPolygonPointPosition.yaml +++ b/functions/Colshape/getColPolygonPointPosition.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColPolygonPointPosition -server: +shared: name: getColPolygonPointPosition description: This function is used to get the position of a bound point in a [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon you wish to change. + - name: index + type: int + description: The index of the point you wish to retrieve. The points are indexed + in order, with 1 being the first bound point. examples: - path: examples/getColPolygonPointPosition-1.lua description: '' side: server + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns two floats , x and y, indicating the position of the point, + false if invalid arguments were passed. + oop: + element: colshape + method: getPointPosition + static: false pair: setColPolygonPointPosition - incomplete: true + requires_review: true diff --git a/functions/Colshape/getColPolygonPoints.yaml b/functions/Colshape/getColPolygonPoints.yaml index f7273205..f3babe11 100644 --- a/functions/Colshape/getColPolygonPoints.yaml +++ b/functions/Colshape/getColPolygonPoints.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColPolygonPoints -server: +shared: name: getColPolygonPoints description: This function is used to get all bound points in a [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon you wish to get the points of. examples: - path: examples/getColPolygonPoints-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of coordinates, each coordinate being a table containing + the x and y position of a bound point, false if invalid arguments were passed. + oop: + element: colshape + method: getPoints + static: false + requires_review: true diff --git a/functions/Colshape/getColShapeRadius.yaml b/functions/Colshape/getColShapeRadius.yaml index 67519914..9b940135 100644 --- a/functions/Colshape/getColShapeRadius.yaml +++ b/functions/Colshape/getColShapeRadius.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColShapeRadius -server: +shared: name: getColShapeRadius description: This function is used to get the radius of a colshape. Valid types are [circle](/wiki/CreateColCircle "CreateColCircle"), [sphere](/wiki/CreateColSphere "CreateColSphere") and [tube](/wiki/CreateColTube "CreateColTube"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape you wish to get the radius of. examples: - path: examples/getColShapeRadius-1.lua description: '' side: server + returns: + values: + - type: float + name: value + description: Returns a float containing the radius of the colshape, false if an + invalid colshape was passed. + oop: + element: colshape + method: getRadius + static: false pair: setColShapeRadius - incomplete: true + requires_review: true diff --git a/functions/Colshape/getColShapeSize.yaml b/functions/Colshape/getColShapeSize.yaml index 7d38064f..c254d3dd 100644 --- a/functions/Colshape/getColShapeSize.yaml +++ b/functions/Colshape/getColShapeSize.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColShapeSize -server: +shared: name: getColShapeSize description: This function is used to get the size of a colshape. Valid types are [rectangle](/wiki/CreateColRectangle "CreateColRectangle"), [cuboid](/wiki/CreateColCuboid "CreateColCuboid") and [tube](/wiki/CreateColTube "CreateColTube"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape you wish to get the size of. examples: - path: examples/getColShapeSize-1.lua description: '' side: server + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns up to 3 floats depending on the colshape type (see below), + false if invalid arguments were passed. + oop: + element: colshape + method: getSize + static: false pair: setColShapeSize - incomplete: true + requires_review: true diff --git a/functions/Colshape/getColShapeType.yaml b/functions/Colshape/getColShapeType.yaml index ce533e05..d1244b12 100644 --- a/functions/Colshape/getColShapeType.yaml +++ b/functions/Colshape/getColShapeType.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColShapeType -server: +shared: name: getColShapeType description: This function is used to retrieve the type of an colshape. - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape you wish to get the type of. examples: - path: examples/getColShapeType-1.lua description: This example outputs the type of all colshapes. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: 'Returns false if invalid arguments were passed, or an integer of + the type of the colshape, which include:' + oop: + element: colshape + method: getShapeType + variable: shapeType + static: false + requires_review: true diff --git a/functions/Colshape/isInsideColShape.yaml b/functions/Colshape/isInsideColShape.yaml index 69a3aa49..158c7c51 100644 --- a/functions/Colshape/isInsideColShape.yaml +++ b/functions/Colshape/isInsideColShape.yaml @@ -1,10 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsInsideColShape -server: +shared: name: isInsideColShape description: This function checks if a 3D position is inside a colshape or not. - parameters: [] + parameters: + - name: theShape + type: colshape + description: The colshape you're checking the position against. + - name: posX + type: float + description: The X coordinate of the position you're checking. + - name: posY + type: float + description: The Y coordinate of the position you're checking. + - name: posZ + type: float + description: The Z coordinate of the position you're checking. examples: - path: examples/isInsideColShape-1.lua description: This function checks if an element is within a colshape. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position is inside the colshape, false if it + isn't or if any parameters are invalid. + oop: + element: colshape + method: isInside + static: false + requires_review: true diff --git a/functions/Colshape/removeColPolygonPoint.yaml b/functions/Colshape/removeColPolygonPoint.yaml index f7a8a12a..7620f513 100644 --- a/functions/Colshape/removeColPolygonPoint.yaml +++ b/functions/Colshape/removeColPolygonPoint.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveColPolygonPoint -server: +shared: name: removeColPolygonPoint description: This function is used to remove a point from an existing [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon you wish to remove a point from. + - name: index + type: int + description: The index of the point you wish to remove. The points are indexed + in order, with 1 being the first bound point. You can't remove the last 3 points. examples: - path: examples/removeColPolygonPoint-1.lua description: This example remove a polygon colshape point by command 'removepoint'. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the polygon was changed, false if invalid arguments + were passed. + oop: + element: colshape + method: removePoint + static: false pair: addColPolygonPoint - incomplete: true + requires_review: true diff --git a/functions/Colshape/setColPolygonHeight.yaml b/functions/Colshape/setColPolygonHeight.yaml index 611fcdcc..40d6ce0a 100644 --- a/functions/Colshape/setColPolygonHeight.yaml +++ b/functions/Colshape/setColPolygonHeight.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetColPolygonHeight -server: +shared: name: setColPolygonHeight description: 'This function is used to change the height of an existing [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). By default, a colshape polygon is infinitely tall.' - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon. + - name: floor + type: float + description: The polygon floor (lowest Z coordinate). Parse false to reset this + value to 0. + - name: ceil + type: float + description: The polygon ceiling (highest Z coordinate). Parse false to reset + this value to infinitely tall. examples: - path: examples/setColPolygonHeight-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the polygon was changed, false if invalid arguments + were passed. + oop: + element: colshape + method: setHeight + static: false + requires_review: true diff --git a/functions/Colshape/setColPolygonPointPosition.yaml b/functions/Colshape/setColPolygonPointPosition.yaml index 8ea48d0d..317b4c48 100644 --- a/functions/Colshape/setColPolygonPointPosition.yaml +++ b/functions/Colshape/setColPolygonPointPosition.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetColPolygonPointPosition -server: +shared: name: setColPolygonPointPosition description: This function is used to set the position of a bound point in a [colshape polygon](/wiki/CreateColPolygon "CreateColPolygon"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape polygon you wish to change. + - name: index + type: int + description: The index of the point you wish to change. The points are indexed + in order, with 1 being the first bound point. + - name: fX + type: float + description: The new X position of the bound point. + - name: fY + type: float + description: The new Y position of the bound point. examples: - path: examples/setColPolygonPointPosition-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the polygon was changed, false if invalid arguments + were passed. + oop: + element: colshape + method: setPointPosition + static: false pair: getColPolygonPointPosition - incomplete: true + requires_review: true diff --git a/functions/Colshape/setColShapeRadius.yaml b/functions/Colshape/setColShapeRadius.yaml index 0d512a8a..933871f1 100644 --- a/functions/Colshape/setColShapeRadius.yaml +++ b/functions/Colshape/setColShapeRadius.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetColShapeRadius -server: +shared: name: setColShapeRadius description: This function is used to set the radius of a colshape. Valid types are [circle](/wiki/CreateColCircle "CreateColCircle"), [sphere](/wiki/CreateColSphere "CreateColSphere") and [tube](/wiki/CreateColTube "CreateColTube"). - parameters: [] + parameters: + - name: shape + type: colshape + description: The colshape you wish to change the radius of. + - name: radius + type: float + description: The radius you want to set. examples: - path: examples/setColShapeRadius-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the radius was changed, or false if invalid arguments + were passed. + oop: + element: colshape + method: setRadius + static: false pair: getColShapeRadius - incomplete: true + requires_review: true diff --git a/functions/Colshape/setColShapeSize.yaml b/functions/Colshape/setColShapeSize.yaml index 78d3a28f..12466031 100644 --- a/functions/Colshape/setColShapeSize.yaml +++ b/functions/Colshape/setColShapeSize.yaml @@ -9,8 +9,11 @@ server: - path: examples/setColShapeSize-1.lua description: '' side: server + oop: + element: colshape + method: setSize + static: false pair: getColShapeSize - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -22,3 +25,4 @@ server: - Missing section: Syntax (Tube) ' + requires_review: true diff --git a/functions/Database/dbConnect.yaml b/functions/Database/dbConnect.yaml index 59fe1ee3..758f7864 100644 --- a/functions/Database/dbConnect.yaml +++ b/functions/Database/dbConnect.yaml @@ -1,10 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbConnect -server: +shared: name: dbConnect description: This function opens a connection to a database and returns an element that can be used with [dbQuery](/wiki/DbQuery "DbQuery"). To disconnect use [destroyElement](/wiki/DestroyElement "DestroyElement"). - parameters: [] + parameters: + - name: databaseType + type: string + description: The type of database. This can be either sqlite or mysql + - name: host + type: string + description: Host address e.g. host=127.0.0.1 + - name: username + type: string + description: Usually required for MySQL, ignored by SQLite + default: '""' + - name: password + type: string + description: Usually required for MySQL, ignored by SQLite + default: '""' + - name: options + type: string + description: MISSING_PARAM_DESC + default: '""' examples: - path: examples/dbConnect-1.lua description: This example opens a connection to a SQLite database file in the @@ -40,6 +58,15 @@ server: description: 'The folowing example shows how you could approach a common resource for database operations with exported functions (queryandexecute):' side: server + returns: + values: + - type: element + name: value + description: Returns a database connection element unless there are problems, + in which case it return false . + oop: + element: connection + constructorclass: Connection notes: - type: info content: Connecting and disconnecting many times can have a performance impact @@ -63,4 +90,4 @@ server: accompanied by a prior debug error explaining the problem. In that case you should check the Server Manual to see if you have missed any recommended (best-effort) steps for server set-up. - incomplete: true + requires_review: true diff --git a/functions/Database/dbExec.yaml b/functions/Database/dbExec.yaml index 47830d3c..2192a60d 100644 --- a/functions/Database/dbExec.yaml +++ b/functions/Database/dbExec.yaml @@ -1,9 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbExec -server: +shared: name: dbExec description: This function executes a database query using the supplied connection. No query result is returned. - parameters: [] + parameters: + - name: databaseConnection + type: element + description: A database connection element previously returned from dbConnect + - name: query + type: string + description: An SQL query. Positions where parameter values will be inserted are + marked with a ? + - name: param1 [, var param2 ...] + type: var + description: MISSING_PARAM_DESC examples: - path: examples/dbExec-1.lua description: 'This example executes an INSERT query:' @@ -16,8 +26,18 @@ server: description: 'This example shows how to use backticks and??for parts of the query that are not column values:' side: server + returns: + values: + - type: bool + name: value + description: Returns true unless the connection is incorrect, in which case it + returns false . + oop: + element: connection + method: exec + static: false notes: - type: tip content: The server command debugdb 2 will output verbose information on each query to a logging file (usually logs/db.log ) - incomplete: true + requires_review: true diff --git a/functions/Database/dbFree.yaml b/functions/Database/dbFree.yaml index 31393726..0439477d 100644 --- a/functions/Database/dbFree.yaml +++ b/functions/Database/dbFree.yaml @@ -1,8 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbFree -server: +shared: name: dbFree description: This function frees a database query handle. dbFree only needs to be used if a result has not been obtained with [dbPoll](/wiki/DbPoll "DbPoll") - parameters: [] + parameters: + - name: queryHandle + type: handle + description: A query handle previously returned from dbQuery examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the handle was successfully freed, false otherwise. + oop: + element: queryhandle + method: free + static: false + requires_review: true diff --git a/functions/Database/dbPoll.yaml b/functions/Database/dbPoll.yaml index 24762815..9d220f47 100644 --- a/functions/Database/dbPoll.yaml +++ b/functions/Database/dbPoll.yaml @@ -1,8 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbPoll -server: +shared: name: dbPoll description: This function checks the progress of a database query. - parameters: [] + parameters: + - name: queryHandle + type: handle + description: A query handle previously returned from dbQuery + - name: timeout + type: int + description: 'How many milliseconds to wait for a result. Use 0 for an instant + response (which may return nil). Use -1 to wait until a result is ready. Note: + A wait here will freeze the entire server just like executeSQLQuery' + - name: multipleResults + type: bool + description: Set to true to enable the return values from multiple queries + default: 'false' examples: - path: examples/dbPoll-1.lua description: 'This example waits until a result is ready:' @@ -36,6 +48,15 @@ server: - path: examples/dbPoll-10.lua description: This example shows how to obtain data without server freeze. side: server + returns: + values: + - type: table + name: value + description: 'The table is of the format:' + oop: + element: queryhandle + method: poll + static: false notes: - type: info content: If a column contained a number it is returned as a number, this includes @@ -44,4 +65,4 @@ server: - type: important content: It is strongly recommended to use this function in callback, as presented in "This example shows how to obtain data without server freeze." - incomplete: true + requires_review: true diff --git a/functions/Database/dbPrepareString.yaml b/functions/Database/dbPrepareString.yaml index 824b9030..8b4c6497 100644 --- a/functions/Database/dbPrepareString.yaml +++ b/functions/Database/dbPrepareString.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbPrepareString -server: +shared: name: dbPrepareString description: This function escapes arguments in the same way as [dbQuery](/wiki/DbQuery "DbQuery"), except dbPrepareString returns the query string instead of processing the query. This allows you to safely build complex query strings from component parts and help prevent (one class of) SQL injection. - parameters: [] + parameters: + - name: databaseConnection + type: element + description: A database connection element previously returned from dbConnect + - name: query + type: string + description: An SQL query. Positions where parameter values will be inserted are + marked with a ? + - name: param1 [, var param2 ...] + type: var + description: MISSING_PARAM_DESC examples: - path: examples/dbPrepareString-1.lua description: This example shows how to safely build a dynamic SELECT query @@ -14,4 +24,13 @@ server: description: This example shows how to build an INSERT/UPDATE query for multiple rows. (Query syntax is MySQL only and assumes one column is a unique key) side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a prepare SQL query string, or false if an error occurred. + oop: + element: connection + method: prepareString + static: false + requires_review: true diff --git a/functions/Database/dbQuery.yaml b/functions/Database/dbQuery.yaml index 07a48cad..ae0a1b21 100644 --- a/functions/Database/dbQuery.yaml +++ b/functions/Database/dbQuery.yaml @@ -1,10 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DbQuery -server: +shared: name: dbQuery description: This function starts a database query using the supplied connection. Use the returned query handle with [dbPoll](/wiki/DbPoll "DbPoll") to get the result, or [dbFree](/wiki/DbFree "DbFree") if you don't want the result. - parameters: [] + parameters: + - name: callbackFunction + type: function + description: An optional function to be called when a result is ready. The function + will only be called if the result has not already been read with dbPoll . The + function is called with the query handle as the first argument. + - name: table callbackArguments, ] + type: '[' + description: MISSING_PARAM_DESC + - name: databaseConnection + type: element + description: A database connection element previously returned from dbConnect + - name: query + type: string + description: An SQL query. Positions where parameter values will be inserted are + marked with a ? + - name: param1 [, var param2 ...] + type: var + description: MISSING_PARAM_DESC examples: - path: examples/dbQuery-1.lua description: 'This example starts an INSERT query and frees the result:' @@ -25,6 +43,16 @@ server: description: 'This example shows how to use backticks and??for parts of the query that are not column values:' side: server + returns: + values: + - type: handle + name: value + description: Returns a query handle unless the connection is incorrect, in which + case it return false . + oop: + element: connection + method: query + static: false notes: - type: tip content: The server command debugdb 2 will output verbose information on each @@ -33,4 +61,4 @@ server: content: It is strongly recommended to use this function asynchronously, as presented in "This example starts a select query and processes the result in an inline callback function with custom arguments:" - incomplete: true + requires_review: true diff --git a/functions/Database/executeSQLQuery.yaml b/functions/Database/executeSQLQuery.yaml index d7b5e4bc..deb50b98 100644 --- a/functions/Database/executeSQLQuery.yaml +++ b/functions/Database/executeSQLQuery.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery -server: +shared: name: executeSQLQuery description: This function executes an arbitrary SQL query and returns the result rows if there are any. It allows parameter binding for security (SQL injection is rendered impossible). - parameters: [] + parameters: + - name: query + type: string + description: An SQL query. Positions where parameter values will be inserted are + marked with a "?". + - name: param1 [, var param2 ... ] + type: var + description: MISSING_PARAM_DESC examples: - path: examples/executeSQLQuery-1.lua description: 'Example equivalents for executeSQLCreateTable:' @@ -33,8 +40,15 @@ server: description: This example shows the amount of money a certain registered player has. side: server + returns: + values: + - type: table + name: value + description: 'Returns a table with the result of the query if it was a SELECT + query, or false if otherwise. In case of a SELECT query the result table may + be empty (if there are no result rows). The table is of the form:' notes: - type: info content: This function only acts upon registry.db. Use dbQuery to query a custom SQL database. - incomplete: true + requires_review: true diff --git a/functions/Discord/getDiscordRichPresenceUserID.yaml b/functions/Discord/getDiscordRichPresenceUserID.yaml index de5f075a..d88e91b8 100644 --- a/functions/Discord/getDiscordRichPresenceUserID.yaml +++ b/functions/Discord/getDiscordRichPresenceUserID.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetDiscordRichPresenceUserID -client: +shared: name: getDiscordRichPresenceUserID description: The function returns the client Discord UserID. parameters: [] @@ -9,8 +9,15 @@ client: granted permission to share data. Otherwise, they will receive an appropriate message. side: client + returns: + values: + - type: string + name: value + description: It will return an empty string ("") if the user has not given consent + or has disabled the Rich Presence synchronization option. Otherwise, it will + return the userid as a string. notes: - type: important content: The function will correctly return the UserID if the user has given consent beforehand and is connected to the Rich Presence application. - incomplete: true + requires_review: true diff --git a/functions/Discord/isDiscordRichPresenceConnected.yaml b/functions/Discord/isDiscordRichPresenceConnected.yaml index fdd8b9bb..da1b4014 100644 --- a/functions/Discord/isDiscordRichPresenceConnected.yaml +++ b/functions/Discord/isDiscordRichPresenceConnected.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsDiscordRichPresenceConnected -client: +shared: name: isDiscordRichPresenceConnected description: The function checks if the client has Discord Rich Presence enabled. parameters: [] @@ -8,4 +8,14 @@ client: description: This example outputs whether the client has enabled Discord Rich Presence. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if Discord Rich Presence is enabled on the client, false + if disabled. + oop: + element: discordrpc + method: isConnected + static: false + requires_review: true diff --git a/functions/Discord/resetDiscordRichPresenceData.yaml b/functions/Discord/resetDiscordRichPresenceData.yaml index b425d8bf..d08435ad 100644 --- a/functions/Discord/resetDiscordRichPresenceData.yaml +++ b/functions/Discord/resetDiscordRichPresenceData.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetDiscordRichPresenceData -client: +shared: name: resetDiscordRichPresenceData description: The function resets the Discord Rich Presence configuration to default. parameters: [] @@ -8,4 +8,9 @@ client: description: The example shows how to reset Discord Rich Presence after using a custom application. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + requires_review: true diff --git a/functions/Discord/setDiscordApplicationID.yaml b/functions/Discord/setDiscordApplicationID.yaml index 278e2bb4..cd7ba0db 100644 --- a/functions/Discord/setDiscordApplicationID.yaml +++ b/functions/Discord/setDiscordApplicationID.yaml @@ -1,19 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordApplicationID -client: +shared: name: setDiscordApplicationID description: 'The function can assign your own application to use in Rich Presence. You can create an application **[here](https://discord.com/developers/applications)**' - parameters: [] + parameters: + - name: applicationID + type: string + description: a string representing your Discord application's ID. examples: - path: examples/setDiscordApplicationID-1.lua description: This example outputs whether the application was successfully setup and sets a custom asset image. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false if the client has disabled + rich presence. + oop: + element: discordrpc + method: setApplication + static: false notes: - type: important content: To reset the application ID, please use resetDiscordRichPresenceData - type: important content: In order for the function to work correctly, the user must have their activity privacy/status enabled in Discord. - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceAsset.yaml b/functions/Discord/setDiscordRichPresenceAsset.yaml index f01a1b37..cb113648 100644 --- a/functions/Discord/setDiscordRichPresenceAsset.yaml +++ b/functions/Discord/setDiscordRichPresenceAsset.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceAsset -client: +shared: name: setDiscordRichPresenceAsset description: Using this function you can set the large image asset of the application. The maximum size of assets is *1024x1024*, the minimum is *512x512*. - parameters: [] + parameters: + - name: assetImage + type: string + description: a string containing the key of the image you uploaded to your application's + asset list. + - name: text + type: string + description: a string to be displayed when someone hovers over the large image + asset in Discord. examples: - path: examples/setDiscordRichPresenceAsset-1.lua description: The example sets the large image asset to my_logo. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setAsset + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceButton.yaml b/functions/Discord/setDiscordRichPresenceButton.yaml index 5f3dee39..04f5e082 100644 --- a/functions/Discord/setDiscordRichPresenceButton.yaml +++ b/functions/Discord/setDiscordRichPresenceButton.yaml @@ -1,15 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceButton -client: +shared: name: setDiscordRichPresenceButton description: The function sets a custom button through which we can access the website on Discord. - parameters: [] + parameters: + - name: index + type: int + description: 'a int representing the index of the button (possible values: 1 or + 2)' + - name: text + type: string + description: a string containing the title of the button + - name: url + type: string + description: a string containing the button URL (only works with https:// or mtasa:// + ) examples: - path: examples/setDiscordRichPresenceButton-1.lua description: This example creates two custom buttons in our Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setButton + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceDetails.yaml b/functions/Discord/setDiscordRichPresenceDetails.yaml index ff58df54..93e47b50 100644 --- a/functions/Discord/setDiscordRichPresenceDetails.yaml +++ b/functions/Discord/setDiscordRichPresenceDetails.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceDetails -client: +shared: name: setDiscordRichPresenceDetails description: This function sets the details text of Discord Rich Presence. - parameters: [] + parameters: + - name: details + type: string + description: a string containing the details text examples: - path: examples/setDiscordRichPresenceDetails-1.lua description: This example shows how to change the state and details of the Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setDetails + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceEndTime.yaml b/functions/Discord/setDiscordRichPresenceEndTime.yaml index 40c05992..8c26ddb4 100644 --- a/functions/Discord/setDiscordRichPresenceEndTime.yaml +++ b/functions/Discord/setDiscordRichPresenceEndTime.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceEndTime -client: +shared: name: setDiscordRichPresenceEndTime description: This function sets the remaining time of Discord Rich Presence. - parameters: [] + parameters: + - name: seconds + type: int + description: an integer representing the number of seconds that are remaining. + If 0, or lower than the start time ( setDiscordRichPresenceStartTime ) the timer + will not be displayed. examples: - path: examples/setDiscordRichPresenceEndTime-1.lua description: This example shows how to change the remaining timer of the Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setEndTime + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresencePartySize.yaml b/functions/Discord/setDiscordRichPresencePartySize.yaml index 72dcaae7..a665172c 100644 --- a/functions/Discord/setDiscordRichPresencePartySize.yaml +++ b/functions/Discord/setDiscordRichPresencePartySize.yaml @@ -1,16 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresencePartySize -client: +shared: name: setDiscordRichPresencePartySize description: This function sets the party size of Discord Rich Presence. - parameters: [] + parameters: + - name: size + type: int + description: an integer representing the current party size. + - name: max + type: int + description: an integer representing the maximum party size. examples: - path: examples/setDiscordRichPresencePartySize-1.lua description: This example shows how to change the party size of the Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setPartySize + static: false notes: - type: info content: For the party size to be displayed, the state must be set setDiscordRichPresenceState - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceSmallAsset.yaml b/functions/Discord/setDiscordRichPresenceSmallAsset.yaml index cdbca769..8d5c0453 100644 --- a/functions/Discord/setDiscordRichPresenceSmallAsset.yaml +++ b/functions/Discord/setDiscordRichPresenceSmallAsset.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceSmallAsset -client: +shared: name: setDiscordRichPresenceSmallAsset description: Using this function, you can set the small image asset of the application. The maximum size of assets is *1024x1024*, the minimum *512x512*. - parameters: [] + parameters: + - name: assetImage + type: string + description: a string containing the key of the small image asset you uploaded + to your application's asset list. + - name: text + type: string + description: a string containing the hover text of the small image asset. examples: - path: examples/setDiscordRichPresenceSmallAsset-1.lua description: The example sets the small image asset to my_logo. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setSmallAsset + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceStartTime.yaml b/functions/Discord/setDiscordRichPresenceStartTime.yaml index 7bc8215e..24964819 100644 --- a/functions/Discord/setDiscordRichPresenceStartTime.yaml +++ b/functions/Discord/setDiscordRichPresenceStartTime.yaml @@ -1,14 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceStartTime -client: +shared: name: setDiscordRichPresenceStartTime description: This function sets the elapsed time of Discord Rich Presence. - parameters: [] + parameters: + - name: seconds + type: int + description: an integer representing the number of seconds that has elapsed. If + 0, the timer will not be displayed. examples: - path: examples/setDiscordRichPresenceStartTime-1.lua description: This example shows how to change the elapsed timer of the Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setStartTime + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Discord/setDiscordRichPresenceState.yaml b/functions/Discord/setDiscordRichPresenceState.yaml index 51ef24b7..5a72b5c2 100644 --- a/functions/Discord/setDiscordRichPresenceState.yaml +++ b/functions/Discord/setDiscordRichPresenceState.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDiscordRichPresenceState -client: +shared: name: setDiscordRichPresenceState description: This function sets the status of the Discord Rich Presence application. - parameters: [] + parameters: + - name: state + type: string + description: a string containing the status text examples: - path: examples/setDiscordRichPresenceState-1.lua description: This example shows how to set the state of the Discord Rich Presence application. side: client + returns: + values: + - type: bool + name: value + description: Returns true if function succeeds, false otherwise. + oop: + element: discordrpc + method: setState + static: false notes: - type: important content: To use this function, you must set up your own application setDiscordApplicationID - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxConvertPixels.yaml b/functions/Drawing/dxConvertPixels.yaml index 1fb08257..81a062b5 100644 --- a/functions/Drawing/dxConvertPixels.yaml +++ b/functions/Drawing/dxConvertPixels.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxConvertPixels -client: +shared: name: dxConvertPixels description: This function converts [pixels](/wiki/Texture_pixels "Texture pixels") from one format to another. - parameters: [] + parameters: + - name: pixels + type: string + description: MISSING_PARAM_DESC + - name: newFormat + type: string + description: MISSING_PARAM_DESC + - name: quality + type: int + description: MISSING_PARAM_DESC + default: '80' examples: - path: examples/dxConvertPixels-1.lua description: The code opens an image, read its pixels, convert the pixels to PNG, and then save it. (You can usethisimage to test.) side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a copy of the pixels in the new format, or false if invalid + arguments were passed to the function. + requires_review: true diff --git a/functions/Drawing/dxCreateFont.yaml b/functions/Drawing/dxCreateFont.yaml index 07d30ad5..e696f810 100644 --- a/functions/Drawing/dxCreateFont.yaml +++ b/functions/Drawing/dxCreateFont.yaml @@ -1,16 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxCreateFont -client: +shared: name: dxCreateFont description: This function creates a [DX font](/wiki/DX_font "DX font") element that can be used in [dxDrawText](/wiki/DxDrawText "DxDrawText"). Successful font creation is not guaranteed, and may fail due to hardware or memory limitations. - parameters: [] + parameters: + - name: filepath + type: string + description: the name of the file containing the font + - name: size + type: int + description: size of the font + default: '9' + - name: bold + type: bool + description: flag to indicate if the font should be bold + default: 'false' + - name: quality + type: string + description: 'the font quality "default": not the actual default "draft" "proof": + the default "nonantialiased" "antialiased" "cleartype" "cleartype_natural"' + default: '"proof"' examples: - path: examples/dxCreateFont-1.lua description: '' side: client + returns: + values: + - type: element + name: value + description: Returns a DX font element if successful, false if invalid arguments + were passed to the function, or there is insufficient resources available. + oop: + element: dx_font + constructorclass: DxFont notes: - type: info content: The size can't be less than 5 or more than 150. Use this function after onClientResourceStart, otherwise some characters may be displayed incorrectly. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxCreateRenderTarget.yaml b/functions/Drawing/dxCreateRenderTarget.yaml index 7904519a..05666193 100644 --- a/functions/Drawing/dxCreateRenderTarget.yaml +++ b/functions/Drawing/dxCreateRenderTarget.yaml @@ -1,15 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget -client: +shared: name: dxCreateRenderTarget description: This function creates a render target element, which is a special type of [texture](/wiki/Texture "Texture") that can be drawn on with the dx functions. Successful render target creation is not guaranteed, and may fail due to hardware or memory limitations. - parameters: [] + parameters: + - name: width + type: int + description: MISSING_PARAM_DESC + - name: height + type: int + description: MISSING_PARAM_DESC + - name: withAlpha + type: bool + description: The render target will be created with an alpha channel. 'false' + will turn images' alpha channels to black color + default: 'false' examples: - path: examples/dxCreateRenderTarget-1.lua description: '' side: client + returns: + values: + - type: element + name: value + description: Returns a texture element if successful, false if the system is unable + to create a render target. + oop: + element: texture + constructorclass: DxRenderTarget notes: - type: info content: Render targets are usually cleared when the player minimizes MTA (i.e. @@ -19,7 +39,6 @@ client: - type: tip content: It is highly recommended that dxSetTestMode is used when writing and testing scripts using dxCreateRenderTarget. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -27,3 +46,4 @@ client: - Missing section: Explanation ' + requires_review: true diff --git a/functions/Drawing/dxCreateScreenSource.yaml b/functions/Drawing/dxCreateScreenSource.yaml index 6780e22f..1ffca295 100644 --- a/functions/Drawing/dxCreateScreenSource.yaml +++ b/functions/Drawing/dxCreateScreenSource.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxCreateScreenSource -client: +shared: name: dxCreateScreenSource description: This function creates a screen source, which is a special type of [texture](/wiki/Texture "Texture") that contains the screen as rendered by GTA - parameters: [] + parameters: + - name: width + type: int + description: MISSING_PARAM_DESC + - name: height + type: int + description: MISSING_PARAM_DESC examples: - path: examples/dxCreateScreenSource-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a texture element if successful, false if invalid arguments + were passed to the function. + oop: + element: texture + constructorclass: DxScreenSource + requires_review: true diff --git a/functions/Drawing/dxCreateShader.yaml b/functions/Drawing/dxCreateShader.yaml index 72cf5d4a..2d802a82 100644 --- a/functions/Drawing/dxCreateShader.yaml +++ b/functions/Drawing/dxCreateShader.yaml @@ -1,11 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxCreateShader -client: +shared: name: dxCreateShader description: This function creates a [shader](/wiki/Shader "Shader") element that can be used in the dxDraw functions. Successful shader creation is not guaranteed unless the [Effect File](/wiki/Shader "Shader") contains a fallback technique which will work on every existing PC. - parameters: [] + parameters: + - name: filepath / string raw_data + type: string + description: MISSING_PARAM_DESC + - name: priority + type: float + description: If more than one shader is matched to a world texture, the shader + with the highest priority will be used. If there is more than one shader with + the same highest priority, the most recently created shader is used. + default: '0' + - name: maxDistance + type: float + description: If non-zero, the shader will be applied to textures nearer than maxDistance + only. This can speed up rendering, but (to look good) may require the shader + to fade out it's own effect as the texture reaches maxDistance. + default: '0' + - name: layered + type: bool + description: When set to true, the shader will be drawn in a separate render pass. + Several layered shaders can be drawn on the same world texture. (To avoid Z + fighting artifacts, you may have to add DepthBias=-0.0002; to the technique + pass, but this might cause visual artifacts when applied on vehicles) + default: 'false' + - name: elementTypes + type: string + description: 'A comma seperated list of element types to restrict this shader + to. Valid element types are: world - Textures in the GTA world ped - Player + and ped textures vehicle - Vehicles textures object - Objects textures other + - Element textures which are not peds, vehicles or objects all - Everything' + default: '"world' + - name: ped + type: unknown + description: MISSING_PARAM_DESC + - name: vehicle + type: unknown + description: MISSING_PARAM_DESC + - name: object + type: unknown + description: MISSING_PARAM_DESC + - name: other + type: unknown + description: MISSING_PARAM_DESC + - name: all" + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/dxCreateShader-1.lua description: '' @@ -18,8 +62,20 @@ client: description: 'This example creates a basic shader using macros to change shader''s behaviour:' side: client + returns: + values: + - type: element + name: value1 + - type: string + name: value2 + description: 'element: A shader element if successful, false if invalid arguments + were passed to the function. You should always check to see if this function + has returned false. string: The name of the technique that will be used.' + oop: + element: shader + constructorclass: DxShader notes: - type: info content: It is highly recommended that dxSetTestMode is used when writing and testing scripts using dxCreateShader. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxCreateTexture.yaml b/functions/Drawing/dxCreateTexture.yaml index aa4fa3e6..ac99e9c1 100644 --- a/functions/Drawing/dxCreateTexture.yaml +++ b/functions/Drawing/dxCreateTexture.yaml @@ -1,13 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxCreateTexture -client: +shared: name: dxCreateTexture description: This function creates a [texture](/wiki/Texture "Texture") element that can be used in the dxDraw functions. - parameters: [] + parameters: + - name: pixels / string filepath + type: string + description: MISSING_PARAM_DESC + - name: textureFormat + type: string + description: MISSING_PARAM_DESC + default: '"argb"' + - name: mipmaps + type: bool + description: MISSING_PARAM_DESC + default: 'true' + - name: textureEdge + type: string + description: MISSING_PARAM_DESC + default: '"wrap"' examples: - path: examples/dxCreateTexture-1.lua description: '' side: client + returns: + values: + - type: element + name: value + description: Returns a texture if successful, false if invalid arguments were + passed to the function. + oop: + element: texture + constructorclass: DxTexture notes: - type: info content: The times shown at the right of the page are only the time needed to @@ -26,4 +50,4 @@ client: textures (causing dxTextures to pile up) when they should no longer display per your script, which causes FPS lag and crashes all over MTA due to so many scripters missing it - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawCircle.yaml b/functions/Drawing/dxDrawCircle.yaml index a4641978..dce6e3a4 100644 --- a/functions/Drawing/dxDrawCircle.yaml +++ b/functions/Drawing/dxDrawCircle.yaml @@ -1,14 +1,66 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawCircle -client: +shared: name: dxDrawCircle description: This function draws a circle shape on the screen \- rendered for **one** frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to be display continuously. - parameters: [] + parameters: + - name: posX + type: float + description: An integer representing the absolute X position of the circle center, + represented by pixels on the screen. + - name: posY + type: float + description: An integer representing the absolute Y position of the circle center, + represented by pixels on the screen. + - name: radius + type: float + description: An integer representing the radius scale of the circle that is being + drawn. + - name: startAngle + type: float + description: An integer representing the angle of the first point of the circle. + default: '0.0' + - name: stopAngle + type: float + description: An integer representing the angle of the last point of the circle. + default: '360.0' + - name: theColor + type: int + description: An integer of the hex color, produced using tocolor or 0xAARRGGBB + (AA = alpha, RR = red, GG = green, BB = blue). + default: white + - name: theCenterColor + type: int + description: An integer of the hex color, produced using tocolor or 0xAARRGGBB + (AA = alpha, RR = red, GG = green, BB = blue). + default: theColor + - name: segments + type: int + description: 'An integer ranging from 3-1024 representing how many triangles are + used to form the circle, more segments = smoother circle. Note: using lots of + segments may cause lag.' + default: '32' + - name: ratio + type: int + description: 'Ratio between width and height, e.g: 2 would mean that the width + of the circle is 2 times the height.' + default: '1' + - name: postGUI + type: bool + description: A bool representing whether the circle should be drawn on top of + or behind any ingame GUI (rendered by CEGUI). + default: 'false' examples: - path: examples/dxDrawCircle-1.lua description: This function draws a rectangle with rounded corners. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the creation of the 2D circle was successful, false + otherwise. notes: - type: info content: By documentation this function does perform a triangle approximation @@ -25,4 +77,4 @@ client: calculation from the texcoord (0.5, 0.5) to the currently drawing pixel. Then the HLSL clip function can be used to not render any pixels outside of the circle. Read more about it in this post . - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawImage.yaml b/functions/Drawing/dxDrawImage.yaml index af1b223c..53cee170 100644 --- a/functions/Drawing/dxDrawImage.yaml +++ b/functions/Drawing/dxDrawImage.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawImage -client: +shared: name: dxDrawImage description: "Draws an image on the screen for a single frame. In order for the\ \ image to stay visible continuously, you need to call this function with the\ @@ -7,12 +7,40 @@ client: \ \"OnClientRender\")). \n\nImage files should ideally have dimensions that are\ \ a power of two, to prevent possible blurring. \n\n**Power of two: 2px, 4px,\ \ 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...**" - parameters: [] + parameters: + - name: posX + type: float + description: the absolute X coordinate of the top left corner of the image + - name: posY + type: float + description: the absolute Y coordinate of the top left corner of the image + - name: width + type: float + description: the absolute width of the image + - name: height + type: float + description: the absolute height of the image + - name: image + type: mixed + description: Either a material element or a filepath of the image which is going + to be drawn. (.dds images are also supported). Image files should ideally have + dimensions that are a power of two, to prevent possible blurring. Use a texture + created with dxCreateTexture to speed up drawing . + - name: float rotation + type: '[' + description: MISSING_PARAM_DESC + default: "0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0,\n\ + \ int color = tocolor(255,255,255,255" examples: - path: examples/dxDrawImage-1.lua description: Example of a pendulum swinging from the top of the screen, made using dxDrawImage. side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: tip content: To help prevent edge artifacts when drawing textures, set textureEdge @@ -24,4 +52,4 @@ client: content: For further optimising your DX code, see dxCreateRenderTarget . You should use render target whenever possible, in order to dramatically reduce CPU usage caused by many dxDraw* calls. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawImageSection.yaml b/functions/Drawing/dxDrawImageSection.yaml index 3870fe09..a76310b2 100644 --- a/functions/Drawing/dxDrawImageSection.yaml +++ b/functions/Drawing/dxDrawImageSection.yaml @@ -1,21 +1,81 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawImageSection -client: +shared: name: dxDrawImageSection description: Differing from [dxDrawImage](/wiki/DxDrawImage "DxDrawImage"), this function only draws a part of an image on the screen for a single frame. In order for the image to stay visible continuously, you need to call this function with the same parameters on each frame update (see [onClientRender](/wiki/OnClientRender "OnClientRender")). - parameters: [] + parameters: + - name: posX + type: float + description: the absolute X coordinate of the top left corner of the image + - name: posY + type: float + description: the absolute Y coordinate of the top left corner of the image + - name: width + type: float + description: the absolute width of the image + - name: height + type: float + description: the absolute height of the image + - name: u + type: float + description: the absolute X coordinate of the top left corner of the section which + should be drawn from image + - name: v + type: float + description: the absolute Y coordinate of the top left corner of the section which + should be drawn from image + - name: usize + type: float + description: the absolute width of the image section + - name: vsize + type: float + description: the absolute height of the image section + - name: image + type: mixed + description: Either a material element or a filepath of the image which is going + to be drawn. (.dds images are also supported). Image files should ideally have + dimensions that are a power of two, to prevent possible blurring. Use a texture + created with dxCreateTexture to speed up drawing . + - name: rotation + type: float + description: the rotation, in degrees for the image. + default: '0' + - name: rotationCenterOffsetX + type: float + description: the absolute X offset from the image center for which to rotate the + image from. + default: '0' + - name: rotationCenterOffsetY + type: float + description: the absolute Y offset from the image center for which to rotate the + image from. + default: '0' + - name: color + type: int + description: 'the color of the image, a value produced by tocolor or hexadecimal + number in format: 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).' + default: white + - name: postGUI + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxDrawImageSection-1.lua description: Example 1The example draws a section of an image. (You can usethisimage to test.) side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: tip content: Use a texture created with dxCreateTexture to speed up drawing . - type: tip content: To help prevent edge artifacts when drawing textures, set textureEdge to "clamp" when calling dxCreateTexture - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawLine.yaml b/functions/Drawing/dxDrawLine.yaml index 0e4a4ef7..1ed2aa29 100644 --- a/functions/Drawing/dxDrawLine.yaml +++ b/functions/Drawing/dxDrawLine.yaml @@ -1,10 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawLine -client: +shared: name: dxDrawLine description: This function draws a 2D line across the screen \- rendered for **one** frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to display continuously. - parameters: [] + parameters: + - name: startX + type: int + description: An integer representing the absolute start X position of the line, + represented by pixels on the screen. + - name: startY + type: int + description: An integer representing the absolute start Y position of the line, + represented by pixels on the screen. + - name: endX + type: int + description: An integer representing the absolute end X position of the line, + represented by pixels on the screen. + - name: endY + type: int + description: An integer representing the absolute end Y position of the line, + represented by pixels on the screen. + - name: color + type: int + description: An integer of the hex color, produced using tocolor or 0xAARRGGBB + (AA = alpha, RR = red, GG = green, BB = blue). + - name: width + type: float + description: MISSING_PARAM_DESC + default: '1.0' + - name: postGUI + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxDrawLine-1.lua description: This example draws an 'X' across the screen. @@ -12,4 +40,9 @@ client: - path: examples/dxDrawLine-2.lua description: This example draws a couple of circles side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawLine3D.yaml b/functions/Drawing/dxDrawLine3D.yaml index ad67dfbb..17e3d64d 100644 --- a/functions/Drawing/dxDrawLine3D.yaml +++ b/functions/Drawing/dxDrawLine3D.yaml @@ -1,13 +1,54 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawLine3D -client: +shared: name: dxDrawLine3D description: This function draws a 3D line between two points in the 3D world \- rendered for **one** frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to display continuously. - parameters: [] + parameters: + - name: startX + type: float + description: The start X position of the 3D line, representing a coordinate in + the GTA world. + - name: startY + type: float + description: The start Y position of the 3D line, representing a coordinate in + the GTA world. + - name: startZ + type: float + description: The start Z position of the 3D line, representing a coordinate in + the GTA world. + - name: endX + type: float + description: The end X position of the 3D line, representing a coordinate in the + GTA world. + - name: endY + type: float + description: The end Y position of the 3D line, representing a coordinate in the + GTA world. + - name: endZ + type: float + description: The end Z position of the 3D line, representing a coordinate in the + GTA world. + - name: color + type: int + description: MISSING_PARAM_DESC + default: '0xFFFFFFFF' + - name: width + type: float + description: MISSING_PARAM_DESC + default: '1.0' + - name: stage + type: string + description: MISSING_PARAM_DESC + default: '"postfx"' examples: - path: examples/dxDrawLine3D-1.lua description: This is a small example of creating 3D Line / "Rope" between vehicle and player. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawMaterialLine3D.yaml b/functions/Drawing/dxDrawMaterialLine3D.yaml index c4ad4742..705d434e 100644 --- a/functions/Drawing/dxDrawMaterialLine3D.yaml +++ b/functions/Drawing/dxDrawMaterialLine3D.yaml @@ -1,12 +1,60 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawMaterialLine3D -client: +shared: name: dxDrawMaterialLine3D description: This function draws a textured 3D line between two points in the 3D world \- rendered for one frame. This should be used in conjunction with [onClientPreRender](/wiki/OnClientPreRender "OnClientPreRender") in order to display continuously. - parameters: [] + parameters: + - name: startX + type: float + description: MISSING_PARAM_DESC + - name: startY + type: float + description: MISSING_PARAM_DESC + - name: startZ + type: float + description: MISSING_PARAM_DESC + - name: endX + type: float + description: MISSING_PARAM_DESC + - name: endY + type: float + description: MISSING_PARAM_DESC + - name: endZ + type: float + description: MISSING_PARAM_DESC + - name: flipUV + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: material + type: element + description: A material to draw the line with. + - name: width + type: float + description: The width/thickness of the line in GTA world units. (This is 1/75th + of the width used in dxDrawLine3D) + - name: color + type: int + description: MISSING_PARAM_DESC + default: white + - name: string stage + type: '[' + description: MISSING_PARAM_DESC + default: '"postfx", ] float faceTowardX' + - name: faceTowardY + type: float + description: MISSING_PARAM_DESC + - name: faceTowardZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawMaterialLine3D-1.lua description: 'Drawsan imagein coordiantes -2422.68555, -608.78986, 132.56250:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawMaterialPrimitive.yaml b/functions/Drawing/dxDrawMaterialPrimitive.yaml index 4c584118..e93cfea0 100644 --- a/functions/Drawing/dxDrawMaterialPrimitive.yaml +++ b/functions/Drawing/dxDrawMaterialPrimitive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawMaterialPrimitive -client: +shared: name: dxDrawMaterialPrimitive description: 'This function draws a 2D primitive shape with material applied to it across the screen \- rendered for one frame. This should be used in conjunction @@ -10,12 +10,35 @@ client: to prevent possible blurring. Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...' - parameters: [] + parameters: + - name: pType + type: primitiveType + description: Type of primitive to be drawn. + - name: material + type: mixed + description: MISSING_PARAM_DESC + - name: postGUI + type: bool + description: A bool representing whether the line should be drawn on top of or + behind any ingame GUI (rendered by CEGUI). + - name: vertex1 + type: table + description: MISSING_PARAM_DESC + - name: vertex2 + type: table + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawMaterialPrimitive-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -25,3 +48,4 @@ client: - Missing section: Vertices format ' + requires_review: true diff --git a/functions/Drawing/dxDrawMaterialPrimitive3D.yaml b/functions/Drawing/dxDrawMaterialPrimitive3D.yaml index 74453a31..1bd899dc 100644 --- a/functions/Drawing/dxDrawMaterialPrimitive3D.yaml +++ b/functions/Drawing/dxDrawMaterialPrimitive3D.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawMaterialPrimitive3D -client: +shared: name: dxDrawMaterialPrimitive3D description: 'This function draws a 3D primitive shape with material applied to it in the 3D world \- rendered for one frame. This should be used in conjunction @@ -10,13 +10,42 @@ client: to prevent possible blurring. Power of two: 2px, 4px, 8px, 16px, 32px, 64px, 128px, 256px, 512px, 1024px...' - parameters: [] + parameters: + - name: pType + type: primitiveType + description: Type of primitive to be drawn. + - name: material + type: mixed + description: MISSING_PARAM_DESC + - name: stage + type: string + description: 'A string representing a stage at which the actual drawcall should + happen: prefx - Primitives are rendered before the color correction. This stage + makes primitives look natural to SA but colors could be distorted. postfx - + Primitives are rendered after the color correction. This stage conveys a color + from the function to a screen without distortions. postgui - Primitives are + rendered after GUI. The primitives should be drawn on top of or behind any ingame + GUI (rendered by CEGUI).' + - name: vertex1 + type: table + description: MISSING_PARAM_DESC + - name: vertex2 + type: table + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawMaterialPrimitive3D-1.lua description: This example draws the picture with the file name 'test.png' on the ground of Grove Street and adds a /flip command to flip it. The 'test.png' file needs to be included in themeta.xmlin order for this example to work. side: client + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. notes: - type: info content: When a 3D draw call is issued by any such material MTA function then @@ -38,7 +67,6 @@ client: set of vertices for the purpose shown above. By using this function in such a way it can perform all the operations in the same quality such as the simpler dxDrawMaterialPrimitive function. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -48,3 +76,4 @@ client: - Missing section: Vertices format ' + requires_review: true diff --git a/functions/Drawing/dxDrawMaterialSectionLine3D.yaml b/functions/Drawing/dxDrawMaterialSectionLine3D.yaml index 6d5f14fc..64304ec7 100644 --- a/functions/Drawing/dxDrawMaterialSectionLine3D.yaml +++ b/functions/Drawing/dxDrawMaterialSectionLine3D.yaml @@ -1,12 +1,72 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawMaterialSectionLine3D -client: +shared: name: dxDrawMaterialSectionLine3D description: This function draws a textured 3D line between two points in the 3D world \- rendered for one frame. This should be used in conjunction with [onClientPreRender](/wiki/OnClientPreRender "OnClientPreRender") in order to display continuously. - parameters: [] + parameters: + - name: startX + type: float + description: MISSING_PARAM_DESC + - name: startY + type: float + description: MISSING_PARAM_DESC + - name: startZ + type: float + description: MISSING_PARAM_DESC + - name: endX + type: float + description: MISSING_PARAM_DESC + - name: endY + type: float + description: MISSING_PARAM_DESC + - name: endZ + type: float + description: MISSING_PARAM_DESC + - name: u + type: float + description: the absolute X coordinate of the top left corner of the section + - name: v + type: float + description: the absolute Y coordinate of the top left corner of the section + - name: usize + type: float + description: the absolute width of the section + - name: vsize + type: float + description: the absolute height of the section + - name: flipUV + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: material + type: element + description: A material to draw the line with. + - name: width + type: float + description: The width/thickness of the line in GTA world units. (This is 1/75th + of the width used in dxDrawLine3D) + - name: color + type: int + description: MISSING_PARAM_DESC + default: white + - name: bool stage + type: '[' + description: MISSING_PARAM_DESC + default: '"postfx", ] float faceTowardX' + - name: faceTowardY + type: float + description: MISSING_PARAM_DESC + - name: faceTowardZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawMaterialSectionLine3D-1.lua description: This example draws corona like effects near the player side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawModel3D.yaml b/functions/Drawing/dxDrawModel3D.yaml index 1cd09b03..f18e7ca3 100644 --- a/functions/Drawing/dxDrawModel3D.yaml +++ b/functions/Drawing/dxDrawModel3D.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawModel3D -client: +shared: name: dxDrawModel3D description: This function draws a 3D model \- rendered for **one** frame. Drawn models are indistinguishable from this one created by [createObject](/wiki/CreateObject @@ -9,11 +9,57 @@ client: this function is called. A model can be loaded and unloaded with the help of [engineStreamingRequestModel](/wiki/EngineStreamingRequestModel "EngineStreamingRequestModel") and [engineStreamingReleaseModel](/wiki/EngineStreamingReleaseModel "EngineStreamingReleaseModel") functions. - parameters: [] + parameters: + - name: modelId + type: int + description: object you want to draw, must be regular object, you can not draw + vehicles and peds. See Object IDs for a list of model IDs. + - name: positionX + type: float + description: A floating point number representing the X coordinate on the map. + - name: positionY + type: float + description: A floating point number representing the Y coordinate on the map. + - name: positionZ + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rotationX + type: float + description: A floating point number representing the rotation about the X axis + in degrees. + - name: rotationY + type: float + description: A floating point number representing the rotation about the Y axis + in degrees. + - name: rotationZ + type: float + description: A floating point number representing the rotation about the Z axis + in degrees. + - name: scaleX + type: float + description: a float containing the new scale on the X axis + default: '1' + - name: scaleY + type: float + description: a float containing the new scale on the Y axis + default: '1' + - name: scaleZ + type: float + description: a float containing the new scale on the Z axis + default: '1' + - name: lighting + type: float + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/dxDrawModel3D-1.lua description: This example draws a model side: client + returns: + values: + - type: bool + name: value + description: Returns true if the operation was successful, false otherwise. notes: - type: important content: You can not use this function to draw vehicles and ped @@ -22,4 +68,4 @@ client: models as you want - type: important content: You can not render model to render target. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawPrimitive.yaml b/functions/Drawing/dxDrawPrimitive.yaml index 584fd072..537a98e8 100644 --- a/functions/Drawing/dxDrawPrimitive.yaml +++ b/functions/Drawing/dxDrawPrimitive.yaml @@ -1,10 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawPrimitive -client: +shared: name: dxDrawPrimitive description: This function draws a 2D primitive shape across the screen \- rendered for one frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to display continuously. - parameters: [] + parameters: + - name: pType + type: string + description: Type of primitive to be drawn. + - name: postGUI + type: bool + description: A bool representing whether the line should be drawn on top of or + behind any ingame GUI (rendered by CEGUI). + - name: vertex1 + type: table + description: MISSING_PARAM_DESC + - name: vertex2 + type: table + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawPrimitive-1.lua description: This is a small example that creates trianglefan primitive with vertices @@ -19,7 +35,11 @@ client: circle"-symbol similar to what some modern games like using to indicate loading or cloud saving in progress. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -29,3 +49,4 @@ client: - Missing section: Vertices format ' + requires_review: true diff --git a/functions/Drawing/dxDrawPrimitive3D.yaml b/functions/Drawing/dxDrawPrimitive3D.yaml index b7b15820..f89b6c9f 100644 --- a/functions/Drawing/dxDrawPrimitive3D.yaml +++ b/functions/Drawing/dxDrawPrimitive3D.yaml @@ -1,13 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawPrimitive3D -client: +shared: name: dxDrawPrimitive3D description: This function draws a 3D primitive in the 3D world \- rendered for **one** frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to display continuously. - parameters: [] + parameters: + - name: primitiveType + type: string + description: 'The type of primitive to be drawn. This could be:' + - name: stage + type: string + description: MISSING_PARAM_DESC + - name: vertex1 + type: table + description: MISSING_PARAM_DESC + - name: vertex2 + type: table + description: MISSING_PARAM_DESC + - name: vertex3 + type: table + description: MISSING_PARAM_DESC + - name: vertex4 + type: table + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawPrimitive3D-1.lua description: This is a small example of creating 3D Primitive object with 4 vertex that will spawn on 'The Well Stacked Pizza Co.' in Idlewood. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawRectangle.yaml b/functions/Drawing/dxDrawRectangle.yaml index 845e01ae..0f6f3b75 100644 --- a/functions/Drawing/dxDrawRectangle.yaml +++ b/functions/Drawing/dxDrawRectangle.yaml @@ -1,13 +1,48 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawRectangle -client: +shared: name: dxDrawRectangle description: This function draws a 2D rectangle across the screen \- rendered for **one** frame. This should be used in conjunction with [onClientRender](/wiki/OnClientRender "OnClientRender") in order to display continuously. - parameters: [] + parameters: + - name: startX + type: float + description: An float representing the absolute origin X position of the rectangle, + represented by pixels on the screen. + - name: startY + type: float + description: An float representing the absolute origin Y position of the rectangle, + represented by pixels on the screen. + - name: width + type: float + description: An float representing the width of the rectangle, drawn in a right + direction from the origin. + - name: height + type: float + description: An float representing the height of the rectangle, drawn in a downwards + direction from the origin. + - name: color + type: int + description: the hex color of the rectangle, produced using tocolor or 0xAARRGGBB + (AA = alpha, RR = red, GG = green, BB = blue). + default: white + - name: postGUI + type: bool + description: A bool representing whether the line should be drawn on top of or + behind any ingame GUI. + default: 'false' + - name: subPixelPositioning + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxDrawRectangle-1.lua description: Example of MOTD (message of the day), made using DxDrawText, -Line and -Rectangle. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxDrawText.yaml b/functions/Drawing/dxDrawText.yaml index 9b47579d..0b2250b4 100644 --- a/functions/Drawing/dxDrawText.yaml +++ b/functions/Drawing/dxDrawText.yaml @@ -1,10 +1,95 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawText -client: +shared: name: dxDrawText description: Draws a string of text on the screen for one frame. In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see [onClientRender](/wiki/OnClientRender "OnClientRender")). - parameters: [] + parameters: + - name: text + type: string + description: the text to draw + - name: leftX + type: float + description: the absolute X coordinate of the top left corner of the text + - name: topY + type: float + description: the absolute Y coordinate of the top left corner of the text + - name: rightX + type: float + description: the absolute X coordinate of the right side of the text bounding + box. Used for text aligning, clipping and word breaking. + default: leftX + - name: bottomY + type: float + description: the absolute Y coordinate of the bottom side of the text bounding + box. Used for text aligning, clipping and word breaking. + default: topY + - name: color + type: int + description: the color of the text, a value produced by tocolor or 0xAARRGGBB + (AA = alpha, RR = red, GG = green, BB = blue). + default: white + - name: textSize + type: float + description: the size of the text scale. + - name: font + type: mixed + description: 'Either a custom DX font element or the name of a built-in DX font: + Note: Some fonts are incompatible with certain languages such as Arabic. "default": + Tahoma "default-bold": Tahoma Bold "clear": Verdana "arial": Arial "sans": Microsoft + Sans Serif "pricedown": Pricedown (GTA''s theme text) "bankgothic": Bank Gothic + Medium "diploma": Diploma Regular "beckett": Beckett Regular "unifont": Unifont' + default: '"default"' + - name: alignX + type: string + description: horizontal alignment of the text within the bounding box. Can be + "left" , "center" or "right" . + default: '"left"' + - name: alignY + type: string + description: vertical alignment of the text within the bounding box. Can be "top" + , "center" or "bottom" . + default: '"top"' + - name: clip + type: bool + description: if set to true , the parts of the text that don't fit within the + bounding box will be cut off. + default: 'false' + - name: wordBreak + type: bool + description: if set to true , the text will wrap to a new line whenever it reaches + the right side of the bounding box. If false , the text will always be completely + on one line. + default: 'false' + - name: postGUI + type: bool + description: A bool representing whether the text should be drawn on top of or + behind any ingame GUI (rendered by CEGUI). + default: 'false' + - name: colorCoded + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: subPixelPositioning + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: fRotation + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: fRotationCenterX + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: fRotationCenterY + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: fLineSpacing + type: float + description: MISSING_PARAM_DESC + default: '0.0' examples: - path: examples/dxDrawText-1.lua description: This example code will add the current zone name in the lower left @@ -13,9 +98,14 @@ client: - path: examples/dxDrawText-2.lua description: This example shows how to set both horizontal and vertical text size. side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: info content: The function is known to optimize certain drawing scenarios related to scaling and opacity (so called text on raster optimisation ). You can find out more about it here . - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxDrawWiredSphere.yaml b/functions/Drawing/dxDrawWiredSphere.yaml index bc306202..3e057a97 100644 --- a/functions/Drawing/dxDrawWiredSphere.yaml +++ b/functions/Drawing/dxDrawWiredSphere.yaml @@ -1,12 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxDrawWiredSphere -client: +shared: name: dxDrawWiredSphere description: This function drawn same sphere as /showcol. It provides 4 levels of iterations which mean density of sphere. Adjust radius to iterations to get optimum density of mesh. About 50 spheres with iterations \= 4 can cause fps drop. - parameters: [] + parameters: + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC + - name: radius + type: float + description: A radius of sphere. + - name: theColor + type: int + description: A color of sphere from tocolor function. + - name: fLineWidth + type: float + description: A width of line + - name: iterations + type: uint + description: MISSING_PARAM_DESC examples: - path: examples/dxDrawWiredSphere-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxGetBlendMode.yaml b/functions/Drawing/dxGetBlendMode.yaml index 64dc6d54..2dede0d8 100644 --- a/functions/Drawing/dxGetBlendMode.yaml +++ b/functions/Drawing/dxGetBlendMode.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetBlendMode -client: +shared: name: dxGetBlendMode description: This function returns the current blend mode for the dxDraw functions. The blend mode is set using [dxSetBlendMode](/wiki/DxSetBlendMode "DxSetBlendMode") @@ -8,4 +8,9 @@ client: - path: examples/dxGetBlendMode-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: string + name: value + description: 'Returns the current blend mode, which can be one of:' + requires_review: true diff --git a/functions/Drawing/dxGetFontHeight.yaml b/functions/Drawing/dxGetFontHeight.yaml index 02e2b636..a11f039e 100644 --- a/functions/Drawing/dxGetFontHeight.yaml +++ b/functions/Drawing/dxGetFontHeight.yaml @@ -1,15 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetFontHeight -client: +shared: name: dxGetFontHeight description: This function retrieves the theoretical height of a certain piece of text, if it were to be drawn using [dxDrawText](/wiki/DxDrawText "DxDrawText"). - parameters: [] + parameters: + - name: scale + type: float + description: The size of the text. + default: '1' + - name: font + type: mixed + description: 'Either a custom DX font element or the name of a built-in dx font: + "default": Tahoma "default-bold": Tahoma Bold "clear": Verdana "arial": Arial + "sans": Microsoft Sans Serif "pricedown": Pricedown (GTA''s theme text) "bankgothic": + Bank Gothic Medium "diploma": Diploma Regular "beckett": Beckett Regular "unifont": + Unifont' + default: '"default"' examples: - path: examples/dxGetFontHeight-1.lua description: '' side: client + returns: + values: + - type: int + name: value + description: Returns an integer of the height of the text. + oop: + element: font + note: This syntax requires you to ignore the font argument above + method: getHeight + static: false notes: - type: info content: The returned height will be in logical units which are 1.75 times the actual pixel height. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxGetMaterialSize.yaml b/functions/Drawing/dxGetMaterialSize.yaml index 9751af2e..a747e662 100644 --- a/functions/Drawing/dxGetMaterialSize.yaml +++ b/functions/Drawing/dxGetMaterialSize.yaml @@ -1,11 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetMaterialSize -client: +shared: name: dxGetMaterialSize description: This gets the dimensions of the supplied [material](/wiki/Material "Material") element. - parameters: [] + parameters: + - name: material + type: element + description: MISSING_PARAM_DESC examples: - path: examples/dxGetMaterialSize-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int [ + name: value2 + - type: int] + name: value3 + description: "Returns two ints representing the width and height in pixels of\ + \ the material, or false if an invalid parameter was passed to the function.\ + \ \nIf the material is a volume texture, this function will return three ints\ + \ representing the width, height and depth." + oop: + element: material + method: getSize + static: false + requires_review: true diff --git a/functions/Drawing/dxGetPixelColor.yaml b/functions/Drawing/dxGetPixelColor.yaml index dd7ca2e7..ddd70301 100644 --- a/functions/Drawing/dxGetPixelColor.yaml +++ b/functions/Drawing/dxGetPixelColor.yaml @@ -1,12 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetPixelColor -client: +shared: name: dxGetPixelColor description: This function gets the color of a single pixel from [pixels](/wiki/Texture_pixels "Texture pixels") contained in a string. It only works with '**plain'** format pixels. - parameters: [] + parameters: + - name: pixels + type: string + description: MISSING_PARAM_DESC + - name: x + type: int + description: The X coordinate for the pixel + - name: "y" + type: int + description: The Y coordinate for the pixel examples: - path: examples/dxGetPixelColor-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: Returns 4 int s representing the rgba color value of the pixel if + succesful, or false if invalid arguments were passed to the function. + requires_review: true diff --git a/functions/Drawing/dxGetPixelsFormat.yaml b/functions/Drawing/dxGetPixelsFormat.yaml index 8699b212..4be3b0ec 100644 --- a/functions/Drawing/dxGetPixelsFormat.yaml +++ b/functions/Drawing/dxGetPixelsFormat.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetPixelsFormat -client: +shared: name: dxGetPixelsFormat description: This function returns the format of [pixels](/wiki/Texture_pixels "Texture pixels") contained in a string. - parameters: [] + parameters: + - name: pixels + type: string + description: MISSING_PARAM_DESC examples: - path: examples/dxGetPixelsFormat-1.lua description: The example loads an image, gets its pixels, and outputs the pixels format. (You can usethisimage to test.) side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the format of the pixels if successful (' plain' or ' png' + or ' jpeg' or ' dds' ), false if invalid arguments were passed to the function. + requires_review: true diff --git a/functions/Drawing/dxGetPixelsSize.yaml b/functions/Drawing/dxGetPixelsSize.yaml index b0dc1be9..a035ef47 100644 --- a/functions/Drawing/dxGetPixelsSize.yaml +++ b/functions/Drawing/dxGetPixelsSize.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetPixelsSize -client: +shared: name: dxGetPixelsSize description: This function gets the dimensions of [pixels](/wiki/Texture_pixels "Texture pixels") contained in a string. It works with all pixel formats. - parameters: [] + parameters: + - name: pixels + type: string + description: The pixels to get the dimensions of examples: - path: examples/dxGetPixelsSize-1.lua description: The example loads an image, gets its pixels, and outputs the pixels size. (You can usethisimage to test.) side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns width and height of the pixels if successful, false if invalid + arguments were passed to the function. + requires_review: true diff --git a/functions/Drawing/dxGetStatus.yaml b/functions/Drawing/dxGetStatus.yaml index 077b6bff..2e028001 100644 --- a/functions/Drawing/dxGetStatus.yaml +++ b/functions/Drawing/dxGetStatus.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetStatus -client: +shared: name: dxGetStatus description: This function gets information about various internal datum. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/dxGetStatus-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with the following entries:' + requires_review: true diff --git a/functions/Drawing/dxGetTextSize.yaml b/functions/Drawing/dxGetTextSize.yaml index 16de7ddf..28b61fd0 100644 --- a/functions/Drawing/dxGetTextSize.yaml +++ b/functions/Drawing/dxGetTextSize.yaml @@ -1,13 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetTextSize -client: +shared: name: dxGetTextSize description: This function retrieves the theoretical width and height (in pixels) of a certain piece of text, if it were to be drawn using [dxDrawText](/wiki/DxDrawText "DxDrawText"). - parameters: [] + parameters: + - name: text + type: string + description: A string representing the text for which you wish to retrieve with + width for. + - name: width + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: scaleXY + type: float + description: MISSING_PARAM_DESC + default: 1.0 [, float scaleY = 1.0 ] + - name: font + type: mixed + description: MISSING_PARAM_DESC + default: '"default"' + - name: wordBreak + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: colorCoded + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxGetTextSize-1.lua description: This example draws a text with black background at the bottom right corner of the screen. side: client - incomplete: true + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns two floats representing the width and height of the text + in pixels. + oop: + element: font + note: This syntax requires you to ignore the font argument above + method: getSize + static: false + requires_review: true diff --git a/functions/Drawing/dxGetTextWidth.yaml b/functions/Drawing/dxGetTextWidth.yaml index 52053f25..5085fac4 100644 --- a/functions/Drawing/dxGetTextWidth.yaml +++ b/functions/Drawing/dxGetTextWidth.yaml @@ -1,12 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetTextWidth -client: +shared: name: dxGetTextWidth description: This function retrieves the theoretical width (in pixels) of a certain piece of text, if it were to be drawn using [dxDrawText](/wiki/DxDrawText "DxDrawText"). - parameters: [] + parameters: + - name: text + type: string + description: A string representing the text for which you wish to retrieve with + width for. + - name: scale + type: float + description: MISSING_PARAM_DESC + default: '1' + - name: font + type: mixed + description: MISSING_PARAM_DESC + default: '"default"' + - name: bColorCoded + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxGetTextWidth-1.lua description: This will show you the width of a message in a normal chatbox sent by a player side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns the float of the width of the text (in pixels). + oop: + element: font + note: This syntax requires you to ignore the font argument above + method: getTextWidth + static: false + requires_review: true diff --git a/functions/Drawing/dxGetTexturePixels.yaml b/functions/Drawing/dxGetTexturePixels.yaml index b2042340..86762b87 100644 --- a/functions/Drawing/dxGetTexturePixels.yaml +++ b/functions/Drawing/dxGetTexturePixels.yaml @@ -1,14 +1,53 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxGetTexturePixels -client: +shared: name: dxGetTexturePixels description: This function fetches the [pixels](/wiki/Texture_pixels "Texture pixels") from a [texture](/wiki/Texture "Texture") element. It can be used with a standard texture, render target or screen source. - parameters: [] + parameters: + - name: surfaceIndex + type: int + description: 'Desired slice to get if the texture is a volume texture, or desired + face to get if the texture is a cube map. (Cube map faces: 0=+X 1=-X 2=+Y 3=-Y + 4=+Z 5=-Z)' + default: '0' + - name: texture + type: element + description: MISSING_PARAM_DESC + - name: pixelsFormat + type: string + description: MISSING_PARAM_DESC + default: '"plain" [, string textureFormat = "unknown"] [, bool mipmaps = true]' + - name: x + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: "y" + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: width + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: height + type: int + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/dxGetTexturePixels-1.lua description: '' side: client + returns: + values: + - type: string + name: value + description: Returns pixels string if successful, false if invalid arguments were + passed to the function. + oop: + element: texture + method: getPixels + static: false notes: - type: info content: This function is slow and not something you want to be doing once a frame. @@ -18,4 +57,4 @@ client: - type: important content: If the user has not enabled screen uploading in the settings, the function will use a 32x32 empty texture as a basis. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxIsAspectRatioAdjustmentEnabled.yaml b/functions/Drawing/dxIsAspectRatioAdjustmentEnabled.yaml index 8e975e6b..5b05385b 100644 --- a/functions/Drawing/dxIsAspectRatioAdjustmentEnabled.yaml +++ b/functions/Drawing/dxIsAspectRatioAdjustmentEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxIsAspectRatioAdjustmentEnabled -client: +shared: name: dxIsAspectRatioAdjustmentEnabled description: This function gets the current aspect ratio set by [dxSetAspectRatioAdjustmentEnabled](/wiki/DxSetAspectRatioAdjustmentEnabled "DxSetAspectRatioAdjustmentEnabled"). @@ -9,4 +9,12 @@ client: description: This example will draw the aspect ratio to screen if aspect ratio was enabled previously. side: client - incomplete: true + returns: + values: + - type: bool + name: value1 + - type: float + name: value2 + description: This example will draw the aspect ratio to screen if aspect ratio + was enabled previously. + requires_review: true diff --git a/functions/Drawing/dxSetAspectRatioAdjustmentEnabled.yaml b/functions/Drawing/dxSetAspectRatioAdjustmentEnabled.yaml index 20c6a625..ad3a9364 100644 --- a/functions/Drawing/dxSetAspectRatioAdjustmentEnabled.yaml +++ b/functions/Drawing/dxSetAspectRatioAdjustmentEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetAspectRatioAdjustmentEnabled -client: +shared: name: dxSetAspectRatioAdjustmentEnabled description: 'This function allows for the positioning of dxDraw calls to be automatically adjusted according to the client''s aspect ratio setting. This lasts for a single @@ -7,9 +7,21 @@ client: "OnClientRender"), [onClientPreRender](/wiki/OnClientPreRender "OnClientPreRender") and [onClientHUDRender](/wiki/OnClientHUDRender "OnClientHUDRender"). So the function has to be called every frame, just like dxDraws.' - parameters: [] + parameters: + - name: bEnabled + type: bool + description: Should the adjustment be enabled or disabled. + - name: sourceRatio + type: float + description: MISSING_PARAM_DESC + default: 4/3 examples: - path: examples/dxSetAspectRatioAdjustmentEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true when it was changed successfully, or false otherwise. + requires_review: true diff --git a/functions/Drawing/dxSetBlendMode.yaml b/functions/Drawing/dxSetBlendMode.yaml index 767b9f90..e75b2b7a 100644 --- a/functions/Drawing/dxSetBlendMode.yaml +++ b/functions/Drawing/dxSetBlendMode.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetBlendMode -client: +shared: name: dxSetBlendMode description: This function sets the current blend mode for the dxDraw functions. Changing the blend mode can increase the quality when drawing text or certain @@ -7,10 +7,19 @@ client: drawing text to a render target, and **add** when drawing the render target to the screen. Don't forget to restore the default **blend** at the end \- See the example below. - parameters: [] + parameters: + - name: blendMode + type: string + description: MISSING_PARAM_DESC examples: - path: examples/dxSetBlendMode-1.lua description: 'This example shows how to usemodulate_addandaddto avoid quality problems when using a render target:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, or false if invalid arguments were passed + to the function. + requires_review: true diff --git a/functions/Drawing/dxSetPixelColor.yaml b/functions/Drawing/dxSetPixelColor.yaml index c6ac42d8..d05fefa4 100644 --- a/functions/Drawing/dxSetPixelColor.yaml +++ b/functions/Drawing/dxSetPixelColor.yaml @@ -1,13 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetPixelColor -client: +shared: name: dxSetPixelColor description: This function sets the color of a single pixel for [pixels](/wiki/Texture_pixels "Texture pixels") contained in a string. It only works with '**plain'** format pixels. - parameters: [] + parameters: + - name: pixels + type: string + description: MISSING_PARAM_DESC + - name: x + type: int + description: The X coordinate for the pixel + - name: "y" + type: int + description: The Y coordinate for the pixel + - name: r + type: int + description: The red channel for the color (0-255) + - name: g + type: int + description: The green channel for the color (0-255) + - name: b + type: int + description: The blue channel for the color (0-255) + - name: a + type: int + description: The alpha channel for the color (0-255) + default: '255' examples: - path: examples/dxSetPixelColor-1.lua description: This example creates a 64x64 texture with random pixel colors, and draw it on the screen. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, or false if invalid arguments were passed + to the function. + requires_review: true diff --git a/functions/Drawing/dxSetRenderTarget.yaml b/functions/Drawing/dxSetRenderTarget.yaml index ad5729d4..67a6c52b 100644 --- a/functions/Drawing/dxSetRenderTarget.yaml +++ b/functions/Drawing/dxSetRenderTarget.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetRenderTarget -client: +shared: name: dxSetRenderTarget description: This function changes the drawing destination for the dx functions. It can be used to select a previously created render target, or if called with no arguments, restore drawing directly to the screen. - parameters: [] + parameters: + - name: renderTarget + type: element + description: The render target element whose pixels we want to draw on. + - name: clear + type: bool + description: If set to true, the render target will also be cleared. + default: 'false' examples: - path: examples/dxSetRenderTarget-1.lua description: '' @@ -13,7 +20,16 @@ client: description: This example shows how you can prepare render target contents at anytime (from client version 1.3.0-9.04431) side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the render target was successfully changed, false + otherwise. + oop: + element: rendertarget + method: setAsTarget + static: false meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -21,3 +37,4 @@ client: - Missing section: Usage restrictions ' + requires_review: true diff --git a/functions/Drawing/dxSetShaderTessellation.yaml b/functions/Drawing/dxSetShaderTessellation.yaml index 5e8fd079..ebcaa245 100644 --- a/functions/Drawing/dxSetShaderTessellation.yaml +++ b/functions/Drawing/dxSetShaderTessellation.yaml @@ -1,15 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetShaderTessellation -client: +shared: name: dxSetShaderTessellation description: This function sets the amount of geometric sub\-division to use when drawing a [shader](/wiki/Shader "Shader") element with [dxDrawImage](/wiki/DxDrawImage "DxDrawImage"). - parameters: [] + parameters: + - name: theShader + type: element + description: The shader element whose tessellation is to be changed + - name: tessellationX + type: int + description: The number of sub-division points along the X axis. Range is 1 to + 500. + - name: tessellationY + type: int + description: The number of sub-division points along the Y axis. Range is 1 to + 500. examples: - path: examples/dxSetShaderTessellation-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the shader element's tessellation was successfully + changed, false otherwise. + oop: + element: shader + method: setTessellation + static: false meta: - needs_checking: The example should depict better how does this function actually work with a texture. - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxSetShaderTransform.yaml b/functions/Drawing/dxSetShaderTransform.yaml index bc847fc0..c48468ac 100644 --- a/functions/Drawing/dxSetShaderTransform.yaml +++ b/functions/Drawing/dxSetShaderTransform.yaml @@ -1,11 +1,64 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetShaderTransform -client: +shared: name: dxSetShaderTransform description: This function applies a 3D transformation to a [shader](/wiki/Shader "Shader") element when it is drawn with [dxDrawImage](/wiki/DxDrawImage "DxDrawImage"). - parameters: [] + parameters: + - name: theShader + type: element + description: The shader element whose transformation is to be changed + - name: rotationX + type: float + description: Rotation angle in degrees around the X axis (Left,right). This will + make the shader rotate along its width. + - name: rotationY + type: float + description: Rotation angle in degrees around the Y axis (Up,down). This will + make the shader rotate along its height. + - name: rotationZ + type: float + description: Rotation angle in degrees around the Z axis (In,out). This will make + the shader rotate in a similar way to the rotation argument in dxDrawImage . + - name: rotationCenterOffsetX + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: rotationCenterOffsetY + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: rotationCenterOffsetZ + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: bRotationCenterOffsetOriginIsScreen + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: perspectiveCenterOffsetX + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: perspectiveCenterOffsetY + type: float + description: MISSING_PARAM_DESC + default: '0' + - name: bPerspectiveCenterOffsetOriginIsScreen + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/dxSetShaderTransform-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the shader element's transform was successfully changed, + false otherwise. + oop: + element: shader + method: setTransform + static: false + requires_review: true diff --git a/functions/Drawing/dxSetShaderValue.yaml b/functions/Drawing/dxSetShaderValue.yaml index da598b67..d364c29d 100644 --- a/functions/Drawing/dxSetShaderValue.yaml +++ b/functions/Drawing/dxSetShaderValue.yaml @@ -1,13 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetShaderValue -client: +shared: name: dxSetShaderValue description: This sets a named parameter for a [shader](/wiki/Shader "Shader") element - parameters: [] + parameters: + - name: theShader + type: element + description: The shader element whose parameter is to be changed + - name: parameterName + type: string + description: The name of parameter + - name: value + type: mixed + description: The value to set, which can be a texture , a bool, a number or a + list of numbers( max 16 floats(numbers) ) examples: - path: examples/dxSetShaderValue-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the shader element's parameter was successfully changed, + false otherwise. + oop: + element: shader + method: setValue + static: false notes: - type: important content: It's enough to set the texture only once if it's a render target - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxSetTestMode.yaml b/functions/Drawing/dxSetTestMode.yaml index ab5172ba..233b48ba 100644 --- a/functions/Drawing/dxSetTestMode.yaml +++ b/functions/Drawing/dxSetTestMode.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetTestMode -client: +shared: name: dxSetTestMode description: This function is used for testing scripts written using [guiCreateFont](/wiki/GuiCreateFont "GuiCreateFont"), [dxCreateFont](/wiki/DxCreateFont "DxCreateFont"), [dxCreateShader](/wiki/DxCreateShader "DxCreateShader") and [dxCreateRenderTarget](/wiki/DxCreateRenderTarget "DxCreateRenderTarget"). - parameters: [] + parameters: + - name: testMode + type: string + description: MISSING_PARAM_DESC examples: - path: examples/dxSetTestMode-1.lua description: With this example you can use /setmode command to set the test mode. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the test mode was successfully set, false otherwise. + requires_review: true diff --git a/functions/Drawing/dxSetTextureEdge.yaml b/functions/Drawing/dxSetTextureEdge.yaml index e5f4315c..1b4dd089 100644 --- a/functions/Drawing/dxSetTextureEdge.yaml +++ b/functions/Drawing/dxSetTextureEdge.yaml @@ -1,13 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetTextureEdge -client: +shared: name: dxSetTextureEdge description: 'This functions allows you to change the edge handling after creating the texture. [![TextureEdges.jpg](/images/thumb/0/08/TextureEdges.jpg/600px-TextureEdges.jpg)](/wiki/File:TextureEdges.jpg)' - parameters: [] + parameters: + - name: theTexture + type: texture + description: The affected texture + - name: textureEdge + type: string + description: The texture edge mode. Available modes are wrap, mirror, clamp, border, + mirror-once + - name: border-color + type: int + description: If textureEdge is set to border, you are able to define a border + color here examples: - path: examples/dxSetTextureEdge-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + oop: + element: texture + method: setEdge + static: false + requires_review: true diff --git a/functions/Drawing/dxSetTexturePixels.yaml b/functions/Drawing/dxSetTexturePixels.yaml index 6905aa10..8127b020 100644 --- a/functions/Drawing/dxSetTexturePixels.yaml +++ b/functions/Drawing/dxSetTexturePixels.yaml @@ -1,17 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxSetTexturePixels -client: +shared: name: dxSetTexturePixels description: This function sets the [pixels](/wiki/Texture_pixels "Texture pixels") of a [texture](/wiki/Texture "Texture") element. It can be used with a standard texture, render target or screen source. Only '**plain'** format pixels please. - parameters: [] + parameters: + - name: surfaceIndex + type: int + description: 'Desired slice to set if the texture is a volume texture, or desired + face to set if the texture is a cube map. (Cube map faces: 0=+X 1=-X 2=+Y 3=-Y + 4=+Z 5=-Z)' + default: '0' + - name: texture + type: element + description: MISSING_PARAM_DESC + - name: pixels + type: string + description: MISSING_PARAM_DESC + - name: x + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: "y" + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: width + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: height + type: int + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/dxSetTexturePixels-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns a string if successful, false if invalid arguments were passed + to the function. + oop: + element: texture + method: setPixels + static: false notes: - type: info content: This function is slow and not something you want to be doing once a frame. It is very slow when setting pixels to a render target or screen source. And is very slow indeed if the texture format is not "argb" . - incomplete: true + requires_review: true diff --git a/functions/Drawing/dxUpdateScreenSource.yaml b/functions/Drawing/dxUpdateScreenSource.yaml index 72d4ae9e..b429899d 100644 --- a/functions/Drawing/dxUpdateScreenSource.yaml +++ b/functions/Drawing/dxUpdateScreenSource.yaml @@ -1,11 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DxUpdateScreenSource -client: +shared: name: dxUpdateScreenSource description: This function updates the contents of a screen source [texture](/wiki/Texture "Texture") with the screen output from GTA - parameters: [] + parameters: + - name: screenSource + type: element + description: The screen source element whose pixels we want to fill with the screen + capture + - name: resampleNow + type: bool + description: A bool to indicate if the screen should be captured immediately. + The default is false which means the screen from the end of the previous frame + is used (better for performance and consistency). Use true for layering fullscreen + effects. + default: 'false' examples: - path: examples/dxUpdateScreenSource-1.lua description: This example will update the screen capture when F7 is pressed side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the screen was successfully captured, false otherwise. + oop: + element: dxscreensource + method: update + static: false + requires_review: true diff --git a/functions/Effects/createEffect.yaml b/functions/Effects/createEffect.yaml index 3f7e79c8..41d059eb 100644 --- a/functions/Effects/createEffect.yaml +++ b/functions/Effects/createEffect.yaml @@ -1,17 +1,58 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateEffect -client: +shared: name: createEffect description: Creates an [effect](/wiki/Element/Effect "Element/Effect") on specified position. - parameters: [] + parameters: + - name: name + type: string + description: A string contains effect name . + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rX + type: float + description: A floating point number representing the rotation about the X axis + in degrees. + - name: rY + type: float + description: A floating point number representing the rotation about the Y axis + in degrees. + - name: rZ + type: float + description: A floating point number representing the rotation about the Z axis + in degrees. + - name: drawDistance + type: float + description: A floating point number between 1 and 8191 which represents the draw + distance of the effect, or 0 to use the default draw distance. + default: '0' + - name: soundEnable + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/createEffect-1.lua description: This example allows you to create effect by using 'B' key (use mouse scroll up/down to switch effect). side: client + returns: + values: + - type: effect + name: value + description: Returns the effect element if creation was successful, false otherwise. + oop: + element: effect + constructorclass: Effect notes: - type: info content: Not all effects support rotation (e.g. the "fire" - effect doesn't). - type: info content: All effects have their own duration. - incomplete: true + requires_review: true diff --git a/functions/Effects/fxAddBlood.yaml b/functions/Effects/fxAddBlood.yaml index ed90cb65..09fc2f46 100644 --- a/functions/Effects/fxAddBlood.yaml +++ b/functions/Effects/fxAddBlood.yaml @@ -1,10 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddBlood -client: +shared: name: fxAddBlood description: Creates a blood splatter particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: count + type: int + description: the number of flying droplets to create. + default: '1' + - name: brightness + type: float + description: the brightness. Ranges from 0 (almost black) to 1 (normal color). + default: '1.0' examples: - path: examples/fxAddBlood-1.lua description: This example creates blood effects when a player gets shot. side: client - incomplete: true + returns: + values: + - type: bool + name: value + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddBulletImpact.yaml b/functions/Effects/fxAddBulletImpact.yaml index e0b0b7fa..0f074a4f 100644 --- a/functions/Effects/fxAddBulletImpact.yaml +++ b/functions/Effects/fxAddBulletImpact.yaml @@ -1,12 +1,51 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddBulletImpact -client: +shared: name: fxAddBulletImpact description: Creates a bullet impact particle effect, consisting of a small smoke cloud and a number of sparks. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: smokeSize + type: int + description: the size of the smoke cloud. + default: '1' + - name: sparkCount + type: int + description: the number of sparks to create. + default: '1' + - name: smokeIntensity + type: float + description: the amount/transparency of smoke, ranges from 0 to 1. + default: '1.0' examples: - path: examples/fxAddBulletImpact-1.lua description: This example will create a Bullet Impact Effect on the position of the bullet impact. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddBulletSplash.yaml b/functions/Effects/fxAddBulletSplash.yaml index a340b067..eb5f1d1b 100644 --- a/functions/Effects/fxAddBulletSplash.yaml +++ b/functions/Effects/fxAddBulletSplash.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddBulletSplash -client: +shared: name: fxAddBulletSplash description: This function creates a bullet splash particle effect, normally created when shooting into water. - parameters: [] + parameters: + - name: posX + type: float + description: A float representing the x position of the splash + - name: posY + type: float + description: A float representing the y position of the splash + - name: posZ + type: float + description: A float representing the z position of the splash examples: - path: examples/fxAddBulletSplash-1.lua description: This example will add a Bullet Splash Effect next to your player when typing/bsplashin the Chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddDebris.yaml b/functions/Effects/fxAddDebris.yaml index ff852a18..cdbeb73f 100644 --- a/functions/Effects/fxAddDebris.yaml +++ b/functions/Effects/fxAddDebris.yaml @@ -1,12 +1,54 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddDebris -client: +shared: name: fxAddDebris description: Creates a debris particle effect (e.g. bits that fly off a car when ramming a wall). - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: colorR + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: colorG + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: colorB + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: colorA + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: scale + type: float + description: the size of the chunks. + default: '1.0' + - name: count + type: int + description: the number of chunks to create. + default: '1' examples: - path: examples/fxAddDebris-1.lua description: This example will create a Debris Effect next to you when typing/debrisin the Chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddFootSplash.yaml b/functions/Effects/fxAddFootSplash.yaml index 47b35eb6..e60e35d0 100644 --- a/functions/Effects/fxAddFootSplash.yaml +++ b/functions/Effects/fxAddFootSplash.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddFootSplash -client: +shared: name: fxAddFootSplash description: This function creates a foot splash particle effect, normally created when walking into water. - parameters: [] + parameters: + - name: posX + type: float + description: A float representing the x position of the splash + - name: posY + type: float + description: A float representing the y position of the splash + - name: posZ + type: float + description: A float representing the z position of the splash examples: - path: examples/fxAddFootSplash-1.lua description: This example will create a Foot Splash at the position of the bullet impact whenever you shoot. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddGlass.yaml b/functions/Effects/fxAddGlass.yaml index 5e0c0bae..be19848e 100644 --- a/functions/Effects/fxAddGlass.yaml +++ b/functions/Effects/fxAddGlass.yaml @@ -1,11 +1,54 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddGlass -client: +shared: name: fxAddGlass description: This function creates a glass particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: A float representing the x position of the glass + - name: posY + type: float + description: A float representing the y position of the glass + - name: posZ + type: float + description: A float representing the z position of the glass + - name: colorR + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: colorG + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: colorB + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: colorA + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: scale + type: float + description: A float representing the size of the particle effect, where 1 is + the standard size. + default: '1.0' + - name: count + type: int + description: The density of the particle effect. + default: '1' examples: - path: examples/fxAddGlass-1.lua description: This example creates a glass particle effect at the position of the player who use /addGlass command. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddGunshot.yaml b/functions/Effects/fxAddGunshot.yaml index 306b057b..0389ae3e 100644 --- a/functions/Effects/fxAddGunshot.yaml +++ b/functions/Effects/fxAddGunshot.yaml @@ -1,10 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddGunshot -client: +shared: name: fxAddGunshot description: This function creates a gunshot particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: includeSparks + type: bool + description: A bool representing whether the particle effect will generate sparks. + default: 'true' examples: - path: examples/fxAddGunshot-1.lua description: This example adds a gunshot with sparks in front of your face. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddPunchImpact.yaml b/functions/Effects/fxAddPunchImpact.yaml index 831cbc61..9248384d 100644 --- a/functions/Effects/fxAddPunchImpact.yaml +++ b/functions/Effects/fxAddPunchImpact.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddPunchImpact -client: +shared: name: fxAddPunchImpact description: Creates a punch impact particle effect (a small dust cloud). - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/fxAddPunchImpact-1.lua description: This example will create a Punch Impact Effect next to you when typing/pimpactin the Chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddSparks.yaml b/functions/Effects/fxAddSparks.yaml index 3b894f47..0bb95d91 100644 --- a/functions/Effects/fxAddSparks.yaml +++ b/functions/Effects/fxAddSparks.yaml @@ -1,10 +1,74 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddSparks -client: +shared: name: fxAddSparks description: Creates a number of sparks originating from a point or along a line. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: force + type: float + description: 'speed factor: the higher this value, the faster and further the + sparks fly.' + default: '1.0' + - name: count + type: int + description: the number of effects to create. + default: '1' + - name: acrossLineX + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: acrossLineY + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: acrossLineZ + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: blur + type: bool + description: if false , creates standard bullet impact-like sparks. If true , + adds motion blur to the sparks. + default: 'false' + - name: spread + type: float + description: determines how strongly the particles deviate from each other. With + low values the particles will stay quite close together, high values will make + them fly in all directions. Also affects their speed. + default: '1.0' + - name: life + type: float + description: the higher this value, the longer the sparks survive before they + disappear. + default: '1.0' examples: - path: examples/fxAddSparks-1.lua description: This example will add Fire Bins to all locations added in the table. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddTankFire.yaml b/functions/Effects/fxAddTankFire.yaml index aafff1fc..3daae038 100644 --- a/functions/Effects/fxAddTankFire.yaml +++ b/functions/Effects/fxAddTankFire.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddTankFire -client: +shared: name: fxAddTankFire description: This function creates a tank firing particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/fxAddTankFire-1.lua description: This example will create a Tank Fire Effect at your weapon's muzzle position side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddTyreBurst.yaml b/functions/Effects/fxAddTyreBurst.yaml index 59186164..1e90ae7a 100644 --- a/functions/Effects/fxAddTyreBurst.yaml +++ b/functions/Effects/fxAddTyreBurst.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddTyreBurst -client: +shared: name: fxAddTyreBurst description: Creates a tyre burst particle effect (a small white smoke puff). - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/fxAddTyreBurst-1.lua description: This example will create a Tyre Burst Effect next to you when typing/tyreburstin the Chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddWaterHydrant.yaml b/functions/Effects/fxAddWaterHydrant.yaml index 4910d9eb..d743e3d7 100644 --- a/functions/Effects/fxAddWaterHydrant.yaml +++ b/functions/Effects/fxAddWaterHydrant.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddWaterHydrant -client: +shared: name: fxAddWaterHydrant description: This function creates a water hydrant particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: A float representing the x position of the hydrant + - name: posY + type: float + description: A float representing the y position of the hydrant + - name: posZ + type: float + description: A float representing the z position of the hydrant examples: - path: examples/fxAddWaterHydrant-1.lua description: 'This example will create 20 water hydrant effects around the players position when they use the command: hydrantmania.' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddWaterSplash.yaml b/functions/Effects/fxAddWaterSplash.yaml index 9e43200d..585de331 100644 --- a/functions/Effects/fxAddWaterSplash.yaml +++ b/functions/Effects/fxAddWaterSplash.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddWaterSplash -client: +shared: name: fxAddWaterSplash description: This function creates a water splash particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: A float representing the x position of the splash + - name: posY + type: float + description: A float representing the y position of the splash + - name: posZ + type: float + description: A float representing the z position of the splash examples: - path: examples/fxAddWaterSplash-1.lua description: This example will create a Water Splash at the position of the bullet impact whenever you shoot. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxAddWood.yaml b/functions/Effects/fxAddWood.yaml index 80b0ce93..62c861da 100644 --- a/functions/Effects/fxAddWood.yaml +++ b/functions/Effects/fxAddWood.yaml @@ -1,11 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxAddWood -client: +shared: name: fxAddWood description: Creates a wood splinter particle effect. - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: count + type: int + description: the number of splinters to create. + default: '1' + - name: brightness + type: float + description: the brightness. Ranges from 0 (black) to 1 (normal color). + default: '1.0' examples: - path: examples/fxAddWood-1.lua description: This example will create a Wood Effect next to you when typing/woodfxin the Chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the operation was successful, false otherwise. + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/fxCreateParticle.yaml b/functions/Effects/fxCreateParticle.yaml index 7b0a2d2f..6dcd7fa4 100644 --- a/functions/Effects/fxCreateParticle.yaml +++ b/functions/Effects/fxCreateParticle.yaml @@ -1,11 +1,81 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FxCreateParticle -client: +shared: name: fxCreateParticle description: Creates the given particles of the specified color. Can be useful for creating flares, toxic fumes, reward effects, etc. - parameters: [] + parameters: + - name: particle + type: string + description: The name of the particle to create. See particles list. + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: dirX + type: float + description: MISSING_PARAM_DESC + - name: dirY + type: float + description: MISSING_PARAM_DESC + - name: dirZ + type: float + description: MISSING_PARAM_DESC + - name: r + type: float + description: MISSING_PARAM_DESC + - name: g + type: float + description: MISSING_PARAM_DESC + - name: b + type: float + description: MISSING_PARAM_DESC + - name: a + type: float + description: MISSING_PARAM_DESC + - name: randomizeColors + type: bool + description: Specifies whether the color should be fixed (r,g,b) or randomly calculated + for each particle based on the given color. This allows to create colorful effects. + default: 'false' + - name: count + type: int + description: the number of flying particles to create. Depending on the particle, + a very large count may cause the game to lag or freeze (50k+). + default: '1' + - name: brightness + type: float + description: the brightness. Ranges from 0 (almost black) to 1 (normal color). + default: '1.0' + - name: size + type: float + description: Particles size. If randomSizes is set then when 0 is specified the + minimum size is 0.3. + default: '0.3' + - name: randomSizes + type: bool + description: Specifies whether all particles should be the same fixed size or + each particle should have a random size. + default: 'false' + - name: life + type: float + description: the higher this value, the longer the particles survive before they + disappear. This parameter may be ignored by some particles. + default: '1.0' examples: - path: examples/fxCreateParticle-1.lua description: This example creates a constant green, toxic fume over the biowell. side: client - incomplete: true + returns: + values: + - type: bool + name: value + oop: + element: Effect + method: ) + static: true + requires_review: true diff --git a/functions/Effects/getEffectDensity.yaml b/functions/Effects/getEffectDensity.yaml index 1b60413e..b21d1631 100644 --- a/functions/Effects/getEffectDensity.yaml +++ b/functions/Effects/getEffectDensity.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetEffectDensity -client: +shared: name: getEffectDensity description: This function gets the density of certain [effect](/wiki/Effect "Effect"). - parameters: [] + parameters: + - name: theEffect + type: effect + description: The effect to get density of. examples: - path: examples/getEffectDensity-1.lua description: '' side: client + returns: + values: + - type: float + name: value + oop: + element: effect + method: getDensity + variable: density + static: false pair: setEffectDensity - incomplete: true + requires_review: true diff --git a/functions/Effects/getEffectSpeed.yaml b/functions/Effects/getEffectSpeed.yaml index 1efb7118..1a014070 100644 --- a/functions/Effects/getEffectSpeed.yaml +++ b/functions/Effects/getEffectSpeed.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetEffectSpeed -client: +shared: name: getEffectSpeed description: This function gets the speed of a specified [effect](/wiki/Effect "Effect"). - parameters: [] + parameters: + - name: theEffect + type: effect + description: The effect to get the speed of. examples: - path: examples/getEffectSpeed-1.lua description: This example adds commandgesthat creates crate explosion effect at the player's position and outputs its speed to the chatbox. side: client + returns: + values: + - type: float + name: value + description: Returns float containing the effect's speed, false if invalid arguments + were specified. + oop: + element: effect + method: getSpeed + variable: speed + static: false pair: setEffectSpeed - incomplete: true + requires_review: true diff --git a/functions/Effects/setEffectDensity.yaml b/functions/Effects/setEffectDensity.yaml index 877f8af4..c60d84b0 100644 --- a/functions/Effects/setEffectDensity.yaml +++ b/functions/Effects/setEffectDensity.yaml @@ -1,17 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetEffectDensity -client: +shared: name: setEffectDensity description: This function sets the density of a specified [effect](/wiki/Effect "Effect"). - parameters: [] + parameters: + - name: theEffect + type: effect + description: The effect to change the speed of. + - name: density + type: float + description: The level of density (from 0 to 2). examples: - path: examples/setEffectDensity-1.lua description: This example adds commandsedthat creates spray effect at the player's position and sets its density to 2. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the density was succesfully changed, false otherwise. + oop: + element: effect + method: setDensity + variable: density + static: false pair: getEffectDensity notes: - type: warning content: Upper density limit of this function depends on client FX Quality setting. The limit is 1 for Low, 1.5 for Medium, and 2 for High/Very high. - incomplete: true + requires_review: true diff --git a/functions/Effects/setEffectSpeed.yaml b/functions/Effects/setEffectSpeed.yaml index 5972df67..b5801fec 100644 --- a/functions/Effects/setEffectSpeed.yaml +++ b/functions/Effects/setEffectSpeed.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetEffectSpeed -client: +shared: name: setEffectSpeed description: This function sets the speed of a specified [effect](/wiki/Effect "Effect"). - parameters: [] + parameters: + - name: theEffect + type: effect + description: The effect to change the speed of. + - name: speed + type: float + description: The speed to set. examples: - path: examples/setEffectSpeed-1.lua description: This example adds commandsesthat creates effect of a smoke at player's position and sets its speed to 5. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the effect speed was succesfuly changed, false otherwise. + oop: + element: effect + method: setSpeed + variable: speed + static: false pair: getEffectSpeed - incomplete: true + requires_review: true diff --git a/functions/Element/addElementDataSubscriber.yaml b/functions/Element/addElementDataSubscriber.yaml index e1559d14..812f910a 100644 --- a/functions/Element/addElementDataSubscriber.yaml +++ b/functions/Element/addElementDataSubscriber.yaml @@ -1,16 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddElementDataSubscriber -server: +shared: name: addElementDataSubscriber description: 'This function subscribes a [player](/wiki/Player "Player") to specific [element data](/wiki/Element_data "Element data"). This function is used together with [setElementData](/wiki/SetElementData "SetElementData") in *"subscribe"* mode.' - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to subscribe the player to. + - name: key + type: string + description: The key you wish to subscribe the player to. + - name: thePlayer + type: player + description: The player you wish to subscribe. examples: - path: examples/addElementDataSubscriber-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was subscribed, false otherwise. + oop: + element: element + method: addDataSubscriber + static: false pair: removeElementDataSubscriber notes: - type: info @@ -19,4 +37,4 @@ server: - type: info content: Calling removeElementData or setElementData with other sync mode will automatically remove all subscribers of specified element data. - incomplete: true + requires_review: true diff --git a/functions/Element/attachElements.yaml b/functions/Element/attachElements.yaml index 0c37560d..baa79fd8 100644 --- a/functions/Element/attachElements.yaml +++ b/functions/Element/attachElements.yaml @@ -1,9 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AttachElements -server: +shared: name: attachElements description: This function attaches one element to another, so that the first one follows the second whenever it moves. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to be attached. + - name: theAttachToElement + type: element + description: The element to attach the first to. + - name: xPosOffset + type: float + description: The x offset, if you want the elements to be a certain distance from + one another (default 0). + default: '0' + - name: "yPosOffset" + type: float + description: The y offset (default 0). + default: '0' + - name: zPosOffset + type: float + description: The z offset (default 0). + default: '0' + - name: xRotOffset + type: float + description: The x rotation offset (default 0). + default: '0' + - name: "yRotOffset" + type: float + description: The y rotation offset (default 0). + default: '0' + - name: zRotOffset + type: float + description: The z rotation offset (default 0). + default: '0' examples: - path: examples/attachElements-1.lua description: 'Example 1:This example attaches a marker to the player who steals @@ -13,6 +44,15 @@ server: description: Example 3:This function adds a tank on top of a player (for extra defense), clientside. This means it will be invisible to other players. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the attaching process was successful, false otherwise. + oop: + element: element + method: attach + static: false pair: detachElements notes: - type: info @@ -22,4 +62,4 @@ server: for more details. Due to a limitation in GTA, unexpected attach rotations may occur if all rotation offsets are non-zero. (i.e. Try to ensure at least one of 'xRotOffset', 'yRotOffset' or 'zRotOffset' is zero). - incomplete: true + requires_review: true diff --git a/functions/Element/clearElementVisibleTo.yaml b/functions/Element/clearElementVisibleTo.yaml index 955e2dac..50479f45 100644 --- a/functions/Element/clearElementVisibleTo.yaml +++ b/functions/Element/clearElementVisibleTo.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ClearElementVisibleTo -server: +shared: name: clearElementVisibleTo description: This function clears any settings added by [setElementVisibleTo](/wiki/SetElementVisibleTo "SetElementVisibleTo") and restores an [element](/wiki/Element "Element") to its default [visibility](/wiki/Visibility "Visibility"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you wish to restore to its default visibility examples: - path: examples/clearElementVisibleTo-1.lua description: This example clears any visibility settings after a player dies, so everyone can see his blip for a short period side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the operation was successful, false otherwise. + oop: + element: element + method: clearVisibility + static: false + requires_review: true diff --git a/functions/Element/cloneElement.yaml b/functions/Element/cloneElement.yaml index 86f1ac69..99ddb664 100644 --- a/functions/Element/cloneElement.yaml +++ b/functions/Element/cloneElement.yaml @@ -1,14 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CloneElement -server: +shared: name: cloneElement description: This function clones (creates an exact copy of) an already existing element. The root node, and player elements, cannot be cloned. If a player element is a child of an element that is cloned, it will be skipped, along with the elements that exist as a child to the player element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element that you wish to clone. + - name: xPos + type: float + description: A floating point number representing the X coordinate on the map. + default: '0' + - name: "yPos" + type: float + description: A floating point number representing the Y coordinate on the map. + default: '0' + - name: zPos + type: float + description: A floating point number representing the Z coordinate on the map. + default: '0' + - name: cloneChildren + type: bool + description: A boolean value representing whether or not the element's children + will be cloned. + default: 'false' examples: - path: examples/cloneElement-1.lua description: This example clones the vehicle a player is in. This allows carrying over of the current state of the vehicle, including mods, for example. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the handle of the new cloned element of the parent, false + if invalid arguments were passed. + oop: + element: element + method: clone + static: false + requires_review: true diff --git a/functions/Element/createElement.yaml b/functions/Element/createElement.yaml index fd19d4c4..307b5b88 100644 --- a/functions/Element/createElement.yaml +++ b/functions/Element/createElement.yaml @@ -1,11 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateElement -server: +shared: name: createElement description: This function is used to create a new dummy element in the [element tree](/wiki/Element_tree "Element tree") which do not necessarily represent an entity within the San Andreas world. A common use for this function is for creating custom elements, such as a Flag or a Base. - parameters: [] + parameters: + - name: elementType + type: string + description: The type of element being created. + - name: elementID + type: string + description: The ID of the element being created. + default: nil examples: - path: examples/createElement-1.lua description: This example creates a "flag" element, named "blue", which will be @@ -15,4 +22,13 @@ server: description: 'Except for it being placed in a different map root, that line will have the same effect as having this in a .map file:' side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the element if it was successfully created. Returns false + if the arguments are wrong. + oop: + element: element + constructorclass: Element + requires_review: true diff --git a/functions/Element/destroyElement.yaml b/functions/Element/destroyElement.yaml index 9713604e..945f9e3b 100644 --- a/functions/Element/destroyElement.yaml +++ b/functions/Element/destroyElement.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DestroyElement -server: +shared: name: destroyElement description: This function destroys an [element](/wiki/Element "Element") and all elements within it in the hierarchy (its children, the children of those children @@ -9,7 +9,10 @@ server: an argument will wipe all elements from the server, except for the players and clients, which will become direct descendants of the root node, and other elements that cannot be destroyed, such as resource root elements. - parameters: [] + parameters: + - name: elementToDestroy + type: element + description: The element you wish to destroy. examples: - path: examples/destroyElement-1.lua description: Example 1:This example would destroy every element in the map, with @@ -27,6 +30,18 @@ server: description: 'Example 4:This example destroys all vehicles, regardless of ID, name, etc:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the element was destroyed successfully, false if + either the element passed to it was invalid or it could not be destroyed for + some other reason (for example, clientside destroyElement can't destroy serverside + elements). + oop: + element: element + method: destroy + static: false notes: - type: info content: There is bug when you try to destroy webbrowser that returned from guiGetBrowser @@ -41,4 +56,4 @@ server: wrong to assume a clean stream-in and stream-out sequence on the client-side. Additionally to onClientElementStreamOut use a onClientElementDestroy event handler to detect the destruction of streamed-in elements. - incomplete: true + requires_review: true diff --git a/functions/Element/detachElements.yaml b/functions/Element/detachElements.yaml index 263c1d54..c1a35b54 100644 --- a/functions/Element/detachElements.yaml +++ b/functions/Element/detachElements.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DetachElements -server: +shared: name: detachElements description: This function detaches attached elements from one another. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to be detached (the "child") + - name: theAttachToElement + type: element + description: The element you wish to detach from, will detach from the attached + element if this isn't specified. examples: - path: examples/detachElements-1.lua description: 'Example 1:This example attaches a marker to a vehicle, and detaches @@ -12,5 +19,14 @@ server: description: 'Example 2:This function will detach any elements that might have been attached to the passed element:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the detaching was successful, false otherwise. + oop: + element: element + method: detach + static: false pair: attachElements - incomplete: true + requires_review: true diff --git a/functions/Element/getAllElementData.yaml b/functions/Element/getAllElementData.yaml index 781d7947..221bf6bf 100644 --- a/functions/Element/getAllElementData.yaml +++ b/functions/Element/getAllElementData.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAllElementData -server: +shared: name: getAllElementData description: Returns a table of all element data of an element. - parameters: [] + parameters: + - name: theElement + type: element + description: the element you want to get the element data of. examples: - path: examples/getAllElementData-1.lua description: This example script creates a new console command that displays all element data that is currently set on the player who enters the command. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: If successful, returns a table with as keys the names of the element + data and as values the corresponding element data values. Returns false in case + of failure. + oop: + element: element + method: getAllData + static: false + requires_review: true diff --git a/functions/Element/getAttachedElements.yaml b/functions/Element/getAttachedElements.yaml index de1714ee..06c05d67 100644 --- a/functions/Element/getAttachedElements.yaml +++ b/functions/Element/getAttachedElements.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAttachedElements -server: +shared: name: getAttachedElements description: This function returns a table of all the elements attached to the specified element - parameters: [] + parameters: + - name: theElement + type: element + description: The element which you require the information from. examples: - path: examples/getAttachedElements-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the elements attached to the specified element. + oop: + element: element + method: getAttachedElements + static: false + requires_review: true diff --git a/functions/Element/getElementAlpha.yaml b/functions/Element/getElementAlpha.yaml index 6e80606f..6ca4f41d 100644 --- a/functions/Element/getElementAlpha.yaml +++ b/functions/Element/getElementAlpha.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementAlpha -server: +shared: name: getElementAlpha description: This function returns the alpha (transparency) value for the specified [element](/wiki/Element "Element"). This can be a [player](/wiki/Player "Player"), [ped](/wiki/Ped "Ped"), [object](/wiki/Object "Object"), [vehicle](/wiki/Vehicle "Vehicle") or [weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose alpha you want to retrieve. examples: - path: examples/getElementAlpha-1.lua description: This example outputs whether the player is invisible. side: client + returns: + values: + - type: int + name: value + description: Returns an integer (0-255; 0 = transparent) indicating the element's + alpha, or false if invalid arguments were passed. + oop: + element: element + method: getAlpha + variable: alpha + static: false pair: setElementAlpha - incomplete: true + requires_review: true diff --git a/functions/Element/getElementAngularVelocity.yaml b/functions/Element/getElementAngularVelocity.yaml index 2f3ca596..322e3f7e 100644 --- a/functions/Element/getElementAngularVelocity.yaml +++ b/functions/Element/getElementAngularVelocity.yaml @@ -1,11 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementAngularVelocity -server: +shared: name: getElementAngularVelocity description: Gets the current angular velocity of a specified, supported element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to retrieve the angular velocity from. Can be either + a player , ped , object , vehicle or a custom weapon . Server side supports + only vehicles currently. examples: - path: examples/getElementAngularVelocity-1.lua description: '' side: server + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three floats describing the x, y and z rotation + oop: + element: element + method: getAngularVelocity + variable: angularVelocity + static: false pair: setElementAngularVelocity - incomplete: true + requires_review: true diff --git a/functions/Element/getElementAttachedOffsets.yaml b/functions/Element/getElementAttachedOffsets.yaml index 549a3ff1..f5680162 100644 --- a/functions/Element/getElementAttachedOffsets.yaml +++ b/functions/Element/getElementAttachedOffsets.yaml @@ -1,12 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementAttachedOffsets -server: +shared: name: getElementAttachedOffsets description: This function returns the offsets of an element that has been attached to another element using [attachElements](/wiki/AttachElements "AttachElements"). - parameters: [] + parameters: + - name: theElement + type: element + description: The attached element. examples: - path: examples/getElementAttachedOffsets-1.lua description: Example:This example creates a car with a minigun side: client + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + - type: float + name: value3 + - type: float + name: value4 + - type: float + name: value5 + - type: float + name: value6 + description: Returns 6 floats , of which the first 3 indicate the position offset + (x, y, z), and the last 3 indicate the rotation offset (x, y, z), if successful. + false otherwise. + oop: + element: element + method: getAttachedOffsets + static: false pair: setElementAttachedOffsets - incomplete: true + requires_review: true diff --git a/functions/Element/getElementAttachedTo.yaml b/functions/Element/getElementAttachedTo.yaml index 70b40e31..4c2ecd07 100644 --- a/functions/Element/getElementAttachedTo.yaml +++ b/functions/Element/getElementAttachedTo.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementAttachedTo -server: +shared: name: getElementAttachedTo description: This function determines the element that the specified element is attached to. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you require the information for. examples: - path: examples/getElementAttachedTo-1.lua description: This example defines a console command that outputs the type of the element that the player is attached to. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the element that the chosen element is attached to, or false + if the element isn't attached to another element. + oop: + element: element + method: getAttachedTo + static: false + requires_review: true diff --git a/functions/Element/getElementBonePosition.yaml b/functions/Element/getElementBonePosition.yaml index a9f39950..961c2b85 100644 --- a/functions/Element/getElementBonePosition.yaml +++ b/functions/Element/getElementBonePosition.yaml @@ -1,16 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementBonePosition -client: +shared: name: getElementBonePosition description: Returns the 3D world coordinates of a specific bone of a given [element](/wiki/Element "Element"). Currently the [Player](/wiki/Element/Player "Element/Player") and [Ped](/wiki/Element/Ped "Element/Ped") element types are accepted. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to get the bone position on. + - name: boneId + type: int + description: the ID of the bone to get the position of. See Bone IDs . examples: - path: examples/getElementBonePosition-1.lua description: 'This example outputs the X, Y, Z world position of the local player bone specified through a command:' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns 3 floats , representing the X, Y, Z world position of the + bone. notes: - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Element/getElementBoneQuaternion.yaml b/functions/Element/getElementBoneQuaternion.yaml index 73f1dff3..e299b5f7 100644 --- a/functions/Element/getElementBoneQuaternion.yaml +++ b/functions/Element/getElementBoneQuaternion.yaml @@ -1,15 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementBoneQuaternion -client: +shared: name: getElementBoneQuaternion description: "This function retrieves how a particular bone rotates in relation\ \ to the element. \n\nThe use of [quaternions](https://en.wikipedia.org/wiki/Quaternion)\ \ are more effective and do not generate issues like gimbal lock that might arise\ \ with [Euler angles](https://en.wikipedia.org/wiki/Euler_angles), so they are\ \ a preferable choice for rotation." - parameters: [] + parameters: + - name: ped + type: element + description: The element (ped or player) from which the bone's rotation will be + retrieved. + - name: bone + type: int + description: The ID of the bone to retrieve the quaternion of. examples: - path: examples/getElementBoneQuaternion-1.lua description: This example retrieves the rotation of the player's head in quaternion.The retrieved values ​​can be used for calculations. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: 'Returns four float values:' + requires_review: true diff --git a/functions/Element/getElementBoneRotation.yaml b/functions/Element/getElementBoneRotation.yaml index e0dfb743..bed05fc5 100644 --- a/functions/Element/getElementBoneRotation.yaml +++ b/functions/Element/getElementBoneRotation.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementBoneRotation -client: +shared: name: getElementBoneRotation description: Returns the orientation of a specific bone relative to the [element](/wiki/Element "Element"). Currently the [Player](/wiki/Element/Player "Element/Player") and [Ped](/wiki/Element/Ped "Element/Ped") element types are accepted. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to get the bone rotation on. + - name: boneId + type: int + description: the ID of the bone to get the rotation of. See Bone IDs . examples: - path: examples/getElementBoneRotation-1.lua description: 'This example outputs the yaw, pitch and roll orientation of a specific @@ -13,7 +19,16 @@ client: - path: examples/getElementBoneRotation-2.lua description: This example takes the current rotation of all player bones. by ThigasDEV side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns 3 floats , representing the yaw, pitch, roll rotation values. notes: - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Element/getElementBoundingBox.yaml b/functions/Element/getElementBoundingBox.yaml index 10d93508..8f68c08b 100644 --- a/functions/Element/getElementBoundingBox.yaml +++ b/functions/Element/getElementBoundingBox.yaml @@ -1,15 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementBoundingBox -client: +shared: name: getElementBoundingBox description: This function returns the minimum and maximum coordinates of an element's bounding box. - parameters: [] + parameters: + - name: theElement + type: element + description: the element whose bounding box we want to get. examples: - path: examples/getElementBoundingBox-1.lua description: This example outputs to chatbox the minimum and the maximum coordinates of an element. side: client + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + - type: float + name: value3 + - type: float + name: value4 + - type: float + name: value5 + - type: float + name: value6 + description: This example outputs to chatbox the minimum and the maximum coordinates + of an element. + oop: + element: element + method: getBoundingBox + static: false notes: - type: info content: The element must be streamed in for this function to work. - incomplete: true + requires_review: true diff --git a/functions/Element/getElementByID.yaml b/functions/Element/getElementByID.yaml index 272bb468..5e7c9022 100644 --- a/functions/Element/getElementByID.yaml +++ b/functions/Element/getElementByID.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementByID -server: +shared: name: getElementByID description: This function returns an element from the specified ID. If more than one element with the same ID exists, only the first one in the order it appears in the XML tree will be returned by this function. - parameters: [] + parameters: + - name: id + type: string + description: The ID of the element as it appears in the XML file or as set by + setElementID . + - name: index + type: int + description: If there are two or more elements of the same ID it will return the + element with the specified index starting at 0. + default: '0' examples: - path: examples/getElementByID-1.lua description: 'Assuming we have this in the .map file:' @@ -13,8 +22,19 @@ server: description: Then this example would retrieve the element and output the vehicle name. side: server + returns: + values: + - type: element + name: value + description: Returns the element with the given ID, or false if no such element + exists. + oop: + element: Element + note: This function is a static function underneath the Element class. + method: ) + static: true notes: - type: info content: The ID in this context is the value of the 'id' data item of the element (the id=".." attribute in the .map file), NOT the model ID, weapon ID or similiar. - incomplete: true + requires_review: true diff --git a/functions/Element/getElementByIndex.yaml b/functions/Element/getElementByIndex.yaml index 1679781b..f92ddc0a 100644 --- a/functions/Element/getElementByIndex.yaml +++ b/functions/Element/getElementByIndex.yaml @@ -1,17 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementByIndex -server: +shared: name: getElementByIndex description: This function returns an element of the specified type with the specified index. - parameters: [] + parameters: + - name: theType + type: string + description: the type of the element to be returned. Examples include "player", + "vehicle", or a custom type. + - name: index + type: int + description: the element's index (0 for the first element, 1 for the second, etc). examples: - path: examples/getElementByIndex-1.lua description: 'This example generates the name of the specified player that is on the server. For example: ''player 0'' would return the name of the first player on the server.' side: server + returns: + values: + - type: element + name: value + description: Returns the requested element , or false if it doesn't exist. + oop: + element: Element + note: This function is a static function inside the Element class. + method: ) + static: true notes: - type: important content: If you wish to retrieve more than one element at a time, it is more efficient to use getElementsByType instead. - incomplete: true + requires_review: true diff --git a/functions/Element/getElementChild.yaml b/functions/Element/getElementChild.yaml index 5defe663..add91634 100644 --- a/functions/Element/getElementChild.yaml +++ b/functions/Element/getElementChild.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementChild -server: +shared: name: getElementChild description: This function returns one of the child elements of a given parent element. The child element is selected by its index (0 for the first child, 1 for the second and so on). - parameters: [] + parameters: + - name: parent + type: element + description: the element above the one to be returned in the hierarchy. + - name: index + type: int + description: the element's index (0 for the first element, 1 for the second, etc). examples: - path: examples/getElementChild-1.lua description: 'If the .map file contains:' @@ -19,4 +25,13 @@ server: 3'' would output ''Team Base 3: Factory'' with the .map file below, even though it''s no base.' side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the requested element if it exists, or false if it doesn't. + oop: + element: element + method: getChild + static: false + requires_review: true diff --git a/functions/Element/getElementChildren.yaml b/functions/Element/getElementChildren.yaml index d032205f..32849d7e 100644 --- a/functions/Element/getElementChildren.yaml +++ b/functions/Element/getElementChildren.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementChildren -server: +shared: name: getElementChildren description: This function is used to retrieve a list of the child elements of a given parent element. Note that it will only return direct children and not elements that are further down the [element tree](/wiki/Element_tree "Element tree"). - parameters: [] + parameters: + - name: parent + type: element + description: Supply this argument with the parent of the children you want returned. + - name: theType + type: string + description: 'The type of element you want a list of. This is the same as the + tag name in the .map file, so this can be used with a custom element type if + desired. Built in types are: "player": A player connected to the server "ped": + A ped "water": A water polygon "sound": A playing sound "vehicle": A vehicle + "object": An object "pickup": A pickup "marker": A marker "colshape": A collision + shape "blip": A blip "radararea": A radar area "team": A team "spawnpoint": + A spawnpoint "remoteclient": A remote client connected to the server "console": + The server Console' + default: nil examples: - path: examples/getElementChildren-1.lua description: 'With this map file:' @@ -13,4 +27,15 @@ server: description: This example outputs the child elements of the element with id 'red', when the player enters the 'teamElements' command. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: This function returns a table that contains a list of elements that + the parent has. If the element has no children, it will return an empy table + . It will return false if the parent element does not exist. + oop: + element: element + method: getChildren + static: false + requires_review: true diff --git a/functions/Element/getElementChildrenCount.yaml b/functions/Element/getElementChildrenCount.yaml index 6b7f8561..f82cddab 100644 --- a/functions/Element/getElementChildrenCount.yaml +++ b/functions/Element/getElementChildrenCount.yaml @@ -1,10 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementChildrenCount -server: +shared: name: getElementChildrenCount description: This function returns the number of children an element has. Note that only the direct children are counted and not elements that are further down the [element tree](/wiki/Element_tree "Element tree"). - parameters: [] + parameters: + - name: parent + type: element + description: the parent element examples: - path: examples/getElementChildrenCount-1.lua description: 'To get the number of children the ''team1'' element has:' @@ -12,4 +15,14 @@ server: - path: examples/getElementChildrenCount-2.lua description: 'You could use the following code:' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int with the number of child elements, or false if the + parent element does not exist. + oop: + element: element + method: getChildrenCount + static: false + requires_review: true diff --git a/functions/Element/getElementColShape.yaml b/functions/Element/getElementColShape.yaml index 2444e5fb..4f42089b 100644 --- a/functions/Element/getElementColShape.yaml +++ b/functions/Element/getElementColShape.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementColShape -server: +shared: name: getElementColShape description: Some elements have an associated colshape, for example [Marker](/wiki/Marker "Marker") and [Pickup](/wiki/Pickup "Pickup"). This function is used to get the associated colshape. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you want to get the colshape of examples: - path: examples/getElementColShape-1.lua description: This example creates a marker inside Toreno's house and adds a command to check whether you are standing on it. side: server - incomplete: true + returns: + values: + - type: colshape + name: value + description: Returns colshape of the element, false if not or an invalid argument + was passed to the function. + oop: + element: element + method: getColShape + variable: colShape + static: false + requires_review: true diff --git a/functions/Element/getElementCollisionsEnabled.yaml b/functions/Element/getElementCollisionsEnabled.yaml index 16423e4b..fd3929ed 100644 --- a/functions/Element/getElementCollisionsEnabled.yaml +++ b/functions/Element/getElementCollisionsEnabled.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementCollisionsEnabled -server: +shared: name: getElementCollisionsEnabled description: This function indicates if a specific element is set to have collisions disabled. An element without collisions does not interact with the physical environment and remains static. - parameters: [] + parameters: + - name: theElement + type: element + description: The element for which you want to check whether collisions are enabled examples: - path: examples/getElementCollisionsEnabled-1.lua description: This example check if there are any players with collisions disabled. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the collisions are enabled, false otherwise. + oop: + element: element + method: getCollisionsEnabled + variable: collisions + static: false pair: setElementCollisionsEnabled - incomplete: true + requires_review: true diff --git a/functions/Element/getElementData.yaml b/functions/Element/getElementData.yaml index 1008f393..29d2bb32 100644 --- a/functions/Element/getElementData.yaml +++ b/functions/Element/getElementData.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementData -server: +shared: name: getElementData description: This function retrieves [element data](/wiki/Element_data "Element data") attached to an element under a certain key. - parameters: [] + parameters: + - name: theElement + type: element + description: This is the element with data you want to retrieve. + - name: key + type: string + description: The name of the element data entry you want to retrieve. (Maximum + 31 characters.) + - name: inherit + type: bool + description: '- toggles whether or not the function should go up the hierarchy + to find the requested key in case the specified element doesn''t have it.' + default: 'true' examples: - path: examples/getElementData-1.lua description: '' side: server + returns: + values: + - type: var + name: value + description: This function returns a variable containing the requested element + data, or false if the element or the element data does not exist. When getting + data corresponding to a XML attribute, this is always a string . + oop: + element: element + method: getData + static: false pair: setElementData - incomplete: true + requires_review: true diff --git a/functions/Element/getElementDimension.yaml b/functions/Element/getElementDimension.yaml index 7709bab8..ad9e243b 100644 --- a/functions/Element/getElementDimension.yaml +++ b/functions/Element/getElementDimension.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementDimension -server: +shared: name: getElementDimension description: This function allows you to retrieve the dimension of an element. See [Dimension](/wiki/Dimension "Dimension") for the list of valid element types. The dimension determines what/who the element is visible to. - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you'd like to retrieve the dimension of. examples: - path: examples/getElementDimension-1.lua description: '' side: server + returns: + values: + - type: int + name: value + description: Returns an integer for the dimension if theElement is valid, false + otherwise. + oop: + element: element + method: getDimension + variable: dimension + static: false pair: setElementDimension - incomplete: true + requires_review: true diff --git a/functions/Element/getElementDistanceFromCentreOfMassToBaseOfModel.yaml b/functions/Element/getElementDistanceFromCentreOfMassToBaseOfModel.yaml index b2cbcd76..b12d77ab 100644 --- a/functions/Element/getElementDistanceFromCentreOfMassToBaseOfModel.yaml +++ b/functions/Element/getElementDistanceFromCentreOfMassToBaseOfModel.yaml @@ -1,22 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementDistanceFromCentreOfMassToBaseOfModel -client: +shared: name: getElementDistanceFromCentreOfMassToBaseOfModel description: This function is used to retrieve the distance between a [element](/wiki/Element "Element")'s centre of mass to the base of the model. This can be used to calculate the position the [element](/wiki/Element "Element") has to be set to, to have it on ground level. - parameters: [] + parameters: + - name: theElement + type: element + description: MISSING_PARAM_DESC examples: - path: examples/getElementDistanceFromCentreOfMassToBaseOfModel-1.lua description: This example outputs the value for the local player. side: client + returns: + values: + - type: float + name: value + description: Returns a float with the distance, or false if the element is invalid. + oop: + element: element + method: getDistanceFromCentreOfMassToBaseOfModel + variable: distanceFromCentreOfMassToBaseOfModel + static: false notes: - type: info content: The distance value is only available when the element is streamed in, otherwise 0 is returned. If you create an element at the player's position which is going to be streamed in, call the function in the next frame to obtain the correct value (with setTimer 0ms, for example). - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -24,3 +36,4 @@ client: - Missing section: Required Parameters ' + requires_review: true diff --git a/functions/Element/getElementHealth.yaml b/functions/Element/getElementHealth.yaml index a33fa51d..93378b56 100644 --- a/functions/Element/getElementHealth.yaml +++ b/functions/Element/getElementHealth.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementHealth -server: +shared: name: getElementHealth description: This function returns the current health for the specified [element](/wiki/Element "Element"). This can be a [player](/wiki/Player "Player"), a [ped](/wiki/Ped "Ped"), a [vehicle](/wiki/Vehicle "Vehicle"), or an [object](/wiki/Object "Object"). - parameters: [] + parameters: + - name: theElement + type: element + description: The player or vehicle whose health you want to check. examples: - path: examples/getElementHealth-1.lua description: This example outputs the health of the player who enters the command 'showhealth', and their vehicle's health. side: client + returns: + values: + - type: float + name: value + description: Returns a float indicating the element's health, or false if invalid + arguments were passed. + oop: + element: element + method: getHealth + variable: health + static: false pair: setElementHealth - incomplete: true + requires_review: true diff --git a/functions/Element/getElementID.yaml b/functions/Element/getElementID.yaml index 927ca6f2..b50208c7 100644 --- a/functions/Element/getElementID.yaml +++ b/functions/Element/getElementID.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementID -server: +shared: name: getElementID description: This function gets the ID of an element. This is the "id" attribute of the element and is a string, NOT a number like a model ID, weapons ID or similar. - parameters: [] + parameters: + - name: theElement + type: element + description: the element from which to retrieve the ID. examples: - path: examples/getElementID-1.lua description: 'To get the ID of the following element:' @@ -14,9 +17,20 @@ server: - path: examples/getElementID-3.lua description: Another ex; side: server + returns: + values: + - type: string + name: value + description: This returns a string containing the element ID. It will return an + empty string if it has no ID. It will return false if the element is invalid. + oop: + element: element + method: getID + variable: id + static: false pair: setElementID notes: - type: info content: This function can also be used to get the resource name of any resource-data . - incomplete: true + requires_review: true diff --git a/functions/Element/getElementInterior.yaml b/functions/Element/getElementInterior.yaml index 1520bcf1..4122b797 100644 --- a/functions/Element/getElementInterior.yaml +++ b/functions/Element/getElementInterior.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementInterior -server: +shared: name: getElementInterior description: This function allows you to retrieve the interior of any element. An interior is the current loaded place, 0 being outside. - parameters: [] + parameters: + - name: theElement + type: element + description: The element of which you'd like to retrieve the interior examples: - path: examples/getElementInterior-1.lua description: This example shows a player if he is outside or not, when he enters the command 'AmIOutside'. side: server + returns: + values: + - type: int + name: value + description: Returns an int for the interior if theElement is valid, false otherwise. + oop: + element: element + method: getInterior + variable: interior + static: false pair: setElementInterior - incomplete: true + requires_review: true diff --git a/functions/Element/getElementLighting.yaml b/functions/Element/getElementLighting.yaml index 0cc279a9..6ab67ccc 100644 --- a/functions/Element/getElementLighting.yaml +++ b/functions/Element/getElementLighting.yaml @@ -1,14 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementLighting -client: +shared: name: getElementLighting description: This function returns the lighting value for the specified [element](/wiki/Element "Element"). This can be a [player](/wiki/Player "Player"), [ped](/wiki/Ped "Ped"), [vehicle](/wiki/Vehicle "Vehicle"), [object](/wiki/Object "Object"), [weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose lighting you want to retrieve. examples: - path: examples/getElementLighting-1.lua description: This example displays lighting values of streamed in players. side: client + returns: + values: + - type: float + name: value + description: Returns a float (0.0-0.5; 0 = dark; 0.5 = light) indicating the element's + lighting, or false if invalid arguments were passed. This function will fail + if called right after element creation. + oop: + element: element + method: getLighting + variable: lighting + static: false pair: setElementLighting - incomplete: true + requires_review: true diff --git a/functions/Element/getElementModel.yaml b/functions/Element/getElementModel.yaml index 230257a9..efc3f931 100644 --- a/functions/Element/getElementModel.yaml +++ b/functions/Element/getElementModel.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementModel -server: +shared: name: getElementModel description: Returns the model ID of a given element. This can be a player/ped skin, a pickup model, an object model or a vehicle model. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to retrieve the model ID of. examples: - path: examples/getElementModel-1.lua description: This example destroys a haystack when a player targets it.It only @@ -13,5 +16,15 @@ server: description: This example prints out a message when a Shamal or AT-400 is entered by a player. side: server + returns: + values: + - type: int + name: value + description: Returns the model ID if successful, false otherwise. + oop: + element: element + method: getModel + variable: model + static: false pair: setElementModel - incomplete: true + requires_review: true diff --git a/functions/Element/getElementParent.yaml b/functions/Element/getElementParent.yaml index 059664c1..82981eae 100644 --- a/functions/Element/getElementParent.yaml +++ b/functions/Element/getElementParent.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementParent -server: +shared: name: getElementParent description: This function is used to determine the parent of an *element*. - parameters: [] + parameters: + - name: theElement + type: element + description: The child of the parent element you want returned. examples: - path: examples/getElementParent-1.lua description: 'Consider the following map file:' side: server + returns: + values: + - type: element + name: value + description: This returns the parent as an element . It returns false if theElement + is invalid, or is the root node. + oop: + element: element + method: getParent + variable: parent + static: false pair: setElementParent - incomplete: true + requires_review: true diff --git a/functions/Element/getElementPosition.yaml b/functions/Element/getElementPosition.yaml index 709bcbef..422b0a89 100644 --- a/functions/Element/getElementPosition.yaml +++ b/functions/Element/getElementPosition.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementPosition -server: +shared: name: getElementPosition description: 'The getElementPosition function allows you to retrieve the position coordinates of an element. This can be any real world element, including:' - parameters: [] + parameters: + - name: theElement + type: element + description: The element which you'd like to retrieve the location of examples: - path: examples/getElementPosition-1.lua description: This example attaches a samsite on the player's vehicle. side: server + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three float s indicating the position of the element, x , + y and z respectively. + oop: + element: element + method: getPosition + variable: position + static: false pair: setElementPosition - incomplete: true + requires_review: true diff --git a/functions/Element/getElementRadius.yaml b/functions/Element/getElementRadius.yaml index bc3eb8da..6e095a96 100644 --- a/functions/Element/getElementRadius.yaml +++ b/functions/Element/getElementRadius.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementRadius -client: +shared: name: getElementRadius description: This function gets the radius of an [element](/wiki/Element "Element"). Normally, sphere or circle\-shaped elements tend to return a more accurate and expected radius than others with another shapes. - parameters: [] + parameters: + - name: theElement + type: element + description: 'The element to get the radius of. It can be any entity type, such + as: Players . Peds . Vehicles . Objects .' examples: - path: examples/getElementRadius-1.lua description: This example shows how to get and output the radius of every player who types the/getmyradiuscommand (which will always be1). side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float containing the radius if the element is valid, false + otherwise. + oop: + element: element + method: getRadius + variable: radius + static: false + requires_review: true diff --git a/functions/Element/getElementRotation.yaml b/functions/Element/getElementRotation.yaml index 92a6fdee..96697918 100644 --- a/functions/Element/getElementRotation.yaml +++ b/functions/Element/getElementRotation.yaml @@ -1,11 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementRotation -server: +shared: name: getElementRotation description: Retrieve the rotation of elements. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose rotation will be retrieved + - name: rotOrder + type: string + description: 'A string representing the rotation order desired when returning + the euler angles . If omitted, default value is "default" . Allowed values are: + "default": default MTA behavior prior to 1.1, where rotation order depends on + element type "ZXY": rotation about the Z axis ( up ), then about the resulting + X axis ( right ) and finally about the resulting Y axis ( front ). This is the + default rotation order for objects "ZYX": rotation about the Z axis ( up ), + then about the resulting Y axis ( front ), and finally about the resulting X + axis ( right ). This is the default rotation order for vehicles' + default: '"default"' examples: - path: examples/getElementRotation-1.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: If a player points at a player element with a gun, its rotation will + appear in the chat box. + oop: + element: element + method: getRotation + variable: rotation + static: false pair: setElementRotation - incomplete: true + requires_review: true diff --git a/functions/Element/getElementSyncer.yaml b/functions/Element/getElementSyncer.yaml index 279c9c31..2e3e0371 100644 --- a/functions/Element/getElementSyncer.yaml +++ b/functions/Element/getElementSyncer.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementSyncer -server: +shared: name: getElementSyncer description: This function gets the syncer of an element. The syncer is the player who is in control of the element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to get the syncer of. examples: - path: examples/getElementSyncer-1.lua description: This code will kill the syncer of the first ped created with createPed. @@ -11,5 +14,16 @@ server: - path: examples/getElementSyncer-2.lua description: This code will kill the syncer of the ped created with createPed. side: server + returns: + values: + - type: element + name: value + description: Returns the element that is the syncer of theElement or false if + the element does not have a syncer. + oop: + element: element + method: getSyncer + variable: syncer + static: false pair: setElementSyncer - incomplete: true + requires_review: true diff --git a/functions/Element/getElementType.yaml b/functions/Element/getElementType.yaml index 188cdd7c..e99f66f3 100644 --- a/functions/Element/getElementType.yaml +++ b/functions/Element/getElementType.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementType -server: +shared: name: getElementType description: This function is used to retrieve the type of an element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to get the type of. examples: - path: examples/getElementType-1.lua description: This example destroys a haystack when a player targets it side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the element type, false if invalid arguments + were passed. + oop: + element: element + method: getType + variable: type + static: false + requires_review: true diff --git a/functions/Element/getElementVelocity.yaml b/functions/Element/getElementVelocity.yaml index da72d819..185c4e8c 100644 --- a/functions/Element/getElementVelocity.yaml +++ b/functions/Element/getElementVelocity.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementVelocity -server: +shared: name: getElementVelocity description: This function returns three floats containing the velocity (movement speeds) along the X, Y, and Z axis respectively. This means that velocity values can be positive and negative for each axis. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to retrieve the velocity of. examples: - path: examples/getElementVelocity-1.lua description: This example retrieves, calculates, and displays the speed of a random player. side: server + returns: + values: + - type: float float float + name: value + description: If succesful, returns three float s that represent the element's + current velocity along the x , y , and z axis respectively. This function can + fail if the element is a player in a car. Use the vehicle element in this case. + It will also fail if the element specified does not have a velocity, or does + not exist. In case of failure, the first return value will be false . + oop: + element: element + method: getVelocity + variable: velocity + static: false pair: setElementVelocity - incomplete: true + requires_review: true diff --git a/functions/Element/getElementZoneName.yaml b/functions/Element/getElementZoneName.yaml index d8fdf2fc..0b01a00f 100644 --- a/functions/Element/getElementZoneName.yaml +++ b/functions/Element/getElementZoneName.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementZoneName -server: +shared: name: getElementZoneName description: This function allows you to retrieve the zone name of an element (eg. Verdant Bluffs or Ocean Docks) - parameters: [] + parameters: + - name: theElement + type: element + description: The element which you'd like to retrieve the zone name from + - name: citiesonly + type: bool + description: An optional argument to choose if you want to return the city name + (eg Las Venturas) + default: 'false' examples: - path: examples/getElementZoneName-1.lua description: This example shows you how to return your own location by doing /loc in the chatbox or just loc in console side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the string of the elements zone name. + oop: + element: element + method: getZoneName + static: false + requires_review: true diff --git a/functions/Element/getElementsByType.yaml b/functions/Element/getElementsByType.yaml index 2596ed3e..b00623ef 100644 --- a/functions/Element/getElementsByType.yaml +++ b/functions/Element/getElementsByType.yaml @@ -1,4 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementsByType +client: + name: getElementsByType + description: This function is used to retrieve a list of all elements of the specified + type. This can be useful, as it disregards *where* in the element tree it is. + It can be used with either the built in types (listed below) or with any custom + type used in a .map file. For example, if there is an element of type "flag" (e.g. + \) in the .map file, the using "flag" as the type argument would find + it. + parameters: + - name: theType + type: string + description: MISSING_PARAM_DESC + - name: element startat + type: '[' + description: MISSING_PARAM_DESC + default: getRootElement( + examples: [] + returns: + values: + - type: table + name: value + description: Returns a table containing all the elements of the specified type. + Returns an empty table if there are no elements of the specified type. Returns + false if the string specified is invalid (or not a string). + oop: &id001 + element: Element + note: This function is a static function underneath the Element class. + method: ) + static: true + requires_review: true server: name: getElementsByType description: This function is used to retrieve a list of all elements of the specified @@ -7,7 +37,14 @@ server: type used in a .map file. For example, if there is an element of type "flag" (e.g. \) in the .map file, the using "flag" as the type argument would find it. - parameters: [] + parameters: + - name: theType + type: string + description: MISSING_PARAM_DESC + - name: element startat + type: '[' + description: MISSING_PARAM_DESC + default: getRootElement( examples: - path: examples/getElementsByType-1.lua description: 'Example 1:This example retrieves a table of the players in the server, @@ -25,4 +62,12 @@ server: description: 'Example 4:This example loops trough all connected players and redirects them to another server host:' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table containing all the elements of the specified type. + Returns an empty table if there are no elements of the specified type. Returns + false if the string specified is invalid (or not a string). + oop: *id001 + requires_review: true diff --git a/functions/Element/getElementsWithinColShape.yaml b/functions/Element/getElementsWithinColShape.yaml index 46583e1d..c5b8dcce 100644 --- a/functions/Element/getElementsWithinColShape.yaml +++ b/functions/Element/getElementsWithinColShape.yaml @@ -1,18 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementsWithinColShape -server: +shared: name: getElementsWithinColShape description: This function is used to retrieve a list of all elements in a colshape, of the specified type. - parameters: [] + parameters: + - name: theShape + type: colshape + description: The colshape you want to get the elements from. + - name: elemType + type: string + description: 'The type of element you want a list of. This can be any element + type, the common ones being: "player": A player connected to the server "ped": + A ped "vehicle": A vehicle "object": An object "pickup": A pickup "marker": + A marker' + default: nil examples: - path: examples/getElementsWithinColShape-1.lua description: This example retrieves atableof players inside a colshape and prints their name to the chat. side: server + returns: + values: + - type: table + name: value + description: Returns a table containing all the elements inside the colshape, + of the specified type. Returns an empty table if there are no elements inside. + Returns false if the colshape is invalid. + oop: + element: colshape + method: getElementsWithin + variable: elementsWithin + static: false notes: - type: info content: For legacy reasons, a colshape created on the client does not collide with elements already existing at that location until they first move. This function doesn't verify whether elements are in the same dimension and interior, additional checks could be implemented manually if they are needed. - incomplete: true + requires_review: true diff --git a/functions/Element/getElementsWithinRange.yaml b/functions/Element/getElementsWithinRange.yaml index 6cdbd02e..8dbaf033 100644 --- a/functions/Element/getElementsWithinRange.yaml +++ b/functions/Element/getElementsWithinRange.yaml @@ -1,15 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetElementsWithinRange -server: +shared: name: getElementsWithinRange description: This function is used to retrieve a list of all elements of specified type within a range of 3D coordinates. - parameters: [] + parameters: + - name: x + type: float + description: the x coordinate at which to retrieve elements. + - name: "y" + type: float + description: the y coordinate at which to retrieve elements. + - name: z + type: float + description: the z coordinate at which to retrieve elements. + - name: range + type: float + description: the range at the coordinates in which to retrieve elements. + - name: elemType + type: string + description: 'The type of element you want a list of. This can be any element + type, such as: "player": A player connected to the server. "ped": A ped. "vehicle": + A vehicle. "object": An object. "pickup": A pickup. "marker": A marker.' + default: '""' + - name: interior + type: int + description: MISSING_PARAM_DESC + - name: dimension + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getElementsWithinRange-1.lua description: This example allows admins to destroy all vehicles in close proximity. side: server + returns: + values: + - type: table + name: value + description: Returns a table containing all the elements of the specified type + within range. Returns an empty table if there are no elements within range. + Returns false if the arguments are invalid. + oop: + element: Element + method: ) + static: true notes: - type: info content: This function checks if elements are in a box, not in a sphere. This function doesn't work with elements which are created by createElement. - incomplete: true + requires_review: true diff --git a/functions/Element/getLowLODElement.yaml b/functions/Element/getLowLODElement.yaml index c66780fd..8124c742 100644 --- a/functions/Element/getLowLODElement.yaml +++ b/functions/Element/getLowLODElement.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLowLODElement -server: +shared: name: getLowLODElement description: This function return the low LOD element that an element is associated with. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose low LOD version we want to get. examples: - path: examples/getLowLODElement-1.lua description: 'This example is not done yet:' side: client + returns: + values: + - type: element + name: value + description: Returns a low LOD element if successful, false otherwise. + oop: + element: element + method: getLowLOD + variable: lowLOD + static: false pair: setLowLODElement - incomplete: true + requires_review: true diff --git a/functions/Element/getRootElement.yaml b/functions/Element/getRootElement.yaml index 268dedf4..a764dce8 100644 --- a/functions/Element/getRootElement.yaml +++ b/functions/Element/getRootElement.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRootElement -server: +shared: name: getRootElement description: 'This function returns the root node of the [element tree](/wiki/Element_tree "Element tree"), called *root*. This node contains every other element: all resource @@ -11,9 +11,14 @@ server: description: This example will output the number of loaded resources by countingresourceelements that are children of therootnode. side: server + returns: + values: + - type: element + name: value + description: Returns the root element . notes: - type: info content: All resources have a predefined global variable called root that has the root element as value. The variable exists server side as well as client side. - incomplete: true + requires_review: true diff --git a/functions/Element/hasElementData.yaml b/functions/Element/hasElementData.yaml index bc32257e..742457a1 100644 --- a/functions/Element/hasElementData.yaml +++ b/functions/Element/hasElementData.yaml @@ -1,11 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HasElementData -server: +shared: name: hasElementData description: This function checks if an element has [element data](/wiki/Element_data "Element data") available under a certain key. - parameters: [] + parameters: + - name: theElement + type: element + description: This is the element with data you want to check. + - name: key + type: string + description: The name of the element data entry you want to check for. (Maximum + 31 characters.) + - name: inherit + type: bool + description: '- toggles whether or not the function should go up the hierarchy + to find the requested key in case the specified element doesn''t have it.' + default: 'true' examples: - path: examples/hasElementData-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns true if the element contains element data for + key , or false if the element doesn't exist or there is no data associated with + the key . + oop: + element: element + method: hasData + static: false + requires_review: true diff --git a/functions/Element/hasElementDataSubscriber.yaml b/functions/Element/hasElementDataSubscriber.yaml index d5278cf6..f51f9ab1 100644 --- a/functions/Element/hasElementDataSubscriber.yaml +++ b/functions/Element/hasElementDataSubscriber.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HasElementDataSubscriber -server: +shared: name: hasElementDataSubscriber description: 'This function returns whether a [player](/wiki/Player "Player") is subscribed to specific [element data](/wiki/Element_data "Element data"). This function is used together with [setElementData](/wiki/SetElementData "SetElementData") in *"subscribe"* mode.' - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to check whether the player is subscribed to. + - name: key + type: string + description: The key you wish to check whether the player is subscribed to. + - name: thePlayer + type: player + description: The player you wish to check. examples: - path: examples/hasElementDataSubscriber-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the player is subscribed, false otherwise. + oop: + element: element + method: hasDataSubscriber + static: false + requires_review: true diff --git a/functions/Element/isElement.yaml b/functions/Element/isElement.yaml index 6add7f8f..4e54e9c0 100644 --- a/functions/Element/isElement.yaml +++ b/functions/Element/isElement.yaml @@ -1,18 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElement -server: +shared: name: isElement description: This function checks if a value is an [element](/wiki/Element "Element") or not. - parameters: [] + parameters: + - name: theValue + type: var + description: The value that we want to check. examples: - path: examples/isElement-1.lua description: This serverside function kills a player when it's passed his name or his element. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the passed value is an element, false otherwise. notes: - type: info content: This function is not reliable as element ids are eventually recycled. Always make sure you nil variables containing an element after calling destroyElement or handle onElementDestroy for players and elements that might be destroyed by another resource - incomplete: true + requires_review: true diff --git a/functions/Element/isElementAttached.yaml b/functions/Element/isElementAttached.yaml index eba209dc..a753dfc0 100644 --- a/functions/Element/isElementAttached.yaml +++ b/functions/Element/isElementAttached.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementAttached -server: +shared: name: isElementAttached description: This functions checks whether or not an element is attached to another element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check for attachment. examples: - path: examples/isElementAttached-1.lua description: 'This examples checks if a player is attached to anything when they enter a console command:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the specified element is attached to another element, + false if it is not attached or nil if an improper argument was passed. + oop: + element: element + method: isAttached + variable: attached + static: false + requires_review: true diff --git a/functions/Element/isElementCallPropagationEnabled.yaml b/functions/Element/isElementCallPropagationEnabled.yaml index 8c7044ad..1afc30f5 100644 --- a/functions/Element/isElementCallPropagationEnabled.yaml +++ b/functions/Element/isElementCallPropagationEnabled.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementCallPropagationEnabled -server: +shared: name: isElementCallPropagationEnabled description: This functions checks if certain element has call propagation enabled. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check examples: - path: examples/isElementCallPropagationEnabled-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the propagation is enabled, false if disabled or + invalid arguments have been passed. + oop: + element: element + method: isCallPropagationEnabled + static: false + requires_review: true diff --git a/functions/Element/isElementCollidableWith.yaml b/functions/Element/isElementCollidableWith.yaml index d7ce2e86..cf3502e8 100644 --- a/functions/Element/isElementCollidableWith.yaml +++ b/functions/Element/isElementCollidableWith.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementCollidableWith -client: +shared: name: isElementCollidableWith description: "This function can be used to check whether specified element is collidable\ \ with another element. \n\n**Note:** You can only use this function with the\ \ element types listed below." - parameters: [] + parameters: + - name: theElement + type: element + description: The element which colliding you want to get + - name: withElement + type: element + description: The other element which colliding with the first entity you want + to get examples: - path: examples/isElementCollidableWith-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the elements collide with each other, false otherwise. + oop: + element: element + method: isCollidableWith + static: false pair: setElementCollidableWith - incomplete: true + requires_review: true diff --git a/functions/Element/isElementDoubleSided.yaml b/functions/Element/isElementDoubleSided.yaml index b883ee10..f61d36bc 100644 --- a/functions/Element/isElementDoubleSided.yaml +++ b/functions/Element/isElementDoubleSided.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementDoubleSided -server: +shared: name: isElementDoubleSided description: This function checks whether an element is double\-sided as set by [setElementDoubleSided](/wiki/SetElementDoubleSided "SetElementDoubleSided") or not. - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you'd like to check the double-sidedness of. examples: - path: examples/isElementDoubleSided-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the theElement is double-sided, false otherwise. + oop: + element: element + method: isDoubleSided + variable: doubleSided + static: false pair: setElementDoubleSided - incomplete: true + requires_review: true diff --git a/functions/Element/isElementFrozen.yaml b/functions/Element/isElementFrozen.yaml index 403824e8..6af1ded0 100644 --- a/functions/Element/isElementFrozen.yaml +++ b/functions/Element/isElementFrozen.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementFrozen -server: +shared: name: isElementFrozen description: This function checks if element has been frozen. - parameters: [] + parameters: + - name: theElement + type: element + description: the element whose freeze status we want to check. examples: - path: examples/isElementFrozen-1.lua description: This example binds the "p" key to a function to freeze/unfreeze the player's current vehicle. side: server + returns: + values: + - type: bool + name: value + oop: + element: element + method: isFrozen + variable: frozen + static: false pair: setElementFrozen - incomplete: true + requires_review: true diff --git a/functions/Element/isElementInWater.yaml b/functions/Element/isElementInWater.yaml index 4e4aeddb..7662615b 100644 --- a/functions/Element/isElementInWater.yaml +++ b/functions/Element/isElementInWater.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementInWater -server: +shared: name: isElementInWater description: This function checks whether an [element](/wiki/Element "Element") is submerged in water. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check. examples: - path: examples/isElementInWater-1.lua description: '' @@ -14,4 +17,15 @@ server: - path: examples/isElementInWater-3.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the passed element is in water, false if it isn't, + or if the element is invalid. + oop: + element: element + method: isInWater + variable: inWater + static: false + requires_review: true diff --git a/functions/Element/isElementLocal.yaml b/functions/Element/isElementLocal.yaml index 117ea758..8fd7b610 100644 --- a/functions/Element/isElementLocal.yaml +++ b/functions/Element/isElementLocal.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementLocal -client: +shared: name: isElementLocal description: This function checks whether a clientside [element](/wiki/Element "Element") is local to the client (doesn't exist in the server) or not. - parameters: [] + parameters: + - name: theElement + type: element + description: The element that we want to check. examples: - path: examples/isElementLocal-1.lua description: This clientside function destroys all local radar blips. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the passed element is local, false if not or if invalid + parameters are passed. + oop: + element: element + method: isLocal + variable: localElement + static: false + requires_review: true diff --git a/functions/Element/isElementLowLOD.yaml b/functions/Element/isElementLowLOD.yaml index 506d9e9c..15c90938 100644 --- a/functions/Element/isElementLowLOD.yaml +++ b/functions/Element/isElementLowLOD.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementLowLOD -server: +shared: name: isElementLowLOD description: This function reveals if an element is low LOD. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose low LOD status we want to get. examples: - path: examples/isElementLowLOD-1.lua description: This example will show how many low lods objects is around you. @@ -11,8 +14,17 @@ server: description: This example will show how many low lods objects is around all the world. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the element is low LOD, false otherwise. + oop: + element: element + method: isLowLOD + static: false notes: - type: info content: See setLowLODElement for the list of valid element types that can be assigned with that function. - incomplete: true + requires_review: true diff --git a/functions/Element/isElementOnFire.yaml b/functions/Element/isElementOnFire.yaml index fe8bc97c..65222ef6 100644 --- a/functions/Element/isElementOnFire.yaml +++ b/functions/Element/isElementOnFire.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementOnFire -server: +shared: name: isElementOnFire description: This function checks if the specified [element](/wiki/Element "Element") is on fire or not. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check. examples: - path: examples/isElementOnFire-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the element is on fire, false otherwise. + oop: + element: element + method: isOnFire + variable: onFire + static: false pair: setElementOnFire - incomplete: true + requires_review: true diff --git a/functions/Element/isElementOnScreen.yaml b/functions/Element/isElementOnScreen.yaml index 6f7d78b0..dc9e7d94 100644 --- a/functions/Element/isElementOnScreen.yaml +++ b/functions/Element/isElementOnScreen.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementOnScreen -client: +shared: name: isElementOnScreen description: This function will check if an element is on the screen. Elements behind objects but still in the camera view count as being on screen. - parameters: [] + parameters: + - name: theElement + type: element + description: The element of which you wish to check wether it's being rendered + on screen. examples: - path: examples/isElementOnScreen-1.lua description: This function will check if you can see your killer when you die. side: client + returns: + values: + - type: bool + name: value + description: Returns true if element is on screen, false if not. + oop: + element: element + method: isOnScreen + variable: onScreen + static: false issues: - - id: '2029' + - id: 2029 description: isElementOnScreen doesn't work for markers - incomplete: true + requires_review: true diff --git a/functions/Element/isElementStreamable.yaml b/functions/Element/isElementStreamable.yaml index 804896db..20085f19 100644 --- a/functions/Element/isElementStreamable.yaml +++ b/functions/Element/isElementStreamable.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementStreamable -client: +shared: name: isElementStreamable description: This function checks whether an [element](/wiki/Element "Element") is streamable as set by [setElementStreamable](/wiki/SetElementStreamable "SetElementStreamable") or not. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check the streamability of. examples: - path: examples/isElementStreamable-1.lua description: Check if side: client + returns: + values: + - type: bool + name: value + description: Returns true if the passed element is streamable like normal, false + if this element must always be streamed in. + oop: + element: element + method: isStreamable + variable: streamable + static: false pair: setElementStreamable - incomplete: true + requires_review: true diff --git a/functions/Element/isElementStreamedIn.yaml b/functions/Element/isElementStreamedIn.yaml index ee1e5238..4e85d5fa 100644 --- a/functions/Element/isElementStreamedIn.yaml +++ b/functions/Element/isElementStreamedIn.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementStreamedIn -client: +shared: name: isElementStreamedIn description: This function checks whether an [element](/wiki/Element "Element") is currently streamed in (not virtualized) and are actual GTA objects in the world. You can force an element to be streamed in using [setElementStreamable](/wiki/SetElementStreamable "SetElementStreamable"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check whether is streamed in or not. examples: - path: examples/isElementStreamedIn-1.lua description: This command shows you how many objects you have streamed in. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the passed element is currently streamed in, false + if it is virtualized. + oop: + element: element + method: isStreamedIn + variable: streamedIn + static: false + requires_review: true diff --git a/functions/Element/isElementSyncer.yaml b/functions/Element/isElementSyncer.yaml index e51abd28..dbb4fc9c 100644 --- a/functions/Element/isElementSyncer.yaml +++ b/functions/Element/isElementSyncer.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementSyncer -client: +shared: name: isElementSyncer description: This function checks whether an [element](/wiki/Element "Element") is synced by the local player or not. Accepted elements are [peds](/wiki/Ped "Ped") and [vehicles](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element to check. examples: - path: examples/isElementSyncer-1.lua description: This example draws a string above peds synced by local player in 50m proximity side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the passed element is synced by the local player, + false otherwise. + oop: + element: element + method: isSyncer + variable: syncedByLocalPlayer + static: false + requires_review: true diff --git a/functions/Element/isElementVisibleTo.yaml b/functions/Element/isElementVisibleTo.yaml index 8fc7bd7d..028d699b 100644 --- a/functions/Element/isElementVisibleTo.yaml +++ b/functions/Element/isElementVisibleTo.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementVisibleTo -server: +shared: name: isElementVisibleTo description: This checks if an element is visible to a player. This does not check if the player can literally see the element, just that they are aware that it @@ -7,10 +7,26 @@ server: "Per-player elements (page does not exist)") are able to be visible only to some players, as such this checks if this is the case for a particular element/player combination. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you want to check the visibility of + - name: visibleTo + type: element + description: The player you want to check against examples: - path: examples/isElementVisibleTo-1.lua description: This checks if the player is visible to them selves. side: server + returns: + values: + - type: bool + name: value + description: Returns true if element is visible to the specified player, false + if not or an invalid argument was passed to the function. + oop: + element: element + method: isVisibleTo + static: false pair: setElementVisibleTo - incomplete: true + requires_review: true diff --git a/functions/Element/isElementWaitingForGroundToLoad.yaml b/functions/Element/isElementWaitingForGroundToLoad.yaml index 9eef5aa9..b4c68219 100644 --- a/functions/Element/isElementWaitingForGroundToLoad.yaml +++ b/functions/Element/isElementWaitingForGroundToLoad.yaml @@ -1,16 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementWaitingForGroundToLoad -client: +shared: name: isElementWaitingForGroundToLoad description: This function checks whether MTA has frozen an element because it is above map objects which are still loading or not. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to check its frozen waiting for custom map objects to + load status. It can be a vehicle , ped or player . examples: - path: examples/isElementWaitingForGroundToLoad-1.lua description: The next code snippet outputs a message when a vehicle respawns far away from players, above anobject. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the specified element is frozen waiting for collisions + of custom map objects to load. Returns false if it's not or if the specified + element is invalid. + oop: + element: element + method: isWaitingForGroundToLoad + variable: waitingForGroundToLoad + static: false notes: - type: info content: When vehicles are frozen waiting for collisions to load they do not overwrite the frozen status set by setElementFrozen . - incomplete: true + requires_review: true diff --git a/functions/Element/isElementWithinColShape.yaml b/functions/Element/isElementWithinColShape.yaml index 2e391f09..9e2c4d15 100644 --- a/functions/Element/isElementWithinColShape.yaml +++ b/functions/Element/isElementWithinColShape.yaml @@ -1,16 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementWithinColShape -server: +shared: name: isElementWithinColShape description: This function is used to determine if an element is within a collision shape. Please note that for legacy reasons, a colshape created on the client does not collide with elements already existing at that location until they first move. Please also note that before 1\.0\.3, this did not function correctly when moving a colshape. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you're checking. + - name: theShape + type: colshape + description: The colshape you're checking examples: - path: examples/isElementWithinColShape-1.lua description: This small script is an example of detecting if a player is within a certain defined colshape. This could serve as a base to perform many functions, rather than just an output. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the element is within the colshape, false otherwise + oop: + element: element + method: isWithinColShape + static: false + requires_review: true diff --git a/functions/Element/isElementWithinMarker.yaml b/functions/Element/isElementWithinMarker.yaml index ef307a87..77cfe694 100644 --- a/functions/Element/isElementWithinMarker.yaml +++ b/functions/Element/isElementWithinMarker.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsElementWithinMarker -server: +shared: name: isElementWithinMarker description: This function is used to determine if an [element](/wiki/Element "Element") is within a [marker](/wiki/Marker "Marker"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element you're checking. + - name: theMarker + type: marker + description: The marker you're checking. examples: - path: examples/isElementWithinMarker-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the element is within the marker, false otherwise + oop: + element: element + method: isWithinMarker + static: false + requires_review: true diff --git a/functions/Element/removeElementData.yaml b/functions/Element/removeElementData.yaml index ffc68904..f0152dc3 100644 --- a/functions/Element/removeElementData.yaml +++ b/functions/Element/removeElementData.yaml @@ -1,17 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveElementData -server: +shared: name: removeElementData description: This function removes the [element data](/wiki/Element_data "Element data") with the given key for that element. The element data removal is synced with all the clients. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to remove the data from. + - name: key + type: string + description: The key string you wish to remove. examples: - path: examples/removeElementData-1.lua description: This will set element data for player which spawned, and then remove it on death. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the data was removed succesfully, false if the given + key does not exist in the element or the element is invalid. + oop: + element: element + method: removeData + static: false notes: - type: info content: If you want to remove the data in client side you can use 'setElementData(element, key, nil)'. - incomplete: true + requires_review: true diff --git a/functions/Element/removeElementDataSubscriber.yaml b/functions/Element/removeElementDataSubscriber.yaml index 5ace79b5..f07de896 100644 --- a/functions/Element/removeElementDataSubscriber.yaml +++ b/functions/Element/removeElementDataSubscriber.yaml @@ -1,15 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveElementDataSubscriber -server: +shared: name: removeElementDataSubscriber description: 'This function unsubscribes a [player](/wiki/Player "Player") from specific [element data](/wiki/Element_data "Element data"). This function is used together with [setElementData](/wiki/SetElementData "SetElementData") in *"subscribe"* mode.' - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to unsubscribe the player from. + - name: key + type: string + description: The key you wish to unsubscribe the player from. + - name: thePlayer + type: player + description: The player you wish to unsubscribe. examples: - path: examples/removeElementDataSubscriber-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was unsubscribed, false otherwise. + oop: + element: element + method: removeDataSubscriber + static: false pair: addElementDataSubscriber - incomplete: true + requires_review: true diff --git a/functions/Element/setElementAlpha.yaml b/functions/Element/setElementAlpha.yaml index b7f03c24..4aebf101 100644 --- a/functions/Element/setElementAlpha.yaml +++ b/functions/Element/setElementAlpha.yaml @@ -1,11 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementAlpha -server: +shared: name: setElementAlpha description: This function sets the alpha (transparency) value for the specified [element](/wiki/Element "Element"). This can be a [player](/wiki/Player "Player"), [ped](/wiki/Ped "Ped"), [object](/wiki/Object "Object"), [vehicle](/wiki/Vehicle "Vehicle") or [weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose alpha you want to set. + - name: alpha + type: int + description: 'The alpha value to set. Values are 0-255, where 255 is fully opaque + and 0 is fully transparent. Note: Objects are fully transparent at 140.' examples: - path: examples/setElementAlpha-1.lua description: This example makes the player invisible. @@ -13,5 +20,15 @@ server: - path: examples/setElementAlpha-2.lua description: This example lets you toggle invisibility when you write /invis. side: server + returns: + values: + - type: bool + name: value + description: Returns true or false if invalid arguments were passed. + oop: + element: element + method: setAlpha + variable: alpha + static: false pair: getElementAlpha - incomplete: true + requires_review: true diff --git a/functions/Element/setElementAngularVelocity.yaml b/functions/Element/setElementAngularVelocity.yaml index 90f611c6..931db7c0 100644 --- a/functions/Element/setElementAngularVelocity.yaml +++ b/functions/Element/setElementAngularVelocity.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementAngularVelocity -server: +shared: name: setElementAngularVelocity description: Sets the angular velocity of a specified, supported element (Applies a spin to it). - parameters: [] + parameters: + - name: theElement + type: element + description: The element to apply the spin to. Can be either a player , ped , + object , vehicle or a custom weapon . + - name: rx + type: float + description: velocity around the X axis + - name: ry + type: float + description: velocity around the Y axis + - name: rz + type: float + description: velocity around the Z axis examples: - path: examples/setElementAngularVelocity-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if it was succesful, false otherwise. + oop: + element: element + method: setAngularVelocity + variable: angularVelocity + static: false pair: getElementAngularVelocity - incomplete: true + requires_review: true diff --git a/functions/Element/setElementAttachedOffsets.yaml b/functions/Element/setElementAttachedOffsets.yaml index 456a4b0c..75b2add5 100644 --- a/functions/Element/setElementAttachedOffsets.yaml +++ b/functions/Element/setElementAttachedOffsets.yaml @@ -1,12 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementAttachedOffsets -server: +shared: name: setElementAttachedOffsets description: This function updates the offsets of an element that has been attached to another element using [attachElements](/wiki/AttachElements "AttachElements"). - parameters: [] + parameters: + - name: theElement + type: element + description: The attached element. + - name: xPosOffset + type: float + description: The x offset, if you want the elements to be a certain distance from + one another (default 0). + - name: "yPosOffset" + type: float + description: The y offset (default 0). + - name: zPosOffset + type: float + description: The z offset (default 0). + - name: xRotOffset + type: float + description: The x rotation offset (default 0). + - name: "yRotOffset" + type: float + description: The y rotation offset (default 0). + - name: zRotOffset + type: float + description: The z rotation offset (default 0). examples: - path: examples/setElementAttachedOffsets-1.lua description: Example:This example creates a car with a minigun side: client + returns: + values: + - type: bool + name: value + description: Returns true if the attaching process was successful, false otherwise. + oop: + element: element + method: setAttachedOffsets + static: false pair: getElementAttachedOffsets - incomplete: true + requires_review: true diff --git a/functions/Element/setElementBonePosition.yaml b/functions/Element/setElementBonePosition.yaml index c8103d47..72583780 100644 --- a/functions/Element/setElementBonePosition.yaml +++ b/functions/Element/setElementBonePosition.yaml @@ -1,17 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementBonePosition -client: +shared: name: setElementBonePosition description: This function sets the position of a bone to the specified coordinates. Currently the [Player](/wiki/Element/Player "Element/Player") and [Ped](/wiki/Element/Ped "Element/Ped") element types are accepted. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to set the bone position on. + - name: bone + type: int + description: the ID of the bone to set the position of. See Bone IDs . + - name: x + type: float + description: The X coordinate of the destination. + - name: "y" + type: float + description: The Y coordinate of the destination. + - name: z + type: float + description: The Z coordinate of the destination. examples: - path: examples/setElementBonePosition-1.lua description: This example shows a surprised CJ with a long neck side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. notes: - type: info content: You need to use this function together with onClientPedsProcessed . - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Element/setElementBoneQuaternion.yaml b/functions/Element/setElementBoneQuaternion.yaml index 1a071c86..f03f2db9 100644 --- a/functions/Element/setElementBoneQuaternion.yaml +++ b/functions/Element/setElementBoneQuaternion.yaml @@ -1,21 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementBoneQuaternion -client: +shared: name: setElementBoneQuaternion description: "This function determines how a particular bone rotates in relation\ \ to the element. \n\nThe use of [quaternions](https://en.wikipedia.org/wiki/Quaternion)\ \ are more effective and do not generate issues like gimbal lock that might arise\ \ with [Euler angles](https://en.wikipedia.org/wiki/Euler_angles), so they are\ \ a preferable choice for rotation." - parameters: [] + parameters: + - name: ped + type: element + description: The element (ped or player) on which the bone's rotation will be + set. + - name: bone + type: int + description: The ID of the bone to set the quaternion of. + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC + - name: w + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setElementBoneQuaternion-1.lua description: This example rotates the player's pelvis 180 degrees around an arbitrary axis.The use ofupdateElementRpHAnimis necessary here as it applies the rotation. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the set was successful, otherwise returns an error + message and returns false . notes: - type: info content: If you want to apply the rotation, updateElementRpHAnim must be called after this function. - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Element/setElementBoneRotation.yaml b/functions/Element/setElementBoneRotation.yaml index 11989fca..a77513d4 100644 --- a/functions/Element/setElementBoneRotation.yaml +++ b/functions/Element/setElementBoneRotation.yaml @@ -1,19 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementBoneRotation -client: +shared: name: setElementBoneRotation description: This function sets the rotation of a specific bone relative to the element. Currently the [Player](/wiki/Element/Player "Element/Player") and [Ped](/wiki/Element/Ped "Element/Ped") element types are accepted. - parameters: [] + parameters: + - name: theElement + type: element + description: The element to set the bone rotation on. + - name: boneId + type: int + description: The ID of the bone to set the rotation of. See Bone IDs . + - name: "yaw" + type: float + description: The yaw rotation value. + - name: pitch + type: float + description: The pitch rotation value. + - name: roll + type: float + description: The roll rotation value. examples: - path: examples/setElementBoneRotation-1.lua description: 'This example shows how you can turn a local player into a so-called ''Helicopter'':' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. notes: - type: info content: updateElementRpHAnim must be called after this function to apply bone rotation. - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Element/setElementCallPropagationEnabled.yaml b/functions/Element/setElementCallPropagationEnabled.yaml index 0d6b43df..4ba46389 100644 --- a/functions/Element/setElementCallPropagationEnabled.yaml +++ b/functions/Element/setElementCallPropagationEnabled.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementCallPropagationEnabled -server: +shared: name: setElementCallPropagationEnabled description: This function enables/disables call propagation on a certain element. Look at the example for a practical application. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose propagation behaviour you'd like to change + - name: enabled + type: bool + description: Whether propagation should be enabled or not examples: - path: examples/setElementCallPropagationEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true , if the propagation behaviour has been changed successfully, + false otherwise. + oop: + element: element + method: setCallPropagationEnabled + static: false + requires_review: true diff --git a/functions/Element/setElementCollidableWith.yaml b/functions/Element/setElementCollidableWith.yaml index 61a95200..9c9163c6 100644 --- a/functions/Element/setElementCollidableWith.yaml +++ b/functions/Element/setElementCollidableWith.yaml @@ -1,14 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementCollidableWith -client: +shared: name: setElementCollidableWith description: "This function can be used to set an element to collide with another\ \ element. An element with collisions disabled does not interact physically with\ \ the other element. \n\n**Note:** You can only use this function with the element\ \ types listed below." - parameters: [] + parameters: + - name: theElement + type: element + description: The element which colliding you want to change + - name: withElement + type: element + description: The other element you wish the first entity to collide with + - name: enabled + type: bool + description: A boolean to indicate whether elements should be able to collide + with eachother ( true ) or not ( false ) examples: - path: examples/setElementCollidableWith-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the collisions were set succesfully, false otherwise. + oop: + element: element + method: setCollidableWith + static: false pair: isElementCollidableWith - incomplete: true + requires_review: true diff --git a/functions/Element/setElementCollisionsEnabled.yaml b/functions/Element/setElementCollisionsEnabled.yaml index 1f1d1f00..95612363 100644 --- a/functions/Element/setElementCollisionsEnabled.yaml +++ b/functions/Element/setElementCollisionsEnabled.yaml @@ -1,15 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementCollisionsEnabled -server: +shared: name: setElementCollisionsEnabled description: This function can disable or enable an element's collisions. An element without collisions does not interact with the physical environment and remains static. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to set the collisions of + - name: enabled + type: bool + description: A boolean to indicate whether collisions are enabled ( true ) or + disabled ( false ) examples: - path: examples/setElementCollisionsEnabled-1.lua description: 'This example disables collisions for all vehicles within a certain radius of a player:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the collisions were set succesfully, false otherwise. + oop: + element: element + method: setCollisionsEnabled + variable: collisions + static: false pair: getElementCollisionsEnabled notes: - type: info @@ -20,4 +37,4 @@ server: - type: info content: Disabling a peds collisions will cause some problems, such as it being unable to move or wrong rotation after creation. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementData.yaml b/functions/Element/setElementData.yaml index 98018f13..10fcef40 100644 --- a/functions/Element/setElementData.yaml +++ b/functions/Element/setElementData.yaml @@ -1,19 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementData -server: +client: name: setElementData description: This function stores [element data](/wiki/Element_data "Element data") under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server\-created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc. - parameters: [] - examples: - - path: examples/setElementData-1.lua - description: This example allows a player to add a custom tag onto their nickname, - and also reverts it back to normal if they wish. - side: server + parameters: + - name: theElement + type: element + description: The element you wish to attach the data to. + - name: key + type: string + description: The key you wish to store the data under. (Maximum 128 characters.) + - name: value + type: var + description: The value you wish to store. See element data for a list of acceptable + datatypes. + - name: synchronize + type: bool + description: Determines whether or not the data will be synchronized with the + server. + default: 'true' + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the data was set successfully, false otherwise. + oop: &id001 + element: element + method: setData + static: false pair: getElementData - notes: + notes: &id002 - type: info content: See Script security for tips on preventing cheaters when using events and element data. @@ -26,4 +46,48 @@ server: - type: tip content: A simple and efficient way to make a variable known to the server and clients is to use setElementData on the root element. - incomplete: true + requires_review: true +server: + name: setElementData + description: This function stores [element data](/wiki/Element_data "Element data") + under a certain key, attached to an element. Element data set using this is then + synced with all clients and the server. The data can contain server\-created elements, + but you should avoid passing data that is not able to be synced such as xmlnodes, + acls, aclgroups etc. + parameters: + - name: theElement + type: element + description: The element you wish to attach the data to. + - name: key + type: string + description: The key you wish to store the data under. (Maximum 128 characters.) + - name: value + type: var + description: The value you wish to store. See element data for a list of acceptable + datatypes. + - name: syncMode + type: string + description: Synchronization mode. "broadcast" - Synchronize to all clients (default + behavior). You can also parse true for this option. "local" - Don't synchronize. + You can also parse false for this option. "subscribe" - Only synchronize to + specific clients. See addElementDataSubscriber and removeElementDataSubscriber + . + default: '"broadcast"' + - name: clientChangesPolicy + type: string + description: MISSING_PARAM_DESC + default: '"default"' + examples: + - path: examples/setElementData-1.lua + description: This example allows a player to add a custom tag onto their nickname, + and also reverts it back to normal if they wish. + side: server + returns: + values: + - type: bool + name: value + description: Returns true if the data was set successfully, false otherwise. + oop: *id001 + pair: getElementData + notes: *id002 + requires_review: true diff --git a/functions/Element/setElementDimension.yaml b/functions/Element/setElementDimension.yaml index 27474ca2..9b02f8af 100644 --- a/functions/Element/setElementDimension.yaml +++ b/functions/Element/setElementDimension.yaml @@ -1,14 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementDimension -server: +shared: name: setElementDimension description: This function allows you to set the [dimension](/wiki/Dimension "Dimension") of an element. See [Dimension](/wiki/Dimension "Dimension") for the in\-depth explanation and the list of valid element types. - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you'd like to set the dimension of. + - name: dimension + type: int + description: An integer representing the dimension ID. You can also use -1 to + make the element visible in all dimensions (only valid to objects). Valid values + are 0 to 65535. examples: - path: examples/setElementDimension-1.lua description: In this example the player's dimension is set to ID 1 when they enter a vehicle, and set back to dimension 0 when they exit the vehicle. side: server + returns: + values: + - type: bool + name: value + description: 'Returns true if theElement and dimension are valid, false otherwise. + + Also returns false if theElement is a player and it''s not alive.' + oop: + element: element + method: setDimension + variable: dimension + static: false pair: getElementDimension - incomplete: true + requires_review: true diff --git a/functions/Element/setElementDoubleSided.yaml b/functions/Element/setElementDoubleSided.yaml index c71d4a70..c0f63116 100644 --- a/functions/Element/setElementDoubleSided.yaml +++ b/functions/Element/setElementDoubleSided.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementDoubleSided -server: +shared: name: setElementDoubleSided description: This function allows you to set the double\-sidedness of an element's model. When an element's model is double\-sided, it's back facing triangles become visible. - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you'd like to set the double-sidedness of. + - name: enable + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setElementDoubleSided-1.lua description: This example shows how to set the double-sidedness of an object in a map file. side: server + returns: + values: + - type: bool + name: value + description: Returns true if theElement is valid, false otherwise. + oop: + element: element + method: setDoubleSided + variable: doubleSided + static: false pair: isElementDoubleSided - incomplete: true + requires_review: true diff --git a/functions/Element/setElementFrozen.yaml b/functions/Element/setElementFrozen.yaml index 8f8d8556..3a88c02a 100644 --- a/functions/Element/setElementFrozen.yaml +++ b/functions/Element/setElementFrozen.yaml @@ -1,26 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementFrozen -server: +shared: name: setElementFrozen description: This function freezes an element (stops it in its position and disables movement) or unfreezes it. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose freeze status we want to change. + - name: freezeStatus + type: bool + description: A boolean denoting whether we want to freeze ( true ) or unfreeze + ( false ) it. examples: - path: examples/setElementFrozen-1.lua description: This example binds the "p" key to a function to freeze/unfreeze the player's current vehicle. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the element was frozen, false if it wasn't or if + invalid arguments are passed. + oop: + element: element + method: setFrozen + variable: frozen + static: false pair: isElementFrozen notes: - type: warning content: This function cancels any animation set by setPedAnimation if you freeze the ped. issues: - - id: '1291' + - id: 1291 description: Ped rotation is always zero on client side if ped has been frozed after creating it - - id: '541' + - id: 541 description: Frozen ped rotation goes wrong with latency reduction enabled - - id: '442' + - id: 442 description: Client-side setElementFrozen should sync vehicle driven by local player - incomplete: true + requires_review: true diff --git a/functions/Element/setElementHealth.yaml b/functions/Element/setElementHealth.yaml index 8984e268..56f4003a 100644 --- a/functions/Element/setElementHealth.yaml +++ b/functions/Element/setElementHealth.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementHealth -server: +shared: name: setElementHealth description: This function sets the health for the specified [element](/wiki/Element "Element"). This can be a [ped](/wiki/Ped "Ped"), [object](/wiki/Object "Object") or a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theElement + type: element + description: The ped , vehicle or object whose health you want to set. + - name: newHealth + type: float + description: A float indicating the new health to set for the element. examples: - path: examples/setElementHealth-1.lua description: This example adds a 'hpslap' console command that lets players "slap" @@ -13,6 +19,17 @@ server: - path: examples/setElementHealth-2.lua description: This example setting health by a command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the new health was set successfully, or false if + invalid arguments were passed. + oop: + element: element + method: setHealth + variable: health + static: false pair: getElementHealth notes: - type: info @@ -21,6 +38,6 @@ server: black smoke 50% 250: white steam 0%, black smoke 100% 249: fire with big black smoke' issues: - - id: '414' + - id: 414 description: Using setElementHealth on a dead ped makes it invincible - incomplete: true + requires_review: true diff --git a/functions/Element/setElementID.yaml b/functions/Element/setElementID.yaml index 483192d5..9bae2cd8 100644 --- a/functions/Element/setElementID.yaml +++ b/functions/Element/setElementID.yaml @@ -1,15 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementID -server: +shared: name: setElementID description: 'This function sets the ID of an element to a string. This can be anything from an identifying number, to a name. You can only change the ID of an element clientside if that element has been created clientside as well.' - parameters: [] + parameters: + - name: theElement + type: element + description: The element you want to set the ID of. + - name: name + type: string + description: The new ID for theElement. examples: - path: examples/setElementID-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: This returns true if successful. It will return false if theElement + is invalid, or does not exist, or if name is invalid, or is not a string. + oop: + element: element + method: setID + variable: id + static: false pair: getElementID - incomplete: true + requires_review: true diff --git a/functions/Element/setElementInterior.yaml b/functions/Element/setElementInterior.yaml index 29cbbb78..06c44a0e 100644 --- a/functions/Element/setElementInterior.yaml +++ b/functions/Element/setElementInterior.yaml @@ -1,9 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementInterior -server: +shared: name: setElementInterior description: This function allows you to set the [interior](/wiki/Interior "Interior") of any element. An interior is the current loaded place, 0 being outside. - parameters: [] + parameters: + - name: theElement + type: element + description: The element in which you'd like to set the interior of. + - name: interior + type: int + description: The interior you want to set the element to. Valid values are 0 to + 255. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. examples: - path: examples/setElementInterior-1.lua description: In this example, if a player were to type /interior 1, they would @@ -13,6 +29,17 @@ server: description: In this example, if a player were to type /interior 1, they would be teleported into this interior side: client + returns: + values: + - type: bool + name: value + description: Returns true if theElement and interior are valid arguments, false + otherwise. + oop: + element: element + method: setInterior + variable: interior + static: false pair: getElementInterior notes: - type: info @@ -21,4 +48,4 @@ server: separately to be sure the position will be set. - type: info content: Some objects / buildings in interior 13 show in all interiors. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementLighting.yaml b/functions/Element/setElementLighting.yaml index f3aaac3e..da56bc95 100644 --- a/functions/Element/setElementLighting.yaml +++ b/functions/Element/setElementLighting.yaml @@ -1,11 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementLighting -client: +shared: name: setElementLighting description: This function changes the lighting value for the specified [element](/wiki/Element "Element"). This can be a [player](/wiki/Player "Player"), [ped](/wiki/Ped "Ped"), [vehicle](/wiki/Vehicle "Vehicle"), [object](/wiki/Object "Object"), [weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose lighting you want to change. + - name: lighting + type: float + description: The lighting value that you want to set. examples: - path: examples/setElementLighting-1.lua description: This example sets the lighting value of all players and vehicles @@ -15,10 +21,21 @@ client: description: This example sets the lighting value to 10 only for our player, while keeping other players at the default value. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. This + function can fail if called right after element creation. + oop: + element: element + method: setLighting + variable: lighting + static: false pair: getElementLighting notes: - type: info content: Lighting is calculated in real-time every frame. Therefore, to correctly override the lighting, you should use this function in combination with the onClientPedsProcessed event, not only for peds, but also for vehicles and objects. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementModel.yaml b/functions/Element/setElementModel.yaml index b3ee6dc1..ecde65ed 100644 --- a/functions/Element/setElementModel.yaml +++ b/functions/Element/setElementModel.yaml @@ -1,9 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementModel -server: +shared: name: setElementModel description: Sets the model of a given element. This allows you to change the model of a player (or ped), a vehicle or an object. - parameters: [] + parameters: + - name: theElement + type: element + description: the element you want to change. + - name: model + type: int + description: 'the model ID to set. For players/peds: A GTASA player model (skin) + ID. See Character Skins . For vehicles: The vehicle ID of the vehicle being + changed. For objects/projectiles/weapons: An int specifying the model id.' examples: - path: examples/setElementModel-1.lua description: This example allows players to change their own skin with a command @@ -13,5 +21,15 @@ server: description: This example allows players to transform their current vehicle into another vehicle model. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: element + method: setModel + variable: model + static: false pair: getElementModel - incomplete: true + requires_review: true diff --git a/functions/Element/setElementOnFire.yaml b/functions/Element/setElementOnFire.yaml index 2898460d..34bd26c0 100644 --- a/functions/Element/setElementOnFire.yaml +++ b/functions/Element/setElementOnFire.yaml @@ -1,19 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementOnFire -server: +shared: name: setElementOnFire description: This function can be used to set a [element](/wiki/Element "Element") on fire or extinguish a fire on it. Supported types are [ped](/wiki/Ped "Ped"), [vehicle](/wiki/Vehicle "Vehicle") and [object](/wiki/Object "Object"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element that we want to set/unset. + - name: isOnFire + type: bool + description: true to set the element on fire, false to extinguish any fire on + it. examples: - path: examples/setElementOnFire-1.lua description: Example 1:This example defines a command handler for the commandfireelement. This will fire up a player or their vehicle if the state is true. Otherwise the fire will be gone. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise + oop: + element: element + method: setOnFire + variable: onFire + static: false pair: isElementOnFire notes: - type: info content: Function on the client side only works on elements created on the client side. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementParent.yaml b/functions/Element/setElementParent.yaml index 7414737a..272ffd36 100644 --- a/functions/Element/setElementParent.yaml +++ b/functions/Element/setElementParent.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementParent -server: +shared: name: setElementParent description: This function is used for setting an element as the parent of another element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element that you wish to set the parent of. + - name: parent + type: element + description: The element you wish to be the parent of theElement . examples: - path: examples/setElementParent-1.lua description: 'This example sets the parent of each spawnpoint to a dummy element:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if both elements are valid, false otherwise. + oop: + element: element + method: setParent + variable: parent + static: false pair: getElementParent notes: - type: info @@ -25,4 +41,4 @@ server: - type: important content: The client-side version of this function can only be used on client-created elements. It cannot be used to modify the parent of server side elements. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementPosition.yaml b/functions/Element/setElementPosition.yaml index f4fe5690..63c632ee 100644 --- a/functions/Element/setElementPosition.yaml +++ b/functions/Element/setElementPosition.yaml @@ -1,21 +1,48 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementPosition -server: +shared: name: setElementPosition description: This function sets the position of an element to the specified coordinates. - parameters: [] + parameters: + - name: theElement + type: element + description: A valid element to be moved. + - name: x + type: float + description: The x coordinate of the destination. + - name: "y" + type: float + description: The y coordinate of the destination. + - name: z + type: float + description: The z coordinate of the destination. + - name: warp + type: bool + description: teleports players, resetting any animations they were doing. Setting + this to false preserves the current animation. + default: 'true' examples: - path: examples/setElementPosition-1.lua description: This example lets admins teleport 5 random players to themselves side: server + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: element + method: setPosition + variable: position + static: false pair: getElementPosition notes: - type: warning content: Do not use this function to spawn a player . It will cause problems with other functions like warpPedIntoVehicle . Use spawnPlayer instead. issues: - - id: '539' + - id: 539 description: Changing player position when he/she has a jetpack will remove the jetpack and bug when skin is changed - - id: '529' + - id: 529 description: Player falls from his bike when its teleported by setElementPosition - incomplete: true + requires_review: true diff --git a/functions/Element/setElementRotation.yaml b/functions/Element/setElementRotation.yaml index b7e7804e..cb041c52 100644 --- a/functions/Element/setElementRotation.yaml +++ b/functions/Element/setElementRotation.yaml @@ -1,9 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementRotation -server: +shared: name: setElementRotation description: Sets the rotation of elements according to the world (does not work with players that are on the ground). - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose rotation will be set + - name: rotX + type: float + description: The element's rotation around the x axis in degrees + - name: rotY + type: float + description: The element's rotation around the y axis in degrees + - name: rotZ + type: float + description: The element's rotation around the z axis in degrees + - name: rotOrder + type: string + description: 'A string representing the rotation order desired when interpreting + the provided euler angles . If omitted, default value is "default" . Allowed + values are: "default": default MTA behavior prior to 1.1, where rotation order + depends on element type "ZXY": rotation about the Z axis ( up ), then about + the resulting X axis ( right ), and finally about the resulting Y axis ( front + ). This is the default rotation order for objects "ZYX": rotation about the + Z axis ( up ), then about the resulting Y axis ( front ), and finally about + the resulting X axis ( right ). This is the default rotation order for vehicles' + default: '"default"' + - name: conformPedRotation + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setElementRotation-1.lua description: '' @@ -11,6 +38,17 @@ server: - path: examples/setElementRotation-2.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the element rotation was successfully set and false + otherwise. + oop: + element: element + method: setRotation + variable: rotation + static: false pair: getElementRotation notes: - type: info @@ -20,4 +58,4 @@ server: - type: tip content: New scripts should set conformPedRotation to true when using this function on peds . This will prevent quirky old behaviour. - incomplete: true + requires_review: true diff --git a/functions/Element/setElementStreamable.yaml b/functions/Element/setElementStreamable.yaml index 32642e48..985d7391 100644 --- a/functions/Element/setElementStreamable.yaml +++ b/functions/Element/setElementStreamable.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementStreamable -client: +shared: name: setElementStreamable description: This function can be used to disable streaming for an element. This will make sure the element is not virtualized (streamed out from GTA) when the @@ -7,12 +7,29 @@ client: representation in the world (entities), such as [players](/wiki/Player "Player"), [peds](/wiki/Ped "Ped"), [vehicles](/wiki/Vehicle "Vehicle") and [objects](/wiki/Object "Object"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to set the streaming of + - name: streamable + type: bool + description: true if this element should stream in/out like normal, false if it + should always be streamed in. examples: - path: examples/setElementStreamable-1.lua description: This example creates anobjectat the center of the map which will always be streamed in when the resource which contains it starts. side: client + returns: + values: + - type: bool + name: value + description: Returns whether the element could be set to be streamable. + oop: + element: element + method: setStreamable + variable: streamable + static: false pair: isElementStreamable notes: - type: tip @@ -23,4 +40,4 @@ client: to stream in new elements of that type. In general, if you disable too many elements (of the same type or not) to stream out, GTA will always try to render them, so it can cause a noticeable FPS drop.' - incomplete: true + requires_review: true diff --git a/functions/Element/setElementSyncer.yaml b/functions/Element/setElementSyncer.yaml index e133361b..52e0bbbd 100644 --- a/functions/Element/setElementSyncer.yaml +++ b/functions/Element/setElementSyncer.yaml @@ -1,14 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementSyncer -server: +shared: name: setElementSyncer description: This function can be used to change the syncer ([player](/wiki/Player "Player")) of an element. The syncer is the player who is responsible for informing the server about the state of that element \- it's position, orientation and other state information. The function can be also used to remove an element's syncer. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose syncer you wish to change. + - name: thePlayer + type: player + description: The player who should be the new syncer of the element. If set to + false , this element will not have a syncer. If set to true , MTA will pick + automatically the nearest or most relevant player to that element. + - name: persist + type: bool + description: If true , the server will not automatically change the syncer. If + set to false , default syncer behavior resumes. + default: 'false' examples: - path: examples/setElementSyncer-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the syncer was changed successfully, false if the + element passed was not a ped or vehicle. + oop: + element: element + method: setSyncer + variable: syncer + static: false pair: getElementSyncer - incomplete: true + requires_review: true diff --git a/functions/Element/setElementVelocity.yaml b/functions/Element/setElementVelocity.yaml index 9ec8a83a..1746f15f 100644 --- a/functions/Element/setElementVelocity.yaml +++ b/functions/Element/setElementVelocity.yaml @@ -1,9 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementVelocity -server: +shared: name: setElementVelocity description: This function sets the velocity (movement speeds) along each axis, for an element. - parameters: [] + parameters: + - name: theElement + type: element + description: The element you wish to set the velocity of. + - name: speedX + type: float + description: A floating point value determining the speed along the X axis. + - name: speedY + type: float + description: A floating point value determining the speed along the Y axis. + - name: speedZ + type: float + description: A floating point value determining the speed along the Z axis. examples: - path: examples/setElementVelocity-1.lua description: This example adds a function which copies the speed of a random player @@ -13,5 +25,16 @@ server: description: This example lets players jump their vehicle into the air (if they are the driver). side: client + returns: + values: + - type: bool + name: value + description: Returns true if the speed was set successfully, false if a bad element + was specified or other bad arguments. + oop: + element: element + method: setVelocity + variable: velocity + static: false pair: getElementVelocity - incomplete: true + requires_review: true diff --git a/functions/Element/setElementVisibleTo.yaml b/functions/Element/setElementVisibleTo.yaml index 6170e6d6..a5e87aaf 100644 --- a/functions/Element/setElementVisibleTo.yaml +++ b/functions/Element/setElementVisibleTo.yaml @@ -1,9 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetElementVisibleTo -server: +shared: name: setElementVisibleTo description: This function can change an [element](/wiki/Element "Element")'s [visibility](/wiki/Visibility "Visibility"). - parameters: [] + parameters: + - name: theElement + type: element + description: The element you want to control the visibility of. + - name: visibleTo + type: element + description: The element you wish the element to be visible or invisible to. Any + child elements that are players will also be able to see the element. See visibility + . + - name: visible + type: bool + description: Whether you are making it visible or invisible to the player. examples: - path: examples/setElementVisibleTo-1.lua description: This example creates a marker and makes it only visibile to the player @@ -13,5 +24,16 @@ server: description: The following example shows how to make the marker visible to everyone except anotherguy side: server + returns: + values: + - type: bool + name: value + description: Returns true if the element's visibility was changed successfully, + false otherwise, for example if you are trying to change the visibility of a + vehicle, player or object. + oop: + element: element + method: setVisibleTo + static: false pair: isElementVisibleTo - incomplete: true + requires_review: true diff --git a/functions/Element/setLowLODElement.yaml b/functions/Element/setLowLODElement.yaml index dd57d6ee..33d502a5 100644 --- a/functions/Element/setLowLODElement.yaml +++ b/functions/Element/setLowLODElement.yaml @@ -1,11 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetLowLODElement -server: +shared: name: setLowLODElement description: This function assigns a low LOD element to an element. The low LOD element is displayed when its associated element is not fully visible. If a low LOD element is assigned to several elements, it will be displayed when any of these elements are not fully visible. - parameters: [] + parameters: + - name: theElement + type: element + description: The element whose low LOD version we want to change. + - name: lowLODElement + type: element + description: MISSING_PARAM_DESC examples: - path: examples/setLowLODElement-1.lua description: 'This example shows how to create and link a normal and low LOD object:' @@ -16,9 +22,19 @@ server: - path: examples/setLowLODElement-3.lua description: 'Changing the draw distance for a model has to be done on the client:' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the assignment was successful, false otherwise. + oop: + element: element + method: setLowLOD + variable: lowLOD + static: false pair: getLowLODElement notes: - type: info content: The only valid elements types for assigning LODs with this function are Object and Building . - incomplete: true + requires_review: true diff --git a/functions/Element/updateElementRpHAnim.yaml b/functions/Element/updateElementRpHAnim.yaml index 540fef2a..31a59925 100644 --- a/functions/Element/updateElementRpHAnim.yaml +++ b/functions/Element/updateElementRpHAnim.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UpdateElementRpHAnim -client: +shared: name: updateElementRpHAnim description: This function updates GTA bone animation for a given [element](/wiki/Element "Element"). Currently the [Player](/wiki/Element/Player "Element/Player") and @@ -7,12 +7,20 @@ client: called after [setElementBoneRotation](/wiki/SetElementBoneRotation "SetElementBoneRotation") for changes to take effect. It should only be called once per frame, after you are done rotating bones on that element, as it is quite heavy. - parameters: [] + parameters: + - name: theElement + type: element + description: the element to update the bone animations. examples: - path: examples/updateElementRpHAnim-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: tip content: If you want to attach an element to a bone, see attachElementToBone . - incomplete: true + requires_review: true diff --git a/functions/Engine/engineAddClothingModel.yaml b/functions/Engine/engineAddClothingModel.yaml index b81c741e..5e6819bd 100644 --- a/functions/Engine/engineAddClothingModel.yaml +++ b/functions/Engine/engineAddClothingModel.yaml @@ -1,7 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineAddClothingModel -client: +shared: name: engineAddClothingModel description: This function adds new CJ clothing model. - parameters: [] + parameters: + - name: theModel + type: dff + description: The model that will be added. + - name: fileName + type: string + description: Name of the file containing the TXD/DFF extension. examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the model was added, and false otherwise. + requires_review: true diff --git a/functions/Engine/engineAddClothingTXD.yaml b/functions/Engine/engineAddClothingTXD.yaml index 1f85935f..620f9526 100644 --- a/functions/Engine/engineAddClothingTXD.yaml +++ b/functions/Engine/engineAddClothingTXD.yaml @@ -1,7 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineAddClothingTXD -client: +shared: name: engineAddClothingTXD description: This function adds new CJ clothing texture. - parameters: [] + parameters: + - name: theTexture + type: txd + description: The texture that will be added. + - name: fileName + type: string + description: Name of the file containing the TXD extension. examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the texture was added, and false otherwise. + requires_review: true diff --git a/functions/Engine/engineAddImage.yaml b/functions/Engine/engineAddImage.yaml index 158a483b..6603f22c 100644 --- a/functions/Engine/engineAddImage.yaml +++ b/functions/Engine/engineAddImage.yaml @@ -1,9 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineAddImage -client: +shared: name: engineAddImage description: This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. **Only two additional archives can be enabled once** - parameters: [] + parameters: + - name: imgArchive + type: img + description: The IMG file you want to add to GTA world. examples: [] - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if the IMG element was successfully added, false otherwise. + oop: + element: img + method: add + static: false + requires_review: true diff --git a/functions/Engine/engineApplyShaderToWorldTexture.yaml b/functions/Engine/engineApplyShaderToWorldTexture.yaml index abb7f57d..b845c171 100644 --- a/functions/Engine/engineApplyShaderToWorldTexture.yaml +++ b/functions/Engine/engineApplyShaderToWorldTexture.yaml @@ -1,9 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineApplyShaderToWorldTexture -client: +shared: name: engineApplyShaderToWorldTexture description: This function applies a [shader](/wiki/Shader "Shader") to one or more world textures. - parameters: [] + parameters: + - name: shader + type: element + description: The shader which is to be applied + - name: textureName + type: string + description: The name of the world texture to apply the shader to. Wildcard matching + e.g. "ro?ds*" can be used to apply to more than one texture at a time. + - name: targetElement + type: element + description: The element to restrict applying the shader to. If this is not set + the shader will be applied to everything using the texture name. Valid element + types for targetElement are vehicles , objects and peds . + default: nil + - name: appendLayers + type: bool + description: allows two or more layered shaders to be applied in the same texture. + You may want to modify the DepthBias in the technique pass to avoid Z-fighting + artifacts when using this. + default: 'true' examples: - path: examples/engineApplyShaderToWorldTexture-1.lua description: This example will replace the texture of a group of common explosions @@ -21,6 +40,15 @@ client: description: 'Basic texture replacement shader example (compatible with all script examples on this page):' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the shader was successfully applied, false otherwise. + oop: + element: shader + method: applyToWorldTexture + static: false notes: - type: tip content: 'The resource shader_tex_names can help in finding the names of world @@ -32,4 +60,4 @@ client: "cj_ped_hat", "cj_ped_torso", "cj_ped_legs", "cj_ped_feet", "cj_ped_glasses", "cj_ped_necklace", "cj_ped_watch" and "cj_ped_extra1". Latest version of shader_tex_names will show what is being used.' - incomplete: true + requires_review: true diff --git a/functions/Engine/engineFreeModel.yaml b/functions/Engine/engineFreeModel.yaml index 9c60f3c9..40a574d3 100644 --- a/functions/Engine/engineFreeModel.yaml +++ b/functions/Engine/engineFreeModel.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineFreeModel -client: +shared: name: engineFreeModel description: This function is used to un\-assign the specified model ID from the [engineRequestModel](/wiki/EngineRequestModel "EngineRequestModel") assignment. - parameters: [] + parameters: + - name: modelID + type: int + description: the model ID you want to have un-assigned. examples: - path: examples/engineFreeModel-1.lua description: This example creates a ped and then gives you the opportunity to @@ -11,6 +14,11 @@ client: Use/capfor creating the ped and/sapto skin the ped. You will need some skins added to a folder and to the meta.xml for/sapto work. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the model was successfully freed, false otherwise. notes: - type: info content: If there are elements created on the game world whose model ID does match @@ -21,4 +29,4 @@ client: are still streamed-in. Creators of custom model systems have to be careful though as custom model IDs should only be released if all elements that use said ID are streamed-out or destroyed. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineFreeTXD.yaml b/functions/Engine/engineFreeTXD.yaml index e351e1d4..cdab3511 100644 --- a/functions/Engine/engineFreeTXD.yaml +++ b/functions/Engine/engineFreeTXD.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineFreeTXD -client: +shared: name: engineFreeTXD description: This function is used to un\-assign the specified TXD ID from the [engineRequestTXD](/wiki/EngineRequestTXD "EngineRequestTXD") assignment. - parameters: [] + parameters: + - name: txdID + type: int + description: the TXD ID you want to have un-assigned. examples: - path: examples/engineFreeTXD-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the TXD was successfully freed, false otherwise. + requires_review: true diff --git a/functions/Engine/engineGetModelFlags.yaml b/functions/Engine/engineGetModelFlags.yaml index 8de1321b..fab01dfc 100644 --- a/functions/Engine/engineGetModelFlags.yaml +++ b/functions/Engine/engineGetModelFlags.yaml @@ -1,7 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelFlags -client: +shared: name: engineGetModelFlags description: This function returns [model flags](/wiki/Model_flags "Model flags"). - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to get flags. examples: [] - incomplete: true + returns: + values: + - type: int + name: value + description: Returns int with model flags in GTA format, throws an error otherwise. + oop: + element: Engine + method: getModelFlags + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelIDFromName.yaml b/functions/Engine/engineGetModelIDFromName.yaml index 704efc46..7d5bb658 100644 --- a/functions/Engine/engineGetModelIDFromName.yaml +++ b/functions/Engine/engineGetModelIDFromName.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelIDFromName -client: +shared: name: engineGetModelIDFromName description: This function gets the model ID of an object model from object name. This function is the counterpart of [engineGetModelNameFromID](/wiki/EngineGetModelNameFromID "EngineGetModelNameFromID"). - parameters: [] + parameters: + - name: modelName + type: string + description: The model name of the object examples: - path: examples/engineGetModelIDFromName-1.lua description: This example gets the model ID and name of an element you target (doesn't work for San Andreas world) side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int with the ID of the object model, false otherwise. + oop: + element: Engine + method: getModelIDFromName + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelLODDistance.yaml b/functions/Engine/engineGetModelLODDistance.yaml index cd9af822..bef3f0e7 100644 --- a/functions/Engine/engineGetModelLODDistance.yaml +++ b/functions/Engine/engineGetModelLODDistance.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelLODDistance -client: +shared: name: engineGetModelLODDistance description: This function gets the LOD distance for any object / model ID. - parameters: [] + parameters: + - name: model + type: int + description: The model / object ID number you want to get the LOD distance of. examples: - path: examples/engineGetModelLODDistance-1.lua description: This example calculates the actual LOD distance by taking into account the Video tab 'Draw distance' setting side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float representing the LOD distance of the model, or false + if the model argument is incorrect. + oop: + element: Engine + method: getModelLODDistance + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelNameFromID.yaml b/functions/Engine/engineGetModelNameFromID.yaml index ca3afedf..85d985f3 100644 --- a/functions/Engine/engineGetModelNameFromID.yaml +++ b/functions/Engine/engineGetModelNameFromID.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelNameFromID -client: +shared: name: engineGetModelNameFromID description: This function gets the model name of an object model from model ID. This function is the counterpart of [engineGetModelIDFromName](/wiki/EngineGetModelIDFromName "EngineGetModelIDFromName"). - parameters: [] + parameters: + - name: modelID + type: int + description: The model ID of the object examples: - path: examples/engineGetModelNameFromID-1.lua description: This example gets the model name of an element you target (doesn't work for San Andreas world) side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string with the name of the object model, false otherwise. + oop: + element: Engine + method: getModelNameFromID + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelPhysicalPropertiesGroup.yaml b/functions/Engine/engineGetModelPhysicalPropertiesGroup.yaml index 41f2678f..98120ac0 100644 --- a/functions/Engine/engineGetModelPhysicalPropertiesGroup.yaml +++ b/functions/Engine/engineGetModelPhysicalPropertiesGroup.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelPhysicalPropertiesGroup -client: +shared: name: engineGetModelPhysicalPropertiesGroup description: This function gets physical properties group id used by given model. - parameters: [] + parameters: + - name: modelID + type: int + description: the id of model which you wish to get physical properties group of. examples: - path: examples/engineGetModelPhysicalPropertiesGroup-1.lua description: '' @@ -10,4 +13,11 @@ client: - path: examples/engineGetModelPhysicalPropertiesGroup-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns id of physical properties group that requested model uses, + in range of 0-159 , if the object doesn't have a group assigned, -1 is returned. + If passed arguments were wrong, error is triggered. + requires_review: true diff --git a/functions/Engine/engineGetModelTXDID.yaml b/functions/Engine/engineGetModelTXDID.yaml index a6270454..8b9916fe 100644 --- a/functions/Engine/engineGetModelTXDID.yaml +++ b/functions/Engine/engineGetModelTXDID.yaml @@ -1,7 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelTXDID -client: +shared: name: engineGetModelTXDID description: This function gets TXD ID from a model. - parameters: [] + parameters: + - name: modelID + type: number + description: ID of the model you want to get TXD ID from. examples: [] - incomplete: true + returns: + values: + - type: number + name: value + description: Returns ID if successful, false otherwise. + oop: + element: Engine + method: getModelTXDID + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelTextureNames.yaml b/functions/Engine/engineGetModelTextureNames.yaml index 4750afd8..e1d39e0e 100644 --- a/functions/Engine/engineGetModelTextureNames.yaml +++ b/functions/Engine/engineGetModelTextureNames.yaml @@ -1,9 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelTextureNames -client: +shared: name: engineGetModelTextureNames description: This function returns a table of the world textures which are applied to the specified model. - parameters: [] + parameters: + - name: modelId + type: string + description: MISSING_PARAM_DESC + default: '""' examples: - path: examples/engineGetModelTextureNames-1.lua description: This example will output the texture names applied to the Comet. @@ -11,4 +15,14 @@ client: - path: examples/engineGetModelTextureNames-2.lua description: The model name can also be used. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table if this function succeeds, false if it fails for + some reason. + oop: + element: Engine + method: getModelTextureNames + static: true + requires_review: true diff --git a/functions/Engine/engineGetModelTextures.yaml b/functions/Engine/engineGetModelTextures.yaml index bcba2093..e1bd3cd8 100644 --- a/functions/Engine/engineGetModelTextures.yaml +++ b/functions/Engine/engineGetModelTextures.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelTextures -client: +shared: name: engineGetModelTextures description: This function allows you to get the textures of any model. - parameters: [] + parameters: + - name: modelName/modelID + type: string/int + description: MISSING_PARAM_DESC + - name: textureNames + type: string/table + description: Only return textures with specified name(s). You can provide a single + string or a table of strings. Wildcard matching e.g. "ro?ds*" can be used. examples: - path: examples/engineGetModelTextures-1.lua description: Get the textures for model ID 3722 and draw them with dxDrawImage. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of texture elements [textureName, texture], false + otherwise. + requires_review: true diff --git a/functions/Engine/engineGetModelVisibleTime.yaml b/functions/Engine/engineGetModelVisibleTime.yaml index 489305a2..a685425c 100644 --- a/functions/Engine/engineGetModelVisibleTime.yaml +++ b/functions/Engine/engineGetModelVisibleTime.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetModelVisibleTime -client: +shared: name: engineGetModelVisibleTime description: This function returns a model's visibility time, this is used for example for building lights being shown after 23:00\. - parameters: [] + parameters: + - name: modelId + type: int + description: The ID of the model. examples: - path: examples/engineGetModelVisibleTime-1.lua description: Make Los Santos Tower visible only between 10 and 12 AM. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns 2 integers , indicating timeOn and timeOff . + requires_review: true diff --git a/functions/Engine/engineGetObjectGroupPhysicalProperty.yaml b/functions/Engine/engineGetObjectGroupPhysicalProperty.yaml index ea399eca..225db9ba 100644 --- a/functions/Engine/engineGetObjectGroupPhysicalProperty.yaml +++ b/functions/Engine/engineGetObjectGroupPhysicalProperty.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetObjectGroupPhysicalProperty -client: +shared: name: engineGetObjectGroupPhysicalProperty description: This function gets physical property of given properties group. - parameters: [] + parameters: + - name: groupID + type: int + description: the id of physical properties group which you wish to get a property + from. + - name: property + type: objectgroup-modifiable + description: MISSING_PARAM_DESC examples: - path: examples/engineGetObjectGroupPhysicalProperty-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: var + name: value + description: Returns the value contained in given property if everything went + well, error is raised otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -27,3 +39,4 @@ client: - Missing section: Fx Effect ' + requires_review: true diff --git a/functions/Engine/engineGetPoolCapacity.yaml b/functions/Engine/engineGetPoolCapacity.yaml index 7f7c6ed2..51e4d942 100644 --- a/functions/Engine/engineGetPoolCapacity.yaml +++ b/functions/Engine/engineGetPoolCapacity.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetPoolCapacity -client: +shared: name: engineGetPoolCapacity description: This function returns the capacity of the provided pool. - parameters: [] + parameters: + - name: pool + type: string + description: Name of the pool examples: [] - incomplete: true + returns: + values: + - type: number + name: value + description: The capacity of the provided pool as positive number meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +19,4 @@ client: - Missing section: Engine pools ' + requires_review: true diff --git a/functions/Engine/engineGetPoolDefaultCapacity.yaml b/functions/Engine/engineGetPoolDefaultCapacity.yaml index 8c814007..b96e29c6 100644 --- a/functions/Engine/engineGetPoolDefaultCapacity.yaml +++ b/functions/Engine/engineGetPoolDefaultCapacity.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetPoolDefaultCapacity -client: +shared: name: engineGetPoolDefaultCapacity description: This function returns the default capacity of the provided pool. - parameters: [] + parameters: + - name: pool + type: string + description: Name of the pool examples: [] - incomplete: true + returns: + values: + - type: number + name: value + description: The default capacity of the provided pool as positive number meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +19,4 @@ client: - Missing section: Engine pools ' + requires_review: true diff --git a/functions/Engine/engineGetPoolUsedCapacity.yaml b/functions/Engine/engineGetPoolUsedCapacity.yaml index f0f0ddc9..c2fed08a 100644 --- a/functions/Engine/engineGetPoolUsedCapacity.yaml +++ b/functions/Engine/engineGetPoolUsedCapacity.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetPoolUsedCapacity -client: +shared: name: engineGetPoolUsedCapacity description: This function returns the used capacity of the provided pool. - parameters: [] + parameters: + - name: pool + type: string + description: Name of the pool examples: [] - incomplete: true + returns: + values: + - type: number + name: value + description: The used capacity of the provided pool as positive number meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +19,4 @@ client: - Missing section: Engine pools ' + requires_review: true diff --git a/functions/Engine/engineGetSurfaceProperties.yaml b/functions/Engine/engineGetSurfaceProperties.yaml index 19c51aab..3e38287b 100644 --- a/functions/Engine/engineGetSurfaceProperties.yaml +++ b/functions/Engine/engineGetSurfaceProperties.yaml @@ -1,15 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetSurfaceProperties -client: +shared: name: engineGetSurfaceProperties description: This function retrieves the value of a surface property. - parameters: [] + parameters: + - name: surfaceID + type: int + description: Material ID from 0 to 178 + - name: property + type: string + description: Property name examples: - path: examples/engineGetSurfaceProperties-1.lua description: In this example, we retrieve the surface property value for a material with ID 5 and the property name β€œaudio.” If successful, it displays the value; otherwise, it indicates an invalid input side: client - incomplete: true + returns: + values: + - type: mixed + name: value + description: Returns the current property value. See the table below for possible + values. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -19,3 +30,4 @@ client: - Missing section: Materials, surfaces properties ' + requires_review: true diff --git a/functions/Engine/engineGetVisibleTextureNames.yaml b/functions/Engine/engineGetVisibleTextureNames.yaml index 6d2e10b3..7a1a08b9 100644 --- a/functions/Engine/engineGetVisibleTextureNames.yaml +++ b/functions/Engine/engineGetVisibleTextureNames.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineGetVisibleTextureNames -client: +shared: name: engineGetVisibleTextureNames description: This function returns a list of the world textures which are being used to draw the current scene. - parameters: [] + parameters: + - name: nameFilter + type: string + description: Only include textures that match the wildcard string. + default: '"*"' + - name: modelId + type: string + description: MISSING_PARAM_DESC + default: '""' examples: - path: examples/engineGetVisibleTextureNames-1.lua description: This example will output the names of all the visible textures that start with 'a' side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of texture names. + oop: + element: Engine + method: getVisibleTextureNames + static: true + requires_review: true diff --git a/functions/Engine/engineImageGetFile.yaml b/functions/Engine/engineImageGetFile.yaml index 5aa49013..30491c40 100644 --- a/functions/Engine/engineImageGetFile.yaml +++ b/functions/Engine/engineImageGetFile.yaml @@ -1,10 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImageGetFile -client: +shared: name: engineImageGetFile description: This function gets a file from an IMG container. - parameters: [] + parameters: + - name: img_file + type: img + description: The IMG file you want to get file from. + - name: file + type: string/number + description: Name or position of the file you want to get. examples: - path: examples/engineImageGetFile-1.lua description: 'You could use the following code:' side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns file's binary data if successful, false otherwise. Data size + is bonded to 2 Kb block size. + oop: + element: img + method: getFile + static: false + requires_review: true diff --git a/functions/Engine/engineImageGetFiles.yaml b/functions/Engine/engineImageGetFiles.yaml index b96f679a..38cf5a20 100644 --- a/functions/Engine/engineImageGetFiles.yaml +++ b/functions/Engine/engineImageGetFiles.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImageGetFiles -client: +shared: name: engineImageGetFiles description: This function gets the list of files from an IMG container. - parameters: [] + parameters: + - name: imgArchive + type: img + description: The IMG file handler you want to get files from. examples: - path: examples/engineImageGetFiles-1.lua description: 'You could use the following code:' side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns array table with files in the IMG element if successfull, + false otherwise. + oop: + element: img + method: getFiles + variable: files + static: false + requires_review: true diff --git a/functions/Engine/engineImageGetFilesCount.yaml b/functions/Engine/engineImageGetFilesCount.yaml index 403d6ab7..70095de3 100644 --- a/functions/Engine/engineImageGetFilesCount.yaml +++ b/functions/Engine/engineImageGetFilesCount.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImageGetFilesCount -client: +shared: name: engineImageGetFilesCount description: This function returns the number of files an IMG file has. - parameters: [] + parameters: + - name: imgArchive + type: img + description: the IMG archive handler examples: - path: examples/engineImageGetFilesCount-1.lua description: 'You could use the following code:' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int with the number of files. + oop: + element: img + method: getFilesCount + variable: filesCount + static: false + requires_review: true diff --git a/functions/Engine/engineImageLinkDFF.yaml b/functions/Engine/engineImageLinkDFF.yaml index dad7e996..ac63f162 100644 --- a/functions/Engine/engineImageLinkDFF.yaml +++ b/functions/Engine/engineImageLinkDFF.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImageLinkDFF -client: +shared: name: engineImageLinkDFF description: This function links DFF file with an IMG container. This function does not change a model immediately. You should use [engineRestreamWorld](/wiki/EngineRestreamWorld "EngineRestreamWorld") to reload models. - parameters: [] + parameters: + - name: img_file + type: img + description: The IMG file you want to link. + - name: file_path + type: string + description: Path to the DFF file you want to link. + - name: modelID + type: int + description: ID of the model you want to link to. examples: - path: examples/engineImageLinkDFF-1.lua description: 'You could use the following code:' side: client - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if IMG file was successfully linked, false otherwise. + oop: + element: img + method: linkDFF + static: false + requires_review: true diff --git a/functions/Engine/engineImageLinkTXD.yaml b/functions/Engine/engineImageLinkTXD.yaml index fb98dc40..d00505dd 100644 --- a/functions/Engine/engineImageLinkTXD.yaml +++ b/functions/Engine/engineImageLinkTXD.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImageLinkTXD -client: +shared: name: engineImageLinkTXD description: This function links TXD file with an IMG container. This function does not change a model immediately. You should use [engineRestreamWorld](/wiki/EngineRestreamWorld "EngineRestreamWorld") to reload models. - parameters: [] + parameters: + - name: img_file + type: img + description: The IMG file you want to link. + - name: file_path + type: string + description: Path to the TXD file you want to link. + - name: txdID + type: int + description: ID of the texture dictionary you want to link to. Use engineGetModelTXDID + or engineRequestTXD to get this value. examples: - path: examples/engineImageLinkTXD-1.lua description: 'You could use the following code:' side: client - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if IMG file was successfully linked, false otherwise. + oop: + element: img + method: linkTXD + static: false + requires_review: true diff --git a/functions/Engine/engineImportTXD.yaml b/functions/Engine/engineImportTXD.yaml index b3628089..be1df811 100644 --- a/functions/Engine/engineImportTXD.yaml +++ b/functions/Engine/engineImportTXD.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineImportTXD -client: +shared: name: engineImportTXD description: This function imports (adds) a loaded RenderWare Texture Dictionary into a specific model. This is necessary in order for the DFF loader to find any @@ -7,8 +7,23 @@ client: in order to allow the DFF loading process to find the new textures. This function can also replace default GTA textures, so that it becomes possible to e.g. put custom images on existing billboards. Ped and weapon textures are also supported. - parameters: [] + parameters: + - name: texture + type: txd + description: The TXD that was loaded with engineLoadTXD + - name: model_id + type: int + description: The model id to import the TXD into examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the function executed succesfully, false otherwise. + oop: + element: txd + method: import + static: false notes: - type: info content: CJ clothing component textures can be replaced by using the IDs listed @@ -20,4 +35,4 @@ client: - type: tip content: Do your TXD files take megabytes of disk space? You can read some tips on reducing the size of TXD files to compress them without ruining texture quality. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineLoadCOL.yaml b/functions/Engine/engineLoadCOL.yaml index 12b88b3c..ed0cd234 100644 --- a/functions/Engine/engineLoadCOL.yaml +++ b/functions/Engine/engineLoadCOL.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineLoadCOL -client: +shared: name: engineLoadCOL description: This function loads a RenderWare Collision (COL 1/2/3\) file into GTA. The collisions can then be used to provide collisions for in\-game objects. - parameters: [] + parameters: + - name: col_file / string raw_data + type: string + description: MISSING_PARAM_DESC examples: [] + returns: + values: + - type: col + name: value + description: Returns a COL if the file was loaded, false otherwise. + oop: + element: col + constructorclass: EngineCOL notes: - type: info content: Follow loading order ( COL -> TXD -> DFF ) which is used in the example @@ -12,4 +23,4 @@ client: to technical limitations. Collision libraries (.col files containing multiple collision models) are not supported. See COL for details. Or you can try engineGetCOLsFromLibrary , if you'd like. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineLoadDFF.yaml b/functions/Engine/engineLoadDFF.yaml index 1313fe38..f722cf89 100644 --- a/functions/Engine/engineLoadDFF.yaml +++ b/functions/Engine/engineLoadDFF.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineLoadDFF -client: +shared: name: engineLoadDFF description: This function loads a RenderWare Model (DFF) file into GTA. - parameters: [] + parameters: + - name: dff_file / string raw_data + type: string + description: MISSING_PARAM_DESC examples: [] + returns: + values: + - type: dff + name: value + description: Returns a DFF element if the dff file loaded, false otherwise. + oop: + element: dff + constructorclass: EngineDFF notes: - type: info content: Follow loading order ( COL -> TXD -> DFF ) which is used in the example - as other orders can cause collisions, textures or the DFF not to load due to technical limitations. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineLoadIFP.yaml b/functions/Engine/engineLoadIFP.yaml index 8c610790..d626a363 100644 --- a/functions/Engine/engineLoadIFP.yaml +++ b/functions/Engine/engineLoadIFP.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineLoadIFP -client: +shared: name: engineLoadIFP description: This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3\. @@ -7,14 +7,26 @@ client: IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use [setPedAnimation](/wiki/SetPedAnimation "SetPedAnimation"). - parameters: [] + parameters: + - name: ifp_file / string raw_data + type: string + description: MISSING_PARAM_DESC + - name: custom_block_name + type: string + description: the new block name for the IFP file. You cannot use the GTA default + internal block names. You should namespace this name using a string like resource.blockname examples: - path: examples/engineLoadIFP-1.lua description: This example loads a custom IFP file (parkour.ifp), adds a command "animation" that takes 1 parameter as animation name for playing animations within that IFP. side: client + returns: + values: + - type: ifp + name: value + description: Returns an IFP element if the IFP file loaded, false otherwise. notes: - type: tip content: If you want to synchronize animations, you can check [ ifp_demo ] resource - incomplete: true + requires_review: true diff --git a/functions/Engine/engineLoadIMG.yaml b/functions/Engine/engineLoadIMG.yaml index f3723134..fe80fdb5 100644 --- a/functions/Engine/engineLoadIMG.yaml +++ b/functions/Engine/engineLoadIMG.yaml @@ -1,20 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineLoadIMG -client: +shared: name: engineLoadIMG description: If you're experiencing crashes/game hangs with default values, try to adjust memory/buffer/cache sizes with [engineStreamingSetMemorySize](/wiki/EngineStreamingSetMemorySize "EngineStreamingSetMemorySize"), [engineStreamingSetBufferSize](/wiki/EngineStreamingSetBufferSize "EngineStreamingSetBufferSize") and/or [engineStreamingSetModelCacheLimits](/wiki/EngineStreamingSetModelCacheLimits "EngineStreamingSetModelCacheLimits"). - parameters: [] + parameters: + - name: img_file + type: string + description: The filepath to the IMG file you want to load. examples: - path: examples/engineLoadIMG-1.lua description: This example loads IMG file from directory and then prints number of files in it side: client + returns: + values: + - type: img + name: value + description: Returns an IMG element if the IMG file loaded, false otherwise. + oop: + element: dff + constructorclass: EngineIMG notes: - type: info content: If you're experiencing crashes/game hangs with default values, try to adjust memory/buffer/cache sizes with engineStreamingSetMemorySize , engineStreamingSetBufferSize and/or engineStreamingSetModelCacheLimits . - incomplete: true + requires_review: true diff --git a/functions/Engine/engineLoadTXD.yaml b/functions/Engine/engineLoadTXD.yaml index a62a25a4..1ba35ff0 100644 --- a/functions/Engine/engineLoadTXD.yaml +++ b/functions/Engine/engineLoadTXD.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineLoadTXD -client: +shared: name: engineLoadTXD description: This function loads a RenderWare Texture Dictionary (TXD) file into GTA. The texture dictionary can then be used to provide textures. - parameters: [] + parameters: + - name: txd_file / string raw_data + type: string + description: MISSING_PARAM_DESC + - name: filteringEnabled + type: bool + description: Whether to enable texture filtering. + default: 'true' examples: [] + returns: + values: + - type: txd + name: value + description: Returns a TXD if the file was loaded, false otherwise. + oop: + element: txd + constructorclass: EngineTXD notes: - type: info content: Follow loading order ( COL -> TXD -> DFF ) which is used in the example @@ -20,4 +35,4 @@ client: visible without anisotropic filtering . It is recommended to set filteringEnabled to false if the TXD was created with mipmaps (the filtering mode can be changed in a TXD editor). - incomplete: true + requires_review: true diff --git a/functions/Engine/enginePreloadWorldArea.yaml b/functions/Engine/enginePreloadWorldArea.yaml index b328d347..32ce87aa 100644 --- a/functions/Engine/enginePreloadWorldArea.yaml +++ b/functions/Engine/enginePreloadWorldArea.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EnginePreloadWorldArea -client: +shared: name: enginePreloadWorldArea description: This function allows a specific area to be loaded **immediately**, which can be useful when teleporting a player. The function is not based on a radius, but a specific zone is loaded. - parameters: [] + parameters: + - name: x + type: float + description: Position in the X axis. + - name: "y" + type: float + description: Position in the Y axis + - name: z + type: float + description: Position in the z axis. + - name: loadingOption + type: string + description: MISSING_PARAM_DESC + default: '"all"' examples: - path: examples/enginePreloadWorldArea-1.lua description: '' @@ -12,4 +25,9 @@ client: - path: examples/enginePreloadWorldArea-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: nil + name: value + description: Nothing + requires_review: true diff --git a/functions/Engine/engineRemoveImage.yaml b/functions/Engine/engineRemoveImage.yaml index d98bde23..6ec78a64 100644 --- a/functions/Engine/engineRemoveImage.yaml +++ b/functions/Engine/engineRemoveImage.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRemoveImage -client: +shared: name: engineRemoveImage description: This function disables streaming from an IMG container. - parameters: [] + parameters: + - name: img_file + type: img + description: The IMG file you want to remove. examples: - path: examples/engineRemoveImage-1.lua description: This example loads IMG file, adds it to GTA and after 10 seconds removes it. side: client - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if stremaing from IMG file was successfully disabled, + false otherwise. + oop: + element: img + method: remove + static: false + requires_review: true diff --git a/functions/Engine/engineRemoveShaderFromWorldTexture.yaml b/functions/Engine/engineRemoveShaderFromWorldTexture.yaml index f6963f07..98c42364 100644 --- a/functions/Engine/engineRemoveShaderFromWorldTexture.yaml +++ b/functions/Engine/engineRemoveShaderFromWorldTexture.yaml @@ -1,12 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRemoveShaderFromWorldTexture -client: +shared: name: engineRemoveShaderFromWorldTexture description: This function removes a [shader](/wiki/Shader "Shader") from one or more world textures. - parameters: [] + parameters: + - name: shader + type: element + description: The shader which is to be removed + - name: textureName + type: string + description: The name of the world texture to remove the shader from. It should + be exactly the same string as used with engineApplyShaderToWorldTexture when + the shader was initially applied. + - name: targetElement + type: element + description: The element to remove the shader from. It should be the same element + as used with engineApplyShaderToWorldTexture when the shader was initially applied. + default: nil examples: - path: examples/engineRemoveShaderFromWorldTexture-1.lua description: This example will remove a previously created shader from the "des_logwall" world texture side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the shader was successfully removed, false otherwise. + oop: + element: shader + method: removeFromWorldTexture + static: false + requires_review: true diff --git a/functions/Engine/engineReplaceAnimation.yaml b/functions/Engine/engineReplaceAnimation.yaml index acaa18c9..1bb5dbd9 100644 --- a/functions/Engine/engineReplaceAnimation.yaml +++ b/functions/Engine/engineReplaceAnimation.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineReplaceAnimation -client: +shared: name: engineReplaceAnimation description: This function replaces a specific internal (default) animation with a custom one that has been loaded using [engineLoadIFP](/wiki/EngineLoadIFP "EngineLoadIFP") @@ -9,7 +9,23 @@ client: to have completely different crouching, walking, and fighting etc., animations running simultaneously at the same time. Also, it's not synchronized, you'll need to execute this function on every client in Lua to synchronize it. - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to replace an animation for. + - name: InternalBlockName + type: string + description: the internal block name. + - name: InternalAnimName + type: string + description: the internal animation name inside InternalBlockName. + - name: CustomBlockName + type: string + description: the custom block name of the loaded IFP file that you passed to engineLoadIFP + as second parameter. + - name: CustomAnimName + type: string + description: the custom animation name inside the loaded IFP file with CustomBlockName. examples: - path: examples/engineReplaceAnimation-1.lua description: This example loads a custom IFP file (parkour.ifp), and replaces @@ -17,4 +33,9 @@ client: press C on your keyboard, the custom animation will be played instead of crouch animation. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false in case of failure. + requires_review: true diff --git a/functions/Engine/engineReplaceCOL.yaml b/functions/Engine/engineReplaceCOL.yaml index e3626b00..497c9a86 100644 --- a/functions/Engine/engineReplaceCOL.yaml +++ b/functions/Engine/engineReplaceCOL.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineReplaceCOL -client: +shared: name: engineReplaceCOL description: This function replaces the collision file of the given model id to the collision file passed. Use [engineLoadCOL](/wiki/EngineLoadCOL "EngineLoadCOL") to load the collision file first. - parameters: [] + parameters: + - name: theCol + type: col + description: The collision file to replace with + - name: modelID + type: int + description: The model ID whose collision file you want to replace examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the collision was successfully replaced, false or + nil if the collision could not be replaced for a reason. + oop: + element: col + method: replace + static: false notes: - type: info content: Follow loading order ( COL -> TXD -> DFF ) which is used in the example @@ -13,4 +29,4 @@ client: to technical limitations. Collision libraries (.col files containing multiple collision models) are not supported. See COL for details. Object models are supported only (no vehicles or players). - incomplete: true + requires_review: true diff --git a/functions/Engine/engineReplaceModel.yaml b/functions/Engine/engineReplaceModel.yaml index b16ba7d9..2fc7b353 100644 --- a/functions/Engine/engineReplaceModel.yaml +++ b/functions/Engine/engineReplaceModel.yaml @@ -1,17 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineReplaceModel -client: +shared: name: engineReplaceModel description: This function replaces the given model ID with the model contained in a DFF file loaded by [engineLoadDFF](/wiki/EngineLoadDFF "EngineLoadDFF"). This function supports [vehicles](/wiki/Vehicle "Vehicle"), [objects](/wiki/Object "Object"), [peds](/wiki/Ped "Ped") and [players](/wiki/Player "Player"). - parameters: [] + parameters: + - name: theModel + type: dff + description: The model to replace the given model ID with + - name: modelID + type: int + description: The model it to replace the model of + - name: alphaTransparency + type: bool + description: Set to true if model uses semi-transparent textures, e.g. windows. + This will ensure other objects behind the semi-transparent textures are rendered + correctly. (Can slightly impact performance, so only set when required) + default: 'false' examples: - path: examples/engineReplaceModel-1.lua description: This example allows you to replace single or many models (with ability to toggle TXD filtering/DFF alpha transparency) - by usingtable. Do not forget to add those file paths tometa.xml side: client + returns: + values: + - type: bool + name: value + description: Returns true if the model was successfully replaced, false if it + failed for some reason, ie. the DFF or the model ID is not valid. + oop: + element: dff + method: replace + static: false notes: - type: info content: Follow loading order ( COL -> TXD -> DFF ) which is used in the example @@ -24,4 +46,4 @@ client: and the original model is not loaded/streamed-in at the time of replacement, this function will succeed and you won't see any error message, neither when the model replacement fails once the original model starts to load/stream-in. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineRequestModel.yaml b/functions/Engine/engineRequestModel.yaml index 87b5795c..5c21d35b 100644 --- a/functions/Engine/engineRequestModel.yaml +++ b/functions/Engine/engineRequestModel.yaml @@ -1,9 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRequestModel -client: +shared: name: engineRequestModel description: This function is used to assign the next available model ID to a certain element type. - parameters: [] + parameters: + - name: elementType + type: string + description: '"ped", "vehicle", "object", "timed-object", "clump", "object-damageable"' + - name: parentID + type: int + description: 'The ID of the parent model (by default this is: 1337 - objects, + 400 - vehicles, 7 - peds, 3425 - clump models, 4715 - timed objects, 994 - damageable + objects).' examples: - path: examples/engineRequestModel-1.lua description: 'This example creates a ped and then gives you the opportunity to @@ -11,6 +19,18 @@ client: Use/capfor creating the ped and/sapto skin the ped. You will need some skins added to a folder and to the meta.xml for/sapto work:' side: client + returns: + values: + - type: int + name: value + description: 'Returns an integer of the model ID that was available to be assigned + to the element type, false if no free model ID available or invalid element + type. + + Do not rely on the model numbers returned being consistent across multiple clients + or multiple runs of resources. There is no guarantee for the order of the numbers + or that the same numbers will always correspond to the same element type. Any + patterns are coincidental.' notes: - type: info content: Vehicle unique features may be unsupported, see issue 1861 for examples @@ -25,4 +45,4 @@ client: (Just like the example below does) - type: important content: parentID should be the same model type to prevent crashes. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineRequestTXD.yaml b/functions/Engine/engineRequestTXD.yaml index 0d312fa1..3bc9e6f6 100644 --- a/functions/Engine/engineRequestTXD.yaml +++ b/functions/Engine/engineRequestTXD.yaml @@ -1,10 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRequestTXD -client: +shared: name: engineRequestTXD description: This function is used to register the next available TXD ID. - parameters: [] + parameters: + - name: name + type: string + description: TXD name string up to 24 characters. examples: - path: examples/engineRequestTXD-1.lua description: This example replaces textures for some Grove Street buildings. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: 'Returns an integer of the TXD ID that was available to be assigned + to game models, false if no free TXD ID available. + + Do not rely on the id numbers returned being consistent across multiple clients + or multiple runs of resources. There is no guarantee for the order of the numbers.' + requires_review: true diff --git a/functions/Engine/engineResetModelFlags.yaml b/functions/Engine/engineResetModelFlags.yaml index 7ad9f520..94f2080c 100644 --- a/functions/Engine/engineResetModelFlags.yaml +++ b/functions/Engine/engineResetModelFlags.yaml @@ -1,7 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineResetModelFlags -client: +shared: name: engineResetModelFlags description: This function restores model flags to default state. - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to reset. examples: [] - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if model flags was successfully restored, false otherwise. + oop: + element: Engine + method: resetModelFlags + static: true + requires_review: true diff --git a/functions/Engine/engineResetModelLODDistance.yaml b/functions/Engine/engineResetModelLODDistance.yaml index e85b2b69..efbfab49 100644 --- a/functions/Engine/engineResetModelLODDistance.yaml +++ b/functions/Engine/engineResetModelLODDistance.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineResetModelLODDistance -client: +shared: name: engineResetModelLODDistance description: This function resets the LOD distance for an object / model ID. - parameters: [] + parameters: + - name: model + type: int + description: The model / object ID number you want to reset the LOD distance of. examples: - path: examples/engineResetModelLODDistance-1.lua description: This code will reset all script spawned objects' LOD distances. It also implements a counter which will show how many objects have been affected by this script. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the LOD distance was reset to default, or false if + the model argument is incorrect, or the LOD distance hasn't been changed. + oop: + element: Engine + method: resetModelLODDistance + static: true + requires_review: true diff --git a/functions/Engine/engineResetModelTXDID.yaml b/functions/Engine/engineResetModelTXDID.yaml index 6f8fac71..f48196aa 100644 --- a/functions/Engine/engineResetModelTXDID.yaml +++ b/functions/Engine/engineResetModelTXDID.yaml @@ -1,8 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineResetModelTXDID -client: +shared: name: engineResetModelTXDID description: This function restores the original TXD ID of the given model ID. Reverses the effect of [EngineSetModelTXDID](/wiki/EngineSetModelTXDID "EngineSetModelTXDID"). - parameters: [] + parameters: + - name: modelID + type: int + description: The ID of the model to restore the model of examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if this function succeeds, throw a error if it fails + for some reason. + oop: + element: Engine + method: resetModelTXDID + static: true + requires_review: true diff --git a/functions/Engine/engineResetSurfaceProperties.yaml b/functions/Engine/engineResetSurfaceProperties.yaml index 677c5491..f931f3bf 100644 --- a/functions/Engine/engineResetSurfaceProperties.yaml +++ b/functions/Engine/engineResetSurfaceProperties.yaml @@ -1,14 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineResetSurfaceProperties -client: +shared: name: engineResetSurfaceProperties description: This function resets a surface property to its default value. If no ID is provided, it will reset all surfaces' properties to their original values. - parameters: [] + parameters: + - name: surfaceID + type: int + description: Material ID from 0 to 178 examples: - path: examples/engineResetSurfaceProperties-1.lua description: This will reset anySurface Propertiesfor id:5 side: client - incomplete: true + returns: + values: + - type: mixed + name: value + description: Returns true if the function executed succesfully, false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -18,3 +25,4 @@ client: - Missing section: Materials, surfaces properties ' + requires_review: true diff --git a/functions/Engine/engineRestoreAnimation.yaml b/functions/Engine/engineRestoreAnimation.yaml index ecd807f7..785febd1 100644 --- a/functions/Engine/engineRestoreAnimation.yaml +++ b/functions/Engine/engineRestoreAnimation.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreAnimation -client: +shared: name: engineRestoreAnimation description: This function restores internal (default) animations that were replaced using [engineReplaceAnimation](/wiki/EngineReplaceAnimation "EngineReplaceAnimation") function. This function only affects a specific [player](/wiki/Player "Player") or [ped](/wiki/Ped "Ped") just like [engineReplaceAnimation](/wiki/EngineReplaceAnimation "EngineReplaceAnimation"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to restore an animation(s) for. + - name: InternalBlockName + type: string + description: the internal block name. + - name: InternalAnimName + type: string + description: the internal animation name inside InternalBlockName. examples: - path: examples/engineRestoreAnimation-1.lua description: Example 1:This example restores all replaced animations within every @@ -20,4 +29,9 @@ client: description: Example 3:This example restores "weapon_crouch" animation within "ped" block for the local player. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false in case of failure. + requires_review: true diff --git a/functions/Engine/engineRestoreCOL.yaml b/functions/Engine/engineRestoreCOL.yaml index e3523744..67fdb6c5 100644 --- a/functions/Engine/engineRestoreCOL.yaml +++ b/functions/Engine/engineRestoreCOL.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreCOL -client: +shared: name: engineRestoreCOL description: This function restores the original collision model of the given model ID. Reverses the effect of [engineReplaceCOL](/wiki/EngineReplaceCOL "EngineReplaceCOL"). - parameters: [] + parameters: + - name: modelID + type: int + description: The ID of the model to restore the model of examples: - path: examples/engineRestoreCOL-1.lua description: Client-Side example for restoring object collision with default one. @@ -11,4 +14,14 @@ client: - path: examples/engineRestoreCOL-2.lua description: Server-side example function for triggering the restore. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if this function succeeds, false or nil if it fails + for some reason. + oop: + element: Engine + method: restoreCOL + static: true + requires_review: true diff --git a/functions/Engine/engineRestoreDFFImage.yaml b/functions/Engine/engineRestoreDFFImage.yaml index 874687c7..29b89dd9 100644 --- a/functions/Engine/engineRestoreDFFImage.yaml +++ b/functions/Engine/engineRestoreDFFImage.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreDFFImage -client: +shared: name: engineRestoreDFFImage description: This function restores changes to DFF file from IMG container. - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to restore. examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if IMG file was successfully restored, false otherwise. + oop: + element: dff + constructorclass: EngineIMG notes: - type: warning content: This article is incomplete and may contain errors - incomplete: true + requires_review: true diff --git a/functions/Engine/engineRestoreModel.yaml b/functions/Engine/engineRestoreModel.yaml index 025d0927..a3048312 100644 --- a/functions/Engine/engineRestoreModel.yaml +++ b/functions/Engine/engineRestoreModel.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreModel -client: +shared: name: engineRestoreModel description: This function restores the visual DFF model of the given model ID. This restores the result of [engineReplaceModel](/wiki/EngineReplaceModel "EngineReplaceModel"). - parameters: [] + parameters: + - name: modelID + type: int + description: The model ID to restore the visuals of examples: - path: examples/engineRestoreModel-1.lua description: Client-Side example for restoring model / vehicle. @@ -12,4 +15,14 @@ client: description: Server-Side example for triggering model / vehicle restore function with "restore" command. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the model was successfully restored, false or nil + if it failed for some reason. + oop: + element: Engine + method: restoreModel + static: true + requires_review: true diff --git a/functions/Engine/engineRestoreModelPhysicalPropertiesGroup.yaml b/functions/Engine/engineRestoreModelPhysicalPropertiesGroup.yaml index 6e8983e0..b728e8f3 100644 --- a/functions/Engine/engineRestoreModelPhysicalPropertiesGroup.yaml +++ b/functions/Engine/engineRestoreModelPhysicalPropertiesGroup.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreModelPhysicalPropertiesGroup -client: +shared: name: engineRestoreModelPhysicalPropertiesGroup description: This function restores original physical properties group used by given model. - parameters: [] + parameters: + - name: modelID + type: int + description: the id of model which you wish to restore original physical properties + group of. examples: - path: examples/engineRestoreModelPhysicalPropertiesGroup-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if there were no issues, if passed arguments were invalid + an error is raised. + requires_review: true diff --git a/functions/Engine/engineRestoreObjectGroupPhysicalProperties.yaml b/functions/Engine/engineRestoreObjectGroupPhysicalProperties.yaml index 76c222f9..115c3471 100644 --- a/functions/Engine/engineRestoreObjectGroupPhysicalProperties.yaml +++ b/functions/Engine/engineRestoreObjectGroupPhysicalProperties.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreObjectGroupPhysicalProperties -client: +shared: name: engineRestoreObjectGroupPhysicalProperties description: This function restores all physical properties of given properties group. - parameters: [] + parameters: + - name: groupID + type: int + description: the id of physical properties group which you wish to restore. examples: - path: examples/engineRestoreObjectGroupPhysicalProperties-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if everything went well, error is raised otherwise. + requires_review: true diff --git a/functions/Engine/engineRestoreTXDImage.yaml b/functions/Engine/engineRestoreTXDImage.yaml index 6c28345d..2ff1de06 100644 --- a/functions/Engine/engineRestoreTXDImage.yaml +++ b/functions/Engine/engineRestoreTXDImage.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestoreTXDImage -client: +shared: name: engineRestoreTXDImage description: This function restores changes to TXD file from IMG container. - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to restore. examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if IMG file was successfully restored, false otherwise. + oop: + element: dff + constructorclass: EngineIMG notes: - type: warning content: This article is incomplete and may contain errors - incomplete: true + requires_review: true diff --git a/functions/Engine/engineRestreamWorld.yaml b/functions/Engine/engineRestreamWorld.yaml index 99364a2a..3cad550a 100644 --- a/functions/Engine/engineRestreamWorld.yaml +++ b/functions/Engine/engineRestreamWorld.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineRestreamWorld -client: +shared: name: engineRestreamWorld description: This function re\-streams everything in the GTA world. Read [this pull request](https://github.com/multitheftauto/mtasa-blue/pull/1735) to understand @@ -9,4 +9,9 @@ client: - path: examples/engineRestreamWorld-1.lua description: 'This function can be used after a model (or more) is loaded withengineLoadDFF:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the world was restreamed successfully, false otherwise. + requires_review: true diff --git a/functions/Engine/engineSetAsynchronousLoading.yaml b/functions/Engine/engineSetAsynchronousLoading.yaml index b7fffb4b..e6f4c901 100644 --- a/functions/Engine/engineSetAsynchronousLoading.yaml +++ b/functions/Engine/engineSetAsynchronousLoading.yaml @@ -1,21 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetAsynchronousLoading -client: +shared: name: engineSetAsynchronousLoading description: This function enables or disables asynchronous model loading. Enabling asynchronous model loading may reduce the small pauses that occur when a new model is displayed for the first time. However, it can cause the new models to appear slightly later than they might have otherwise. - parameters: [] + parameters: + - name: enable + type: bool + description: Set to true/false to enable/disable asynchronous loading. Only works + if the client's preferences has 'Asynchronous Loading' set to 'Auto'. + - name: force + type: bool + description: If set to true, ignores the client's preferences. examples: - path: examples/engineSetAsynchronousLoading-1.lua description: The next example enables the model asynchronous loading ignoring client preferences if there are a lot of objects (and the player wants to). side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function executed successfully, false otherwise. + oop: + element: Engine + method: setAsynchronousLoading + static: true notes: - type: warning content: Using this function with a large amounts of engineReplace* at the same time may cause loading times to be exponentially slower. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -23,3 +38,4 @@ client: - Missing section: How it works ' + requires_review: true diff --git a/functions/Engine/engineSetModelFlag.yaml b/functions/Engine/engineSetModelFlag.yaml index 027596e2..32820912 100644 --- a/functions/Engine/engineSetModelFlag.yaml +++ b/functions/Engine/engineSetModelFlag.yaml @@ -1,8 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelFlag -client: +shared: name: engineSetModelFlag description: This function changes specific [model flag](/wiki/Model_flags "Model flags"). - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to set flag. + - name: flagName + type: string + description: flag name . + - name: state + type: bool + description: flag state. examples: [] - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns boolean with flag state, throws an error otherwise. + requires_review: true diff --git a/functions/Engine/engineSetModelFlags.yaml b/functions/Engine/engineSetModelFlags.yaml index 94a9164b..0b9ce9ea 100644 --- a/functions/Engine/engineSetModelFlags.yaml +++ b/functions/Engine/engineSetModelFlags.yaml @@ -1,7 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelFlags -client: +shared: name: engineSetModelFlags description: This function changes [model flags](/wiki/Model_flags "Model flags"). - parameters: [] + parameters: + - name: modelID + type: int + description: ID of the model you want to change. + - name: flags + type: int + description: flags. + - name: ideFlags + type: bool + description: use IDE flag format. examples: [] - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if model flags was successfully changed, false otherwise. + oop: + element: Engine + method: setModelFlags + static: true + requires_review: true diff --git a/functions/Engine/engineSetModelLODDistance.yaml b/functions/Engine/engineSetModelLODDistance.yaml index 9af66dff..636f4f52 100644 --- a/functions/Engine/engineSetModelLODDistance.yaml +++ b/functions/Engine/engineSetModelLODDistance.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelLODDistance -client: +shared: name: engineSetModelLODDistance description: This function sets a custom LOD distance for any object / model ID. This is the distance at which objects of that model ID are switched to their LOD model, or (if there is no LOD model) become invisible. - parameters: [] + parameters: + - name: model + type: int + description: The model / object ID number you want to change the LOD distance + of. + - name: distance + type: float + description: New LOD distance value in San Andreas units. + - name: extendedLod + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/engineSetModelLODDistance-1.lua description: This example will set the LOD distance of all script-created objects. @@ -17,4 +28,13 @@ client: - path: examples/engineSetModelLODDistance-3.lua description: This example shows how to use LOD's with buildings. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function executed succesfully, false otherwise. + oop: + element: Engine + method: setModelLODDistance + static: true + requires_review: true diff --git a/functions/Engine/engineSetModelPhysicalPropertiesGroup.yaml b/functions/Engine/engineSetModelPhysicalPropertiesGroup.yaml index f142b3d2..5a75a63b 100644 --- a/functions/Engine/engineSetModelPhysicalPropertiesGroup.yaml +++ b/functions/Engine/engineSetModelPhysicalPropertiesGroup.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelPhysicalPropertiesGroup -client: +shared: name: engineSetModelPhysicalPropertiesGroup description: This function sets physical properties group id used by given model. - parameters: [] + parameters: + - name: modelID + type: int + description: the id of model which you wish to set physical properties group of. + - name: groupID + type: int + description: 'the id of new physical properties group to be used by given model. + ADDED/UPDATED IN VERSION 1.6.0 r22485 : Use -1 to disable model physics.' examples: - path: examples/engineSetModelPhysicalPropertiesGroup-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if there were no issues with group change, otherwise + an error is raised notes: - type: info content: Physics can only be disabled for newly created objects and buildings - incomplete: true + requires_review: true diff --git a/functions/Engine/engineSetModelTXDID.yaml b/functions/Engine/engineSetModelTXDID.yaml index 7916e0d7..3bcd6554 100644 --- a/functions/Engine/engineSetModelTXDID.yaml +++ b/functions/Engine/engineSetModelTXDID.yaml @@ -1,7 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelTXDID -client: +shared: name: engineSetModelTXDID description: This function changes the TXD ID of the given model ID. - parameters: [] + parameters: + - name: modelID + type: int + description: The ID of the model to update TXD ID. + - name: txdID + type: int + description: The ID of target TXD. Use engineRequestTXD to get a new TXD ID. examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if this function succeeds, throw a error if it fails + for some reason. + oop: + element: Engine + method: setModelTXDID + static: true + requires_review: true diff --git a/functions/Engine/engineSetModelVisibleTime.yaml b/functions/Engine/engineSetModelVisibleTime.yaml index 4ed21b1c..ad90fd12 100644 --- a/functions/Engine/engineSetModelVisibleTime.yaml +++ b/functions/Engine/engineSetModelVisibleTime.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetModelVisibleTime -client: +shared: name: engineSetModelVisibleTime description: This function changes model visibility time, this is used for example for building lights being shown after 23:00\. - parameters: [] + parameters: + - name: modelID + type: int + description: The ID of the model. + - name: timeOn + type: int + description: Value between 0 and 24 that states when the model should appear. + - name: timeOff + type: int + description: Value between 0 and 24 that states when the model should disappear. examples: - path: examples/engineSetModelVisibleTime-1.lua description: 'Make Los Santos Tower visible only between 10 and 12 AM. Please keep in mind that this function does not affect collision - the building is still there, it''s just invisible:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the change was successful, false otherwise. + requires_review: true diff --git a/functions/Engine/engineSetObjectGroupPhysicalProperty.yaml b/functions/Engine/engineSetObjectGroupPhysicalProperty.yaml index 27631eaf..a7226a00 100644 --- a/functions/Engine/engineSetObjectGroupPhysicalProperty.yaml +++ b/functions/Engine/engineSetObjectGroupPhysicalProperty.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetObjectGroupPhysicalProperty -client: +shared: name: engineSetObjectGroupPhysicalProperty description: This function sets physical property of given properties group. - parameters: [] + parameters: + - name: groupID + type: int + description: the id of physical properties group which you wish to set a property + of. + - name: property + type: objectgroup-modifiable + description: MISSING_PARAM_DESC + - name: newValue + type: var + description: new value of the property, with proper type as specified in table + below examples: - path: examples/engineSetObjectGroupPhysicalProperty-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if everything went well, error is raised otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -27,3 +42,4 @@ client: - Missing section: Fx Effect ' + requires_review: true diff --git a/functions/Engine/engineSetPoolCapacity.yaml b/functions/Engine/engineSetPoolCapacity.yaml index 07be1394..008dba28 100644 --- a/functions/Engine/engineSetPoolCapacity.yaml +++ b/functions/Engine/engineSetPoolCapacity.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetPoolCapacity -client: +shared: name: engineSetPoolCapacity description: This function changes the capacity of the provided pool. - parameters: [] + parameters: + - name: pool + type: string + description: Name of the pool + - name: capacity + type: number + description: New size examples: [] - incomplete: true + returns: + values: + - type: boolean + name: value + description: true if the pool capacity was changed and false if not. Throws an + error if the pool is invalid. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +23,4 @@ client: - Missing section: Engine pools ' + requires_review: true diff --git a/functions/Engine/engineSetSurfaceProperties.yaml b/functions/Engine/engineSetSurfaceProperties.yaml index 9f6653a3..d6ff79ba 100644 --- a/functions/Engine/engineSetSurfaceProperties.yaml +++ b/functions/Engine/engineSetSurfaceProperties.yaml @@ -1,14 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineSetSurfaceProperties -client: +shared: name: engineSetSurfaceProperties description: This function changes a property of a surface. - parameters: [] + parameters: + - name: surfaceID + type: int + description: Material ID from 0 to 178 + - name: property + type: string + description: Property name + - name: value + type: mixed + description: New value from table below examples: - path: examples/engineSetSurfaceProperties-1.lua description: 'This will disable the smoke for the wheels when going on the surfaces with the id below:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function executed succesfully, false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -18,3 +31,4 @@ client: - Missing section: Materials, surfaces properties ' + requires_review: true diff --git a/functions/Engine/engineStreamingFreeUpMemory.yaml b/functions/Engine/engineStreamingFreeUpMemory.yaml index 35c7ec7f..d19ac648 100644 --- a/functions/Engine/engineStreamingFreeUpMemory.yaml +++ b/functions/Engine/engineStreamingFreeUpMemory.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingFreeUpMemory -client: +shared: name: engineStreamingFreeUpMemory description: This function frees up the streaming RAM memory. - parameters: [] + parameters: + - name: bytes + type: int + description: The amount of RAM to be freed up in bytes. examples: - path: examples/engineStreamingFreeUpMemory-1.lua description: 'This example frees up the streaming memory when the resource starts:' side: client + returns: + values: + - type: bool + name: value + description: 'This example frees up the streaming memory when the resource starts:' notes: - type: info content: This function isn't accurate. The function works more like try to free @@ -15,4 +23,4 @@ client: - type: important content: This function is meant for advanced users only, as it can lead to stability issues . If you use it too often, the map might start to flicker. - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingGetBufferSize.yaml b/functions/Engine/engineStreamingGetBufferSize.yaml index 8b47d70e..d35c6c73 100644 --- a/functions/Engine/engineStreamingGetBufferSize.yaml +++ b/functions/Engine/engineStreamingGetBufferSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingGetBufferSize -client: +shared: name: engineStreamingGetBufferSize description: Get the streaming buffer size \[**not** maximum memory size] parameters: [] @@ -8,5 +8,15 @@ client: description: This example adds a command that can be used to change the streaming buffer size, and display the previous value. side: client + returns: + values: + - type: int + name: value + description: The streaming buffer size. It is always a positive non-zero number. + oop: + element: enginestreaming + method: getBufferSize + variable: bufferSize + static: false pair: engineStreamingSetBufferSize - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingGetMemorySize.yaml b/functions/Engine/engineStreamingGetMemorySize.yaml index cd3e7992..dc51c208 100644 --- a/functions/Engine/engineStreamingGetMemorySize.yaml +++ b/functions/Engine/engineStreamingGetMemorySize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingGetMemorySize -client: +shared: name: engineStreamingGetMemorySize description: Gets the maximum amount of RAM \[in bytes] that can be used for streaming parameters: [] @@ -8,9 +8,20 @@ client: description: This example adds a command that can be used to change the streaming memory size, and display the previous value. side: client + returns: + values: + - type: int + name: value + description: The maximum amount of RAM [in bytes] that can be used for streaming. + It is always a non-zero positive number. + oop: + element: enginestreaming + method: getMemorySize + variable: memorySize + static: false pair: engineStreamingSetMemorySize notes: - type: tip content: The `showmemstat` command can be used to see this value in real-time [You might have to scroll down using PgDown on your keyboard] - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingGetModelLoadState.yaml b/functions/Engine/engineStreamingGetModelLoadState.yaml index dcc8095e..86e73115 100644 --- a/functions/Engine/engineStreamingGetModelLoadState.yaml +++ b/functions/Engine/engineStreamingGetModelLoadState.yaml @@ -1,7 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingGetModelLoadState -client: +shared: name: engineStreamingGetModelLoadState description: This function returns load state of model. - parameters: [] + parameters: + - name: modelID + type: number + description: ID of the model you want to get flags. examples: [] - incomplete: true + returns: + values: + - type: string + name: value + description: 'Returns string with model load state. + + Possible load states:' + requires_review: true diff --git a/functions/Engine/engineStreamingGetUsedMemory.yaml b/functions/Engine/engineStreamingGetUsedMemory.yaml index 36ce3a21..876fc0b8 100644 --- a/functions/Engine/engineStreamingGetUsedMemory.yaml +++ b/functions/Engine/engineStreamingGetUsedMemory.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingGetUsedMemory -client: +shared: name: engineStreamingGetUsedMemory description: This function gets the amount of memory (in bytes) used by the GTA streamer. @@ -9,4 +9,10 @@ client: description: 'This example gets the amount of memory used by the streamer when the resource starts:' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: 'This example gets the amount of memory used by the streamer when + the resource starts:' + requires_review: true diff --git a/functions/Engine/engineStreamingReleaseModel.yaml b/functions/Engine/engineStreamingReleaseModel.yaml index 9aedb451..d36f7d8d 100644 --- a/functions/Engine/engineStreamingReleaseModel.yaml +++ b/functions/Engine/engineStreamingReleaseModel.yaml @@ -1,10 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingReleaseModel -client: +shared: name: engineStreamingReleaseModel description: This function sends a unloading request to the game model streamer. - parameters: [] + parameters: + - name: modelID + type: number + description: ID of the model you want to unload. + - name: removeRef + type: boolean + description: decrease references counter. + default: 'false' examples: - path: examples/engineStreamingReleaseModel-1.lua description: This example draws a model side: client - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if the model was unloaded, false otherwise. + requires_review: true diff --git a/functions/Engine/engineStreamingRequestModel.yaml b/functions/Engine/engineStreamingRequestModel.yaml index 8e3bc493..0cff2142 100644 --- a/functions/Engine/engineStreamingRequestModel.yaml +++ b/functions/Engine/engineStreamingRequestModel.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingRequestModel -client: +shared: name: engineStreamingRequestModel description: This function sends a loading request to the game model streamer. - parameters: [] + parameters: + - name: modelID + type: number + description: ID of the model you want to load + - name: addRef + type: boolean + description: increase references counter to prevent the model from unloading. + default: 'false' + - name: isBlocking + type: boolean + description: load model immediately or use async loading. + default: 'false' examples: - path: examples/engineStreamingRequestModel-1.lua description: This example draws a model side: client - incomplete: true + returns: + values: + - type: boolean + name: value + description: Returns true if a new request was created, false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -15,3 +30,4 @@ client: - Missing section: References counter ' + requires_review: true diff --git a/functions/Engine/engineStreamingRestoreBufferSize.yaml b/functions/Engine/engineStreamingRestoreBufferSize.yaml index 37995634..2d6de460 100644 --- a/functions/Engine/engineStreamingRestoreBufferSize.yaml +++ b/functions/Engine/engineStreamingRestoreBufferSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingRestoreBufferSize -client: +shared: name: engineStreamingRestoreBufferSize description: This function resets the streaming buffer. The value is automatically reset when disconnected. @@ -8,4 +8,10 @@ client: - path: examples/engineStreamingRestoreBufferSize-1.lua description: This example restores streaming buffer size. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event occurred, otherwise it throws an error + message and returns false . + requires_review: true diff --git a/functions/Engine/engineStreamingRestoreMemorySize.yaml b/functions/Engine/engineStreamingRestoreMemorySize.yaml index 42c9eaca..2f6fe44c 100644 --- a/functions/Engine/engineStreamingRestoreMemorySize.yaml +++ b/functions/Engine/engineStreamingRestoreMemorySize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingRestoreMemorySize -client: +shared: name: engineStreamingRestoreMemorySize description: Restores the maximum amount of RAM \[in bytes] that can be used for streaming to the default value @@ -9,7 +9,15 @@ client: description: This example adds a command that can be used to change the streaming memory size, and display the previous value. side: client + returns: + values: + - type: nil + name: value + oop: + element: enginestreaming + method: restoreMemorySize + static: false notes: - type: tip content: The function to manipulate the memory size is engineStreamingSetMemorySize - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingSetBufferSize.yaml b/functions/Engine/engineStreamingSetBufferSize.yaml index d078bc12..82085f36 100644 --- a/functions/Engine/engineStreamingSetBufferSize.yaml +++ b/functions/Engine/engineStreamingSetBufferSize.yaml @@ -1,19 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingSetBufferSize -client: +shared: name: engineStreamingSetBufferSize description: Set the streaming buffer size. The larger it is, the more models can be loaded in one go BUT increases the RAM \[**not** streaming memory!] usage. Can help with custom IMG loading speed by reducing pop\-in. - parameters: [] + parameters: + - name: sizeBytes + type: int + description: The streaming buffer size. Must be a positive non-zero number. examples: - path: examples/engineStreamingSetBufferSize-1.lua description: This example adds a command that can be used to change the streaming buffer size, and display the previous value. side: client + returns: + values: + - type: bool + name: value + description: True if there was enough memory to allocate the buffer, false otherwise. + oop: + element: enginestreaming + method: setBufferSize + variable: bufferSize + static: false pair: engineStreamingGetBufferSize notes: - type: important content: This function is meant for advanced users only, as it can lead to stability issues . Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in! - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingSetMemorySize.yaml b/functions/Engine/engineStreamingSetMemorySize.yaml index d4738434..018543e7 100644 --- a/functions/Engine/engineStreamingSetMemorySize.yaml +++ b/functions/Engine/engineStreamingSetMemorySize.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingSetMemorySize -client: +shared: name: engineStreamingSetMemorySize description: Sets the maximum amount of RAM \[in bytes] that can be used for streaming - parameters: [] + parameters: + - name: sizeBytes + type: int + description: The maximum amount of RAM [in bytes] that can be used for streaming. + Must be a positive non-zero number. examples: - path: examples/engineStreamingSetMemorySize-1.lua description: This example adds a command that can be used to change the streaming memory size, and display the previous value. side: client + returns: + values: + - type: nil + name: value + oop: + element: enginestreaming + method: setMemorySize + variable: memorySize + static: false pair: engineStreamingGetMemorySize notes: - type: tip @@ -20,4 +33,4 @@ client: issues . Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well] - incomplete: true + requires_review: true diff --git a/functions/Engine/engineStreamingSetModelCacheLimits.yaml b/functions/Engine/engineStreamingSetModelCacheLimits.yaml index 697ebc30..e1e941e1 100644 --- a/functions/Engine/engineStreamingSetModelCacheLimits.yaml +++ b/functions/Engine/engineStreamingSetModelCacheLimits.yaml @@ -1,9 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EngineStreamingSetModelCacheLimits -client: +shared: name: engineStreamingSetModelCacheLimits description: This function sets custom cache limits for vehicle and pedestrian models based on provided values. The arguments that receive zero mean complete deactivation. - parameters: [] + parameters: + - name: numVehicles + type: int + description: MISSING_PARAM_DESC + - name: numPeds + type: int + description: MISSING_PARAM_DESC examples: - path: examples/engineStreamingSetModelCacheLimits-1.lua description: This example turns off cache limiting. @@ -11,4 +17,10 @@ client: - path: examples/engineStreamingSetModelCacheLimits-2.lua description: This example sets a limit of 128 for the cache. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event occurred, otherwise it throws an error + message and returns false . + requires_review: true diff --git a/functions/Event/addEvent.yaml b/functions/Event/addEvent.yaml index c11038e7..6babf7f6 100644 --- a/functions/Event/addEvent.yaml +++ b/functions/Event/addEvent.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddEvent -server: +shared: name: addEvent description: This function allows you to register a custom [event](/wiki/Event "Event"). Custom events function exactly like the built\-in events. See [event system](/wiki/Event_system "Event system") for more information on the event system. - parameters: [] + parameters: + - name: eventName + type: string + description: The name of the event you wish to create. + - name: allowRemoteTrigger + type: bool + description: A boolean specifying whether this event can be called remotely using + triggerClientEvent / triggerServerEvent or not. + default: 'false' examples: - path: examples/addEvent-1.lua description: This example will define a new event calledonSpecialEvent. @@ -12,4 +20,10 @@ server: - path: examples/addEvent-2.lua description: 'You can then trigger this event later on using:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event was added successfully, false if the event + was already added. + requires_review: true diff --git a/functions/Event/addEventHandler.yaml b/functions/Event/addEventHandler.yaml index 150a59be..c3a77f5a 100644 --- a/functions/Event/addEventHandler.yaml +++ b/functions/Event/addEventHandler.yaml @@ -1,16 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddEventHandler -server: +shared: name: addEventHandler description: This function will add an [event](/wiki/Event "Event") handler. An event handler is a function that will be called when the event it's attached to is triggered. See [event system](/wiki/Event_system "Event system") for more information on how the event system works. - parameters: [] + parameters: + - name: eventName + type: string + description: 'The name of the event you want to attach the handler function to. + Note: The maximum allowed length is 100 ASCII characters (that is, English letters + and numerals)' + - name: attachedTo + type: element + description: The element you wish to attach the handler to. The handler will only + be called when the event it is attached to is triggered for this element, or + one of its children. Often, this can be the root element (meaning the handler + will be called when the event is triggered for any element). + - name: handlerFunction + type: function + description: The handler function you wish to call when the event is triggered. + This function will be passed all of the event's parameters as arguments, but + it isn't required that it takes all of them. + - name: propagate + type: bool + description: A boolean representing whether the handler will be triggered if the + event was propagated down or up the element tree (starting from the source), + and not triggered directly on attachedTo (that is, handlers attached with this + argument set to false will only be triggered if source == this ). In GUI events + you will probably want to set this to false . + default: 'true' + - name: priority + type: string + description: MISSING_PARAM_DESC + default: '"normal"' examples: - path: examples/addEventHandler-1.lua description: This serverside example sends a message to everyone in the server when a player spawns. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the event handler was attached successfully. Returns + false if the specified event could not be found or any parameters were invalid. notes: - type: info content: You shouldn't re-use the same name for your handler function as the event @@ -39,4 +73,4 @@ server: the same issues. It is recommended to adapt a good-natured distancing principle between code meant to run from local logic in separation to code meant to run from remote logic. - incomplete: true + requires_review: true diff --git a/functions/Event/cancelEvent.yaml b/functions/Event/cancelEvent.yaml index ca9273ea..6edaa521 100644 --- a/functions/Event/cancelEvent.yaml +++ b/functions/Event/cancelEvent.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CancelEvent -server: +client: name: cancelEvent description: This function is used to stop the automatic internal handling of events, for example this can be used to prevent an item being given to a player when they @@ -7,11 +7,38 @@ server: event. parameters: [] examples: - - path: examples/cancelEvent-1.lua - description: This example stops the player from entering a vehicle. - side: server - path: examples/cancelEvent-2.lua description: This example prevents any damage to a player clientside by makingcancelEventan event handler for theonClientPlayerDamageevent. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true +server: + name: cancelEvent + description: This function is used to stop the automatic internal handling of events, + for example this can be used to prevent an item being given to a player when they + walk over a pickup, by canceling the [onPickupUse](/wiki/OnPickupUse "OnPickupUse") + event. + parameters: + - name: cancel + type: bool + description: MISSING_PARAM_DESC + default: 'true' + - name: reason + type: string + description: MISSING_PARAM_DESC + default: '""' + examples: + - path: examples/cancelEvent-1.lua + description: This example stops the player from entering a vehicle. + side: server + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/Event/cancelLatentEvent.yaml b/functions/Event/cancelLatentEvent.yaml index 48d7ed7b..bf10f1d2 100644 --- a/functions/Event/cancelLatentEvent.yaml +++ b/functions/Event/cancelLatentEvent.yaml @@ -1,19 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CancelLatentEvent -server: +client: name: cancelLatentEvent description: Stops a latent event from completing - parameters: [] + parameters: + - name: handle + type: int + description: A handle previous got from getLatentEventHandles . examples: - path: examples/cancelLatentEvent-1.lua description: '' side: client + - path: examples/cancelLatentEvent-4.lua + description: '' + side: client + returns: + values: + - type: bool + name: value + description: Returns a true if the latent event was successfully cancelled, or + false if it was not + requires_review: true +server: + name: cancelLatentEvent + description: Stops a latent event from completing + parameters: + - name: thePlayer + type: player + description: The player who is receiving the event. + - name: handle + type: int + description: A handle previous got from getLatentEventHandles . + examples: - path: examples/cancelLatentEvent-2.lua description: '' side: server - path: examples/cancelLatentEvent-3.lua description: '' side: server - - path: examples/cancelLatentEvent-4.lua - description: '' - side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the latent event was successfully cancelled, or + false if it was not + requires_review: true diff --git a/functions/Event/getCancelReason.yaml b/functions/Event/getCancelReason.yaml index 1c22bc68..4383016f 100644 --- a/functions/Event/getCancelReason.yaml +++ b/functions/Event/getCancelReason.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCancelReason -server: +shared: name: getCancelReason description: Gets the reason for cancelling an event. parameters: [] @@ -8,4 +8,9 @@ server: description: This example cancels when a hunterPlayer tries to enter a vehicle and outputs to the world what the player tried to do. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the reason that was given with cancelEvent + requires_review: true diff --git a/functions/Event/getEventHandlers.yaml b/functions/Event/getEventHandlers.yaml index cd94b3f4..d6709c7f 100644 --- a/functions/Event/getEventHandlers.yaml +++ b/functions/Event/getEventHandlers.yaml @@ -1,9 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetEventHandlers -server: +shared: name: getEventHandlers description: This function gets the attached functions from the event and attached element from current lua script. - parameters: [] + parameters: + - name: eventName + type: string + description: The name of the event. For example ( "onPlayerWasted" ). + - name: attachedTo + type: element + description: The element attached to. examples: - path: examples/getEventHandlers-1.lua description: '' @@ -11,4 +17,9 @@ server: - path: examples/getEventHandlers-2.lua description: This example removes all onClientMarkerHit event in current script. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns table with attached functions, empty table otherwise. + requires_review: true diff --git a/functions/Event/getLatentEventHandles.yaml b/functions/Event/getLatentEventHandles.yaml index fa6cf191..ff72ff18 100644 --- a/functions/Event/getLatentEventHandles.yaml +++ b/functions/Event/getLatentEventHandles.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLatentEventHandles -server: +client: name: getLatentEventHandles description: Gets the currently queued latent events. The last one in the table is always the latest event queued. Each returned handle can be used with [getLatentEventStatus](/wiki/GetLatentEventStatus "GetLatentEventStatus") or [cancelLatentEvent](/wiki/CancelLatentEvent "CancelLatentEvent") parameters: [] + examples: [] + returns: + values: + - type: table + name: value + description: Returns a table of handles or false if invalid arguments were passed. + requires_review: true +server: + name: getLatentEventHandles + description: Gets the currently queued latent events. The last one in the table + is always the latest event queued. Each returned handle can be used with [getLatentEventStatus](/wiki/GetLatentEventStatus + "GetLatentEventStatus") or [cancelLatentEvent](/wiki/CancelLatentEvent "CancelLatentEvent") + parameters: + - name: thePlayer + type: player + description: The player who is receiving the events. examples: - path: examples/getLatentEventHandles-1.lua description: This command is triggering an latent-event to server, and if you write the command again and the trigger still didn't end then you have to wait. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of handles or false if invalid arguments were passed. + requires_review: true diff --git a/functions/Event/getLatentEventStatus.yaml b/functions/Event/getLatentEventStatus.yaml index 2ac01b6f..d8e9c5bf 100644 --- a/functions/Event/getLatentEventStatus.yaml +++ b/functions/Event/getLatentEventStatus.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLatentEventStatus -server: +client: name: getLatentEventStatus description: Gets the status of one queued latent event. - parameters: [] + parameters: + - name: handle + type: int + description: A handle previous got from getLatentEventHandles . examples: - path: examples/getLatentEventStatus-1.lua description: The example starts a latent event and outputs the status of the transfer to the client console side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with the following info or false if invalid arguments + were passed:' + requires_review: true +server: + name: getLatentEventStatus + description: Gets the status of one queued latent event. + parameters: + - name: thePlayer + type: player + description: The player who is receiving the event. + - name: handle + type: int + description: A handle previous got from getLatentEventHandles . + examples: [] + returns: + values: + - type: table + name: value + description: 'Returns a table with the following info or false if invalid arguments + were passed:' + requires_review: true diff --git a/functions/Event/removeEventHandler.yaml b/functions/Event/removeEventHandler.yaml index 0a3c598e..d1b75ab7 100644 --- a/functions/Event/removeEventHandler.yaml +++ b/functions/Event/removeEventHandler.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveEventHandler -server: +shared: name: removeEventHandler description: This functions removes a handler function from an [event](/wiki/Event "Event"), so that the function is not called anymore when the event is triggered. See [event system](/wiki/Event_system "Event system") for more information on how the event system works. - parameters: [] + parameters: + - name: eventName + type: string + description: The name of the event you want to detach the handler function from. + - name: attachedTo + type: element + description: The element the handler was attached to. + - name: functionVar + type: function + description: The handler function that was attached. examples: - path: examples/removeEventHandler-1.lua description: This example shows how to toggle a message on/off a screen with a command. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event handler was removed successfully. Returns + false if the specified event handler could not be found or invalid parameters + were passed. + requires_review: true diff --git a/functions/Event/triggerClientEvent.yaml b/functions/Event/triggerClientEvent.yaml index 2c22b2fe..86abfa5d 100644 --- a/functions/Event/triggerClientEvent.yaml +++ b/functions/Event/triggerClientEvent.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerClientEvent -server: +shared: name: triggerClientEvent description: This function triggers an event previously registered on a client. This is the primary means of passing information between the server and the client. @@ -7,7 +7,11 @@ server: function that can do the reverse. You can treat this function as if it was an asynchronous function call, using [triggerServerEvent](/wiki/TriggerServerEvent "TriggerServerEvent") to pass back any returned information if necessary. - parameters: [] + parameters: + - name: table/element sendTo + type: '[' + description: MISSING_PARAM_DESC + default: getRootElement( examples: - path: examples/triggerClientEvent-1.lua description: '' @@ -27,6 +31,12 @@ server: - path: examples/triggerClientEvent-6.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the event trigger has been sent, false if invalid + arguments were specified. notes: - type: info content: It is marginally more efficient to pass one large event than two smaller @@ -43,4 +53,4 @@ server: preferred and highly advisable. resourceRoot can also be used as alternative choice, if addEventHandler is bound to root element, or to resourceRoot when there is need to restrict event to single certain resource. - incomplete: true + requires_review: true diff --git a/functions/Event/triggerEvent.yaml b/functions/Event/triggerEvent.yaml index eea51b9d..cca3b0c9 100644 --- a/functions/Event/triggerEvent.yaml +++ b/functions/Event/triggerEvent.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerEvent -server: +shared: name: triggerEvent description: This function will trigger a named [event](/wiki/Event "Event") on a specific [element](/wiki/Element "Element") in the [element tree](/wiki/Element_tree "Element tree"). See [event system](/wiki/Event_system "Event system") for more information on how the event system works. - parameters: [] + parameters: + - name: eventName + type: string + description: The name of the event you wish to trigger + - name: baseElement + type: element + description: The element you wish to trigger the event on. See event system for + information on how this works. + - name: argument1 + type: var + description: 'The first argument that the event handler expects should be added + after the baseElement variable. NOTE: This function can have more than one of + these arguments specified, once for each argument the event handler is expecting.' + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/triggerEvent-1.lua description: 'If you define a new custom event as follows:' @@ -13,6 +28,11 @@ server: - path: examples/triggerEvent-2.lua description: 'You can then trigger this event later on using:' side: server + returns: + values: + - type: bool + name: value + description: 'If you define a new custom event as follows:' notes: - type: info content: You should avoid triggering events on the root element unless you really @@ -22,4 +42,4 @@ server: - type: info content: See Event Source Element for a descriptive visualization of the event system handling an event trigger. - incomplete: true + requires_review: true diff --git a/functions/Event/triggerLatentClientEvent.yaml b/functions/Event/triggerLatentClientEvent.yaml index e18de524..869686e5 100644 --- a/functions/Event/triggerLatentClientEvent.yaml +++ b/functions/Event/triggerLatentClientEvent.yaml @@ -1,12 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerLatentClientEvent -server: +shared: name: triggerLatentClientEvent description: 'This function is the same as [triggerClientEvent](/wiki/TriggerClientEvent "TriggerClientEvent") except the transmission rate of the data contained in the arguments can be limited and other network traffic is not blocked while the data is being transferred.' - parameters: [] + parameters: + - name: sendTo + type: '[table/element' + description: The event will be sent to all players that are children of the specified + element. By default this is the root element, and hence the event is sent to + all players. If you specify a single player it will just be sent to that player. + This argument can also be a table of player elements. + default: getRootElement( examples: - path: examples/triggerLatentClientEvent-1.lua description: '' @@ -14,13 +21,18 @@ server: - path: examples/triggerLatentClientEvent-2.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the event trigger has been sent, false if invalid + arguments were specified. notes: - type: info content: You should avoid triggering events on the root element unless you really need to. Doing this triggers the event on every element in the element tree , which is potentially very CPU intensive. Use as specific (i.e. low down the tree) element as you can. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -28,3 +40,4 @@ server: - Missing section: triggerClientEvent vs triggerLatentClientEvent test by DreTaX ' + requires_review: true diff --git a/functions/Event/triggerLatentServerEvent.yaml b/functions/Event/triggerLatentServerEvent.yaml index 5c747dd6..3828bd36 100644 --- a/functions/Event/triggerLatentServerEvent.yaml +++ b/functions/Event/triggerLatentServerEvent.yaml @@ -1,11 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerLatentServerEvent -client: +shared: name: triggerLatentServerEvent description: This function is the same as [triggerServerEvent](/wiki/TriggerServerEvent "TriggerServerEvent") except the transmission rate of the data contained in the arguments can be limited and other network traffic is not blocked while the data is being transferred. - parameters: [] + parameters: + - name: event + type: string + description: The name of the event to trigger server-side. You should register + this event with addEvent and add at least one event handler using addEventHandler + . + - name: bandwidth + type: int + description: The bytes per second rate to send the data contained in the arguments. + default: '5000' + - name: persist + type: bool + description: A bool indicating whether the transmission should be allowed to continue + even after the resource that triggered it has since stopped. + default: 'false' + - name: theElement + type: element + description: The element that is the source of the event. This could be another + player, or if this isn't relevant, use the root element. + - name: arguments... + type: unknown + description: A list of arguments to trigger with the event. You can pass any Lua + data type (except functions). You can also pass elements . The total amount + of data should not exceed 100MB. examples: - path: examples/triggerLatentServerEvent-1.lua description: '' @@ -13,4 +36,10 @@ client: - path: examples/triggerLatentServerEvent-2.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event trigger has been sent, false if invalid + arguments were specified. + requires_review: true diff --git a/functions/Event/triggerServerEvent.yaml b/functions/Event/triggerServerEvent.yaml index ac9b2b13..bc5507cd 100644 --- a/functions/Event/triggerServerEvent.yaml +++ b/functions/Event/triggerServerEvent.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TriggerServerEvent -client: +shared: name: triggerServerEvent description: This function triggers an event previously registered on the server. This is the primary means of passing information between the client and the server. @@ -7,7 +7,19 @@ client: function that can do the reverse. You can treat this function as if it was an asynchronous function call, using [triggerClientEvent](/wiki/TriggerClientEvent "TriggerClientEvent") to pass back any returned information if necessary. - parameters: [] + parameters: + - name: event + type: string + description: The name of the event to trigger server-side. You should register + this event with addEvent and add at least one event handler using addEventHandler + . + - name: theElement + type: element + description: The element that is the source of the event. + - name: arguments... + type: unknown + description: A list of arguments to trigger with the event. You can pass any lua + data type (except functions). You can also pass elements . examples: - path: examples/triggerServerEvent-1.lua description: '' @@ -21,6 +33,12 @@ client: - path: examples/triggerServerEvent-4.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the event trigger has been sent, false if invalid + arguments were specified or a client side element was a parameter. notes: - type: info content: It is marginally more efficient to pass one large event than two smaller @@ -39,4 +57,4 @@ client: to restrict event to single certain resource (although cheater could still trigger it from different resource, by using getResourceRootElement and passing respective resource root element) - incomplete: true + requires_review: true diff --git a/functions/Event/wasEventCancelled.yaml b/functions/Event/wasEventCancelled.yaml index f43c8bd4..e40a1ff5 100644 --- a/functions/Event/wasEventCancelled.yaml +++ b/functions/Event/wasEventCancelled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/WasEventCancelled -server: +shared: name: wasEventCancelled description: This function checks if the last completed event was cancelled. This is mainly useful for custom events created by scripts. @@ -10,4 +10,10 @@ server: if anonMarkerHitevent was triggered on a marker whose parent was aflagelement. If the event isn't canceled then an element data value is set on the player. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the event was cancelled, false if it wasn't or doesn't + exist. + requires_review: true diff --git a/functions/Explosion/createExplosion.yaml b/functions/Explosion/createExplosion.yaml index 3deb0312..e855fb11 100644 --- a/functions/Explosion/createExplosion.yaml +++ b/functions/Explosion/createExplosion.yaml @@ -1,16 +1,82 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateExplosion +client: + name: createExplosion + description: Creates an explosion of a certain type at a specified point in the + world. If creator is specified, the explosion will occur only in its dimension. + parameters: + - name: x + type: float + description: a float value that specifies the X world coordinate where the explosion + is created at. + - name: "y" + type: float + description: a float value that specifies the Y world coordinate where the explosion + is created at. + - name: z + type: float + description: a float value that specifies the Z world coordinate where the explosion + is created at. + - name: theType + type: int + description: 'a integer specifying the explosion type, see: Explosion types' + - name: makeSound + type: bool + description: a boolean specifying whether the explosion should be heard or not. + default: 'true' + - name: camShake + type: float + description: a float specifying the camera shake's intensity. + default: '-1.0' + - name: damaging + type: bool + description: a boolean specifying whether the explosion should cause damage or + not. + default: 'true' + examples: + - path: examples/createExplosion-2.lua + description: Example 1:This code will create an explosion for the local player + when they spawn. + side: client + returns: + values: + - type: bool + name: value + description: true if the explosion was created. false if invalid parameters were + passed. + requires_review: true server: name: createExplosion description: Creates an explosion of a certain type at a specified point in the world. If creator is specified, the explosion will occur only in its dimension. - parameters: [] + parameters: + - name: x + type: float + description: a float value that specifies the X world coordinate where the explosion + is created at. + - name: "y" + type: float + description: a float value that specifies the Y world coordinate where the explosion + is created at. + - name: z + type: float + description: a float value that specifies the Z world coordinate where the explosion + is created at. + - name: theType + type: int + description: 'an integer specifying the explosion type, see: Explosion types' + - name: creator + type: player + description: the explosion's simulated creator, the player responsible for it. + default: nil examples: - path: examples/createExplosion-1.lua description: Example 1:This code will create an explosion at the player's position when they spawn. side: server - - path: examples/createExplosion-2.lua - description: Example 1:This code will create an explosion for the local player - when they spawn. - side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: true if the explosion was created. false if invalid parameters were + passed. + requires_review: true diff --git a/functions/GUI/getChatboxCharacterLimit.yaml b/functions/GUI/getChatboxCharacterLimit.yaml index f89a466b..afbc37e1 100644 --- a/functions/GUI/getChatboxCharacterLimit.yaml +++ b/functions/GUI/getChatboxCharacterLimit.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetChatboxCharacterLimit -client: +shared: name: getChatboxCharacterLimit description: Gets the current maximum amount of characters that can be input via chatbox @@ -9,5 +9,16 @@ client: description: This example shows how you can check your current chatbox character limit via command side: client + returns: + values: + - type: int + name: value + description: Returns a number between 0-255, representing the chatbox input character + limit + oop: + element: GuiElement + method: ) + variable: chatboxCharacterLimit + static: true pair: setChatboxCharacterLimit - incomplete: true + requires_review: true diff --git a/functions/GUI/getChatboxLayout.yaml b/functions/GUI/getChatboxLayout.yaml index 16678c2c..353911c5 100644 --- a/functions/GUI/getChatboxLayout.yaml +++ b/functions/GUI/getChatboxLayout.yaml @@ -1,8 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetChatboxLayout -client: +shared: name: getChatboxLayout description: Returns information about how the chatbox looks. - parameters: [] + parameters: + - name: CVar + type: string + description: 'the name of the property you want returned. Can be the following + values: chat_font - Returns the chatbox font chat_lines - Returns how many lines + the chatbox has chat_color - Returns the background color of the chatbox chat_text_color + - Returns the chatbox text color chat_input_color - Returns the background color + of the chatbox input chat_input_prefix_color - Returns the color of the input + prefix text chat_input_text_color - Returns the color of the text in the chatbox + input chat_scale - Returns the scale of the text in the chatbox chat_position_offset_x + - Returns the x position offset setting chat_position_offset_y - Returns the + y position offset setting chat_position_horizontal - Returns the horizontal + alignment setting chat_position_vertical - Returns the vertical alignment setting + chat_text_alignment - Returns the text alignment setting chat_width - Returns + the scale of the background width chat_css_style_text - Returns whether text + fades out over time chat_css_style_background - Returns whether the background + fades out over time chat_line_life - Returns how long it takes for text to start + fading out chat_line_fade_out - Returns how long takes for text to fade out + chat_use_cegui - Returns whether CEGUI is used to render the chatbox text_scale + - Returns text scale chat_text_outline - Returns whether text black/white outline + is used' examples: - path: examples/getChatboxLayout-1.lua description: This code makes the chatbox empty when you type /clear @@ -11,4 +31,9 @@ client: description: This code makes the chatbox empty when you type /clear, but with a cleaner code side: client - incomplete: true + returns: + values: + - type: bool|int|table + name: value + description: This code makes the chatbox empty when you type /clear + requires_review: true diff --git a/functions/GUI/guiBlur.yaml b/functions/GUI/guiBlur.yaml index 21aba995..18b4cba0 100644 --- a/functions/GUI/guiBlur.yaml +++ b/functions/GUI/guiBlur.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiBlur -client: +shared: name: guiBlur description: This function defocuses a focused GUI element. Used primarily for edit fields and memos. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element that you want to defocus examples: - path: examples/guiBlur-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: guielement + method: blur + static: false + requires_review: true diff --git a/functions/GUI/guiBringToFront.yaml b/functions/GUI/guiBringToFront.yaml index 2c3d2ab4..f058e63e 100644 --- a/functions/GUI/guiBringToFront.yaml +++ b/functions/GUI/guiBringToFront.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiBringToFront -client: +shared: name: guiBringToFront description: This function brings a GUI element on top of others. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element that you want to move to the front. examples: - path: examples/guiBringToFront-1.lua description: This example creates a gui window and brings it on top. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: guielement + method: bringToFront + static: false notes: - type: info content: If property "AlwaysOnTop" sets to "True", this function will return false . - incomplete: true + requires_review: true diff --git a/functions/GUI/guiCheckBoxGetSelected.yaml b/functions/GUI/guiCheckBoxGetSelected.yaml index 335e6879..259ce4cd 100644 --- a/functions/GUI/guiCheckBoxGetSelected.yaml +++ b/functions/GUI/guiCheckBoxGetSelected.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCheckBoxGetSelected -client: +shared: name: guiCheckBoxGetSelected description: This function gets a checkbox's selection state. - parameters: [] + parameters: + - name: theCheckbox + type: element + description: MISSING_PARAM_DESC examples: - path: examples/guiCheckBoxGetSelected-1.lua description: This example makes a different beep based on the state when any checkbox has been clicked. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the checkbox is selected, false if it is not. + oop: + element: guicheckbox + method: getSelected + variable: selected + static: false pair: guiCheckBoxSetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiCheckBoxSetSelected.yaml b/functions/GUI/guiCheckBoxSetSelected.yaml index ea17a6e0..73e5ee38 100644 --- a/functions/GUI/guiCheckBoxSetSelected.yaml +++ b/functions/GUI/guiCheckBoxSetSelected.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCheckBoxSetSelected -client: +shared: name: guiCheckBoxSetSelected description: This function selects (ticks) or unselects a checkbox. - parameters: [] + parameters: + - name: theCheckbox + type: element + description: The GUI element in which you wish to change the selection state of + - name: state + type: bool + description: The state of the checkbox, where true indicates selected, and false + indicates unselected. examples: - path: examples/guiCheckBoxSetSelected-1.lua description: This example creates 2 checkboxes and sets one of them selected then checks if the first one is selected and if it is then the second one would be set selected. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the checkbox's selection state was successfully set, + false otherwise. + oop: + element: guicheckbox + method: setSelected + variable: selected + static: false pair: guiCheckBoxGetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiComboBoxAddItem.yaml b/functions/GUI/guiComboBoxAddItem.yaml index 193dd2d4..7e2b5720 100644 --- a/functions/GUI/guiComboBoxAddItem.yaml +++ b/functions/GUI/guiComboBoxAddItem.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxAddItem -client: +shared: name: guiComboBoxAddItem description: Adds an item to a combobox. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox you want to add a row to + - name: value + type: string + description: The text that the item will contain. examples: - path: examples/guiComboBoxAddItem-1.lua description: This Example will add an item to comboBox when player use commandaddItemfollowed by the value of the item. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the item ID if it has been created, false otherwise. + oop: + element: guicombobox + method: addItem + static: false + requires_review: true diff --git a/functions/GUI/guiComboBoxClear.yaml b/functions/GUI/guiComboBoxClear.yaml index 9a4de85a..28014a33 100644 --- a/functions/GUI/guiComboBoxClear.yaml +++ b/functions/GUI/guiComboBoxClear.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxClear -client: +shared: name: guiComboBoxClear description: This function removes all the items from a combobox. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox element to be cleared examples: - path: examples/guiComboBoxClear-1.lua description: This example creates a combo box with all server vehicles on it, with a command to clear the combo box. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the combobox element is valid and has been cleared + successfully, false otherwise. + oop: + element: guicombobox + method: clear + static: false + requires_review: true diff --git a/functions/GUI/guiComboBoxGetItemCount.yaml b/functions/GUI/guiComboBoxGetItemCount.yaml index 6f9feb31..6d698d4c 100644 --- a/functions/GUI/guiComboBoxGetItemCount.yaml +++ b/functions/GUI/guiComboBoxGetItemCount.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxGetItemCount -client: +shared: name: guiComboBoxGetItemCount description: This function returns the number of items in a combo box. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combo box to get the number of items from. examples: - path: examples/guiComboBoxGetItemCount-1.lua description: This example creates a gui combo box, fills it with the names of the connected players and prints the number of items (players) in the chatbox. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the number of items if the function is successful, false + otherwise. + requires_review: true diff --git a/functions/GUI/guiComboBoxGetItemText.yaml b/functions/GUI/guiComboBoxGetItemText.yaml index f07d9bf8..662cca66 100644 --- a/functions/GUI/guiComboBoxGetItemText.yaml +++ b/functions/GUI/guiComboBoxGetItemText.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxGetItemText -client: +shared: name: guiComboBoxGetItemText description: This function retrieves the text from a specific combobox item. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox containing the item you're interested in + - name: itemId + type: int + description: The index of the item examples: - path: examples/guiComboBoxGetItemText-1.lua description: This outputs selected item's text to the chatbox. side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the text of the item if the arguments are right, false otherwise. + oop: + element: guicombobox + method: getItemText + static: false + requires_review: true diff --git a/functions/GUI/guiComboBoxGetSelected.yaml b/functions/GUI/guiComboBoxGetSelected.yaml index ae7e39a4..f304fc37 100644 --- a/functions/GUI/guiComboBoxGetSelected.yaml +++ b/functions/GUI/guiComboBoxGetSelected.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxGetSelected -client: +shared: name: guiComboBoxGetSelected description: This function returns the index of the selected combobox item. - parameters: [] + parameters: + - name: comboBox + type: element + description: the combobox you want to know the selected item index of examples: - path: examples/guiComboBoxGetSelected-1.lua description: This example outputs selected item's text and ID to the chat. side: client + returns: + values: + - type: int + name: value + description: Returns the index of the selected item if the specified combobox + is valid and has a selected item, -1 if no item is selected, nil otherwise. + oop: + element: guicombobox + method: getSelected + variable: selected + static: false pair: guiComboBoxSetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiComboBoxIsOpen.yaml b/functions/GUI/guiComboBoxIsOpen.yaml index 0a150cda..d3603635 100644 --- a/functions/GUI/guiComboBoxIsOpen.yaml +++ b/functions/GUI/guiComboBoxIsOpen.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxIsOpen -client: +shared: name: guiComboBoxIsOpen description: This function returns the state of combobox. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combo box to get the state. examples: - path: examples/guiComboBoxIsOpen-1.lua description: This example opens/closes the combobox after clicking the button. Checking if combobox is opened and change button text. side: client + returns: + values: + - type: bool + name: value + description: Returns true if combobox is opened, false if combobox is closed, + nil otherwise. + oop: + element: guicombobox + method: isOpen + variable: open + static: false pair: guiComboBoxSetOpen - incomplete: true + requires_review: true diff --git a/functions/GUI/guiComboBoxRemoveItem.yaml b/functions/GUI/guiComboBoxRemoveItem.yaml index c2790739..36781aa7 100644 --- a/functions/GUI/guiComboBoxRemoveItem.yaml +++ b/functions/GUI/guiComboBoxRemoveItem.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxRemoveItem -client: +shared: name: guiComboBoxRemoveItem description: This function removes an item from a combobox. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox containing the item you're interested in + - name: itemId + type: int + description: The index of the item to remove examples: - path: examples/guiComboBoxRemoveItem-1.lua description: This example removes selected item. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the item was removes successfully, false otherwise. + oop: + element: guicombobox + method: removeItem + static: false + requires_review: true diff --git a/functions/GUI/guiComboBoxSetItemText.yaml b/functions/GUI/guiComboBoxSetItemText.yaml index 15ad7a4c..7e996357 100644 --- a/functions/GUI/guiComboBoxSetItemText.yaml +++ b/functions/GUI/guiComboBoxSetItemText.yaml @@ -1,10 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxSetItemText -client: +shared: name: guiComboBoxSetItemText description: This function changes the text of a combobox item. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox containing the item you're interested in + - name: itemId + type: int + description: The index of the item + - name: text + type: string + description: The text you want to put in (does NOT accept numbers, use tostring() + for that) examples: - path: examples/guiComboBoxSetItemText-1.lua description: This changes the text of the selected item using commandsetText. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the text was set successfully, false otherwise. + oop: + element: guicombobox + method: setItemText + static: false + requires_review: true diff --git a/functions/GUI/guiComboBoxSetOpen.yaml b/functions/GUI/guiComboBoxSetOpen.yaml index 89da547a..1e0684cf 100644 --- a/functions/GUI/guiComboBoxSetOpen.yaml +++ b/functions/GUI/guiComboBoxSetOpen.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxSetOpen -client: +shared: name: guiComboBoxSetOpen description: This function set combo box state as open or close. - parameters: [] + parameters: + - name: comboBox + type: element + description: The combobox to be opened or closed. + - name: state + type: bool + description: The state of combobox. true, if the combobox is to be opened. false + if the combobox is to be closed. examples: - path: examples/guiComboBoxSetOpen-1.lua description: This example opens/closes the combobox after clicking the button. side: client + returns: + values: + - type: bool + name: value + description: Returns true if is successful, false otherwise. + oop: + element: guicombobox + method: setOpen + variable: open + static: false pair: guiComboBoxIsOpen - incomplete: true + requires_review: true diff --git a/functions/GUI/guiComboBoxSetSelected.yaml b/functions/GUI/guiComboBoxSetSelected.yaml index 21157fc2..0be62d66 100644 --- a/functions/GUI/guiComboBoxSetSelected.yaml +++ b/functions/GUI/guiComboBoxSetSelected.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiComboBoxSetSelected -client: +shared: name: guiComboBoxSetSelected description: This function sets the selected item from a combobox. - parameters: [] + parameters: + - name: comboBox + type: element + description: the combobox you want to select an item from + - name: itemIndex + type: int + description: the item you want to select (item 0 is the first item). If -1 is + specified, then the combo box text is set to it's caption . examples: - path: examples/guiComboBoxSetSelected-1.lua description: This example creates a GUI window with a checked and an unchecked combo box and adds a command to toggle their visibility side: client + returns: + values: + - type: bool + name: value + description: Returns true if the selected item has been changed successfully, + false otherwise. + oop: + element: guicombobox + method: setSelected + variable: selected + static: false pair: guiComboBoxGetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiCreateBrowser.yaml b/functions/GUI/guiCreateBrowser.yaml index b739ad42..ad3b2b8a 100644 --- a/functions/GUI/guiCreateBrowser.yaml +++ b/functions/GUI/guiCreateBrowser.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateBrowser -client: +shared: name: guiCreateBrowser description: "This function creates a new CEGUI web [browser](/wiki/Element/Browser\ \ \"Element/Browser\") element.\n \nThe difference between this and createBrowser\ @@ -7,7 +7,45 @@ client: \ windows. So the createBrowser function is more suitable for custom dx based\ \ interfaces, while this one is favorable for CEGUI all\\-in\\-all integration.\n\ You can learn more about the differences \\[[here](https://forum.mtasa.com/topic/80422-dx-browser-vs-gui-browser/?do=findComment&comment=737334)]." - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the browser on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the browser on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: The browser's native width. This should be greater than or equal + to 1. + - name: height + type: float + description: The browser's native height. This should be greater than or equal + to 1. + - name: isLocal + type: bool + description: Sets whether the browser can only show local content or content from + the internet (see examples over here for more information) + - name: isTransparent + type: bool + description: true if you want the browser to support transparency, false otherwise + - name: isRelative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes/positions + as a fraction of the screen size. If false , then the size and co-ordinates + are based on client's resolution, accessible using guiGetScreenSize . + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the radio button is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateBrowser-1.lua description: This examples simply creates a web browser and loads an URL @@ -15,4 +53,14 @@ client: - path: examples/guiCreateBrowser-2.lua description: This examples attaches a web browser to a CEGUI window. side: client - incomplete: true + returns: + values: + - type: gui-browser + name: value + description: Returns a gui-browser element if it was created successfully, false + otherwise. Returns also false , if the user disabled remote pages and isLocal + was set to false . + oop: + element: element + constructorclass: GuiBrowser + requires_review: true diff --git a/functions/GUI/guiCreateButton.yaml b/functions/GUI/guiCreateButton.yaml index f8dd8d8f..8075ede6 100644 --- a/functions/GUI/guiCreateButton.yaml +++ b/functions/GUI/guiCreateButton.yaml @@ -1,13 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateButton -client: +shared: name: guiCreateButton description: This function allows creation of a GUI Button, which is a clickable item as part of GUI. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI button on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI button on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI button. This is affected by the relative + argument. + - name: height + type: float + description: A float of the height of the GUI button. This is affected by the + relative argument. + - name: text + type: string + description: A string of the text that will be displayed as a label on the button. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x, y, width and height floats must be between 0 and 1, representing + sizes relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the gui button is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateButton-1.lua description: This example creates an edit box alongside an "Output!" button. When the button is clicked, it will output the message in the edit box into the Chat Box. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element of the created button if it was successfully created, + false otherwise. + oop: + element: element + constructorclass: GuiButton + requires_review: true diff --git a/functions/GUI/guiCreateCheckBox.yaml b/functions/GUI/guiCreateCheckBox.yaml index cedee3fd..eef3efc3 100644 --- a/functions/GUI/guiCreateCheckBox.yaml +++ b/functions/GUI/guiCreateCheckBox.yaml @@ -1,11 +1,57 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateCheckBox -client: +shared: name: guiCreateCheckBox description: This function creates a [checkbox](/wiki/Element/GUI/Checkbox "Element/GUI/Checkbox"). - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the checkbox on a player's screen. + This is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the checkbox on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the text field next to the checkbox. This + is affected by the relative argument. + - name: height + type: float + description: A float of the height of the text field next to the checkbox. This + is affected by the relative argument. + - name: text + type: string + description: The text to be displayed next to the checkbox. + - name: selected + type: bool + description: A boolean representing whether the checkbox created should be selected + by default. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the checkbox is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateCheckBox-1.lua description: This example creates a GUI window with a checked and an unchecked checkbox and adds a command to toggle their visibility side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns element of the checkbox if it was created succesfully, false + otherwise. + oop: + element: element + constructorclass: GuiCheckBox + requires_review: true diff --git a/functions/GUI/guiCreateComboBox.yaml b/functions/GUI/guiCreateComboBox.yaml index 6aa8022a..d065974c 100644 --- a/functions/GUI/guiCreateComboBox.yaml +++ b/functions/GUI/guiCreateComboBox.yaml @@ -1,17 +1,61 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateComboBox -client: +shared: name: guiCreateComboBox description: This function creates a combobox GUI element, which you can compare to a gridlist with a dropdown feature. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI combobox on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI combobox on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI combobox. This is affected by the + relative argument. + - name: height + type: float + description: 'A float of the height of the GUI combobox. This is affected by the + relative argument. Note: height must be enough to fit the drop down menu, else + the drop down won''t appear.' + - name: caption + type: string + description: A string for what the title of your combobox will be. This will be + shown if no item is selected. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the GUI combobox is attached to. If the + relative argument is true, sizes and positioning will be made relative to this + parent. If the relative argument is false, positioning will be the number of + offset pixels from the parent's origin. If no parent is passed, the parent will + become the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateComboBox-1.lua description: This example creates a combo box in the center of the screen with all server vehicles on it. side: client + returns: + values: + - type: element + name: value + description: Returns an element of the created combobox if it was successfully + created, false otherwise. + oop: + element: element + constructorclass: GuiComboBox notes: - type: info content: The height of a combobox must be enough to fit the drop down menu, else the drop down won't appear. See guiComboBoxAdjustHeight to give your combobox the correct height. - incomplete: true + requires_review: true diff --git a/functions/GUI/guiCreateEdit.yaml b/functions/GUI/guiCreateEdit.yaml index 1e0d2ff0..471811b5 100644 --- a/functions/GUI/guiCreateEdit.yaml +++ b/functions/GUI/guiCreateEdit.yaml @@ -1,11 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateEdit -client: +shared: name: guiCreateEdit description: This function is for creating a new GUI edit box. This is a text box in which the user can input text. Edit boxes only allow a single line of text. If you want to allow multiple lines of text create a memo box using [guiCreateMemo](/wiki/GuiCreateMemo "GuiCreateMemo"). - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI edit box on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI edit box on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI edit box. This is affected by the + relative argument. + - name: height + type: float + description: A float of the height of the GUI edit box. This is affected by the + relative argument. + - name: text + type: string + description: A string of the text that will be displayed by default in the edit + box. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the GUI edit box is attached to. If the + relative argument is true, sizes and positioning will be made relative to this + parent. If the relative argument is false, positioning will be the number of + offset pixels from the parent's origin. If no parent is passed, the parent will + become the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateEdit-1.lua description: This example creates an edit box alongside an "Output!" button. When @@ -16,4 +50,13 @@ client: description: 'This example creates an edit box and sets the input focus so the player does not have to click before typing:' side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a gui-edit element of the created edit box if it was successfully + created, false otherwise. + oop: + element: element + constructorclass: GuiEdit + requires_review: true diff --git a/functions/GUI/guiCreateFont.yaml b/functions/GUI/guiCreateFont.yaml index 12f7af24..690e7a26 100644 --- a/functions/GUI/guiCreateFont.yaml +++ b/functions/GUI/guiCreateFont.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateFont -client: +shared: name: guiCreateFont description: This function creates a [GUI font](/wiki/GUI_font "GUI font") element that can be used in [guiSetFont](/wiki/GuiSetFont "GuiSetFont"). Successful font creation is not guaranteed, and may fail due to hardware or memory limitations. - parameters: [] + parameters: + - name: filepath + type: string + description: the name of the file containing the font. + - name: size + type: int + description: size of the font. + default: '9' examples: - path: examples/guiCreateFont-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a GUI font element if successful, false if invalid arguments + were passed to the function, or there is insufficient resources available. + oop: + element: element + constructorclass: GuiFont + requires_review: true diff --git a/functions/GUI/guiCreateGridList.yaml b/functions/GUI/guiCreateGridList.yaml index 21b4d98b..3d40a2b7 100644 --- a/functions/GUI/guiCreateGridList.yaml +++ b/functions/GUI/guiCreateGridList.yaml @@ -1,10 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateGridList -client: +shared: name: guiCreateGridList description: This function creates a grid list GUI element. These are menu's which are designed in lists and can have multiple columns. A good example of a gridlist element can be found in MTA's settings box, under *Controls*. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI gridlist on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI gridlist on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI gridlist. This is affected by the + relative argument. + - name: height + type: float + description: A float of the height of the GUI gridlist. This is affected by the + relative argument. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the gui gridlist is attached to. If the + relative argument is true, sizes and positioning will be made relative to this + parent. If the relative argument is false, positioning will be the number of + offset pixels from the parent's origin. If no parent is passed, the parent will + become the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateGridList-1.lua description: Example 1:This example creates a player list on the right of the @@ -14,4 +44,13 @@ client: description: Example 2:UsingOOPwe can write shorter and cleaner code (Requires true in the meta file). This creates a player list with 2 columns. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element of the created gridlist if it was successfully + created, false otherwise. + oop: + element: element + constructorclass: GuiGridList + requires_review: true diff --git a/functions/GUI/guiCreateLabel.yaml b/functions/GUI/guiCreateLabel.yaml index 2898df4c..adf6e1ff 100644 --- a/functions/GUI/guiCreateLabel.yaml +++ b/functions/GUI/guiCreateLabel.yaml @@ -1,10 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateLabel -client: +shared: name: guiCreateLabel description: This function is for creating a new GUI label. A label is simply a piece of text that cannot be edited by the user. If you would like to have a bigger text you'd have to change its font because font size is not supported. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI label on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI label on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI label. This is affected by the relative + argument. + - name: height + type: float + description: A float of the height of the GUI label. This is affected by the relative + argument. + - name: text + type: string + description: A string of the text that will be displayed by the label. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the gui label is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateLabel-1.lua description: Example 1:This example creates a information window and adds two @@ -15,4 +48,13 @@ client: the label displays in the position of the element telling you what kind of element you have clicked. It hides after 5 seconds. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element of the created label if it was successfully created, + false otherwise. + oop: + element: element + constructorclass: GuiLabel + requires_review: true diff --git a/functions/GUI/guiCreateMemo.yaml b/functions/GUI/guiCreateMemo.yaml index 00e20c65..121964cf 100644 --- a/functions/GUI/guiCreateMemo.yaml +++ b/functions/GUI/guiCreateMemo.yaml @@ -1,14 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateMemo -client: +shared: name: guiCreateMemo description: This function creates a new GUI memo. This is a multiline edit box in which the user can input text. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI memo on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI memo on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI memo. This is affected by the relative + argument. + - name: height + type: float + description: A float of the height of the GUI memo. This is affected by the relative + argument. + - name: text + type: string + description: A string of the text that will be displayed by default in the memo. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the GUI memo is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateMemo-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: gui-memo + name: value + description: Returns a gui-memo element of the created memo if it was successfully + created, false otherwise. + oop: + element: guimemo?action=edit&redlink=1 + constructorclass: GuiMemo meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -16,3 +57,4 @@ client: - Missing section: Element Type ' + requires_review: true diff --git a/functions/GUI/guiCreateProgressBar.yaml b/functions/GUI/guiCreateProgressBar.yaml index 3ae3cdfa..defc8676 100644 --- a/functions/GUI/guiCreateProgressBar.yaml +++ b/functions/GUI/guiCreateProgressBar.yaml @@ -1,11 +1,47 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateProgressBar -client: +shared: name: guiCreateProgressBar description: This function creates a [progress bar](/wiki/Element/GUI/Progress_bar "Element/GUI/Progress bar"). - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the progress bar on a player's screen. + This is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the progress bar on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the progress bar. This is affected by the + relative argument. + - name: height + type: float + description: A float of the height of the progress bar. This is affected by the + relative argument. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the progress bar is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateProgressBar-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns element of the progress bar if it was created succesfully, + false otherwise. + requires_review: true diff --git a/functions/GUI/guiCreateRadioButton.yaml b/functions/GUI/guiCreateRadioButton.yaml index 9c87cc8a..ec2dff18 100644 --- a/functions/GUI/guiCreateRadioButton.yaml +++ b/functions/GUI/guiCreateRadioButton.yaml @@ -1,13 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateRadioButton -client: +shared: name: guiCreateRadioButton description: This function creates a [radio button](/wiki/Element/GUI/Radio_button "Element/GUI/Radio button"). - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the radio button on a player's screen. + This is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the radio button on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the text field next to the radio button. + This is affected by the relative argument. + - name: height + type: float + description: A float of the height of the text field next to the radio button. + This is affected by the relative argument. + - name: text + type: string + description: The text to be displayed next to the radio button. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the radio button is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateRadioButton-1.lua description: This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!) side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns element of the radio button if it was created succesfully, + false otherwise. + oop: + element: element + constructorclass: GuiRadioButton + requires_review: true diff --git a/functions/GUI/guiCreateScrollBar.yaml b/functions/GUI/guiCreateScrollBar.yaml index f5c7cd90..02604470 100644 --- a/functions/GUI/guiCreateScrollBar.yaml +++ b/functions/GUI/guiCreateScrollBar.yaml @@ -1,12 +1,48 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateScrollBar -client: +shared: name: guiCreateScrollBar description: This function creates a GUI scrollbar. You can use the functions [guiScrollBarSetScrollPosition](/wiki/GuiScrollBarSetScrollPosition "GuiScrollBarSetScrollPosition") and [guiScrollBarGetScrollPosition](/wiki/GuiScrollBarGetScrollPosition "GuiScrollBarGetScrollPosition") to read and modify the scrollbar's scroll. - parameters: [] + parameters: + - name: x + type: float + description: the 2D x offset of the GUI scrollbar from its parent. This is affected + by the relative argument. + - name: "y" + type: float + description: the 2D y offset of the GUI scrollbar from its parent. This is affected + by the relative argument. + - name: width + type: float + description: the width of the GUI scrollbar. This is affected by the relative + argument. + - name: height + type: float + description: the height of the GUI scrollbar. This is affected by the relative + argument. + - name: horizontal + type: bool + description: whether this scrollbar is horizontal ( true ) or vertical ( false + ). + - name: relative + type: bool + description: whether sizes and positions are relative to their parent's. If this + is true , then all measures must be between 0 and 1, representing sizes/positions + as a fraction of the parent widget's size. + default: 'false' + - name: parent + type: gui-element + description: the gui-element this scrollbar is attached to. By default, it is + nil, meaning the widget is attached to the background. + default: nil examples: - path: examples/guiCreateScrollBar-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: gui-scrollbar + name: value + description: Returns a gui-scrollbar if it was created successfully, false otherwise. + requires_review: true diff --git a/functions/GUI/guiCreateScrollPane.yaml b/functions/GUI/guiCreateScrollPane.yaml index e081b5f6..e9f3fd83 100644 --- a/functions/GUI/guiCreateScrollPane.yaml +++ b/functions/GUI/guiCreateScrollPane.yaml @@ -1,12 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateScrollPane -client: +shared: name: guiCreateScrollPane description: This creates a GUI scroll pane. - parameters: [] + parameters: + - name: x + type: float + description: the 2D x offset of the GUI scrollpane from its parent. This is affected + by the relative argument. + - name: "y" + type: float + description: the 2D y offset of the GUI scrollpane from its parent. This is affected + by the relative argument. + - name: width + type: float + description: the width of the GUI scrollpane. This is affected by the relative + argument. + - name: height + type: float + description: the height of the GUI scrollpane. This is affected by the relative + argument. + - name: relative + type: bool + description: whether sizes and positions are relative to their parent's. If this + is true, then all measures must be between 0 and 1, representing sizes/positions + as a fraction of the parent widget's size. + default: 'false' + - name: parent + type: gui-element + description: the gui-element this scrollpane is attached to. By default, it is + nil, meaning the widget is attached to the background. + default: nil examples: - path: examples/guiCreateScrollPane-1.lua description: This example creates a small window with a scrollpane on. Using the /fill command you can populate the scrollpane with the names of every player in the server. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: The gui-element if created, otherwise false. + requires_review: true diff --git a/functions/GUI/guiCreateStaticImage.yaml b/functions/GUI/guiCreateStaticImage.yaml index 01fe7a3f..d6d011b4 100644 --- a/functions/GUI/guiCreateStaticImage.yaml +++ b/functions/GUI/guiCreateStaticImage.yaml @@ -1,8 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateStaticImage -client: +shared: name: guiCreateStaticImage description: This function creates a static image using a .png image in the resource. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the image on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the image on a player's screen. This + is affected by the relative argument. + - name: width + type: float + description: A float of the width of the image. This is affected by the relative + argument. + - name: height + type: float + description: A float of the height of the image. This is affected by the relative + argument. + - name: path + type: string + description: The filepath of the image file that is being loaded. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing measures + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the image is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateStaticImage-1.lua description: '' @@ -11,4 +44,12 @@ client: description: In this exampleMeta.xmlis used to tell the server which files it will be using. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns element if image was created successfully, false otherwise. + oop: + element: element + constructorclass: GuiStaticImage + requires_review: true diff --git a/functions/GUI/guiCreateTab.yaml b/functions/GUI/guiCreateTab.yaml index 0b38db2e..dae34c27 100644 --- a/functions/GUI/guiCreateTab.yaml +++ b/functions/GUI/guiCreateTab.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateTab -client: +shared: name: guiCreateTab description: This function creates a tab on a pre\-existing tab panel. A tab is a button as well as a 'dimension' that can be used to switch between information by clicking on the tabs. Tabs are sorted on a tab panel in the order that they are created. - parameters: [] + parameters: + - name: text + type: string + description: The caption for the tab + - name: parent + type: gui-element + description: The parent tab panel, as a tab panel element type examples: - path: examples/guiCreateTab-1.lua description: This example creates a information window and adds two tabs to a "tabPanel" tabpanel, and adds some other gui elements to it. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a tab element if successful, false otherwise. + oop: + element: element + constructorclass: GuiTab + requires_review: true diff --git a/functions/GUI/guiCreateTabPanel.yaml b/functions/GUI/guiCreateTabPanel.yaml index 5ea7ba82..bb02b3cf 100644 --- a/functions/GUI/guiCreateTabPanel.yaml +++ b/functions/GUI/guiCreateTabPanel.yaml @@ -1,12 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateTabPanel -client: +shared: name: guiCreateTabPanel description: This function creates a Tab Panel, which acts as a template to create Tabs upon. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI tab panel on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI tab panel on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI tab panel. This is affected by the + relative argument. + - name: height + type: float + description: A float of the height of the GUI tab panel. This is affected by the + relative argument. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes + relative to the parent. + default: 'false' + - name: parent + type: gui-element + description: This is the parent that the tab panel is attached to. If the relative + argument is true, sizes and positioning will be made relative to this parent. + If the relative argument is false, positioning will be the number of offset + pixels from the parent's origin. If no parent is passed, the parent will become + the screen - causing positioning and sizing according to screen positioning. + default: nil examples: - path: examples/guiCreateTabPanel-1.lua description: This example creates a information window and adds two tabs to a "tabPanel" tabpanel, and adds some other gui elements to it. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a GUI tab panel element if successful, false otherwise. + oop: + element: element + constructorclass: GuiTabPanel + requires_review: true diff --git a/functions/GUI/guiCreateWindow.yaml b/functions/GUI/guiCreateWindow.yaml index cf8924a7..5f74f407 100644 --- a/functions/GUI/guiCreateWindow.yaml +++ b/functions/GUI/guiCreateWindow.yaml @@ -1,10 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiCreateWindow -client: +shared: name: guiCreateWindow description: This function is for creating a new GUI window. This provides a base for other gui elements to be created within. However, windows do not have a parent and cannot be created in any GUI elements. - parameters: [] + parameters: + - name: x + type: float + description: A float of the 2D x position of the GUI window on a player's screen. This + is affected by the relative argument. + - name: "y" + type: float + description: A float of the 2D y position of the GUI window on a player's screen. + This is affected by the relative argument. + - name: width + type: float + description: A float of the width of the GUI window. This is affected by the relative + argument. + - name: height + type: float + description: A float of the height of the GUI window. This is affected by the + relative argument. + - name: titleBarText + type: string + description: A string of the text that will be displayed in the title bar of the + window. + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes/positions + as a fraction of the screen size. If false , then the size and co-ordinates + are based on client's resolution, accessible using guiGetScreenSize . + default: 'false' examples: - path: examples/guiCreateWindow-1.lua description: Example 1:This example creates a information window and adds two @@ -15,4 +42,13 @@ client: with a window, gridlist and a button. Users can select a shotgun or a machine gun. The window is not movable or sizable. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns a gui window element if it was created successfully, false + otherwise. + oop: + element: element + constructorclass: GuiWindow + requires_review: true diff --git a/functions/GUI/guiDeleteTab.yaml b/functions/GUI/guiDeleteTab.yaml index b984a84d..0dba355a 100644 --- a/functions/GUI/guiDeleteTab.yaml +++ b/functions/GUI/guiDeleteTab.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiDeleteTab -client: +shared: name: guiDeleteTab description: This function deletes a tab from a tab panel. - parameters: [] + parameters: + - name: tabToDelete + type: element + description: This is an element representing the tab that you want to delete. + - name: tabPanel + type: element + description: This is the tab panel parent that the tab is attached to. examples: - path: examples/guiDeleteTab-1.lua description: This example removes a tab panel if a user LeftCtrl+Clicks a tab panel. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true the tab was successfully deleted, false otherwise. + oop: + element: guitab + method: delete + static: false + requires_review: true diff --git a/functions/GUI/guiEditGetCaretIndex.yaml b/functions/GUI/guiEditGetCaretIndex.yaml index 1451991e..211c43f0 100644 --- a/functions/GUI/guiEditGetCaretIndex.yaml +++ b/functions/GUI/guiEditGetCaretIndex.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditGetCaretIndex -client: +shared: name: guiEditGetCaretIndex description: This function returns the caret (the text cursor) position within the editbox. - parameters: [] + parameters: + - name: theElement + type: element + description: The edit box you want to get the caret position from examples: - path: examples/guiEditGetCaretIndex-1.lua description: This example outputs the caret position of the edit field to the chat side: client + returns: + values: + - type: int + name: value + description: Returns the caret index on success, false otherwise. + oop: + element: guiedit + method: getCaretIndex + variable: caretIndex + static: false pair: guiEditSetCaretIndex - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditGetMaxLength.yaml b/functions/GUI/guiEditGetMaxLength.yaml index ab34a758..c69afb53 100644 --- a/functions/GUI/guiEditGetMaxLength.yaml +++ b/functions/GUI/guiEditGetMaxLength.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditGetMaxLength -client: +shared: name: guiEditGetMaxLength description: This function returns the maximum text length that can be typed within an edit box. - parameters: [] + parameters: + - name: guiEdit + type: gui-edit + description: The edit box you want to get the maximum text length of. examples: - path: examples/guiEditGetMaxLength-1.lua description: This example outputs the maximum text length of an edit field to the chat. side: client + returns: + values: + - type: int + name: value + description: Returns the maximum text length on success, false otherwise. + oop: + element: guiedit + method: getMaxLength + variable: maxLength + static: false pair: guiEditSetMaxLength - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditIsMasked.yaml b/functions/GUI/guiEditIsMasked.yaml index abe6a6ac..76b30ca3 100644 --- a/functions/GUI/guiEditIsMasked.yaml +++ b/functions/GUI/guiEditIsMasked.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditIsMasked -client: +shared: name: guiEditIsMasked description: This function checks if an edit box is masked. - parameters: [] + parameters: + - name: guiEdit + type: gui-edit + description: the edit box to check masked flag of. examples: - path: examples/guiEditIsMasked-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the edit box is masked, false if not, nil if an invalid + edit box was provided. pair: guiEditSetMasked - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditIsReadOnly.yaml b/functions/GUI/guiEditIsReadOnly.yaml index 59ed003e..b5f41418 100644 --- a/functions/GUI/guiEditIsReadOnly.yaml +++ b/functions/GUI/guiEditIsReadOnly.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditIsReadOnly -client: +shared: name: guiEditIsReadOnly description: This function checks if an edit box is read\-only. - parameters: [] + parameters: + - name: guiEdit + type: gui-edit + description: The edit box to check read-only status of. examples: - path: examples/guiEditIsReadOnly-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the edit box is read-only, false if not, nil if an + invalid edit box was provided. pair: guiEditSetReadOnly - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditSetCaretIndex.yaml b/functions/GUI/guiEditSetCaretIndex.yaml index 4ef6dff5..8f19313b 100644 --- a/functions/GUI/guiEditSetCaretIndex.yaml +++ b/functions/GUI/guiEditSetCaretIndex.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditSetCaretIndex -client: +shared: name: guiEditSetCaretIndex description: This function sets the current position of the caret (the text cursor) within the edit box. - parameters: [] + parameters: + - name: theElement + type: element + description: The edit box to be changed. + - name: index + type: int + description: An integer referring to the desired position within the box. examples: - path: examples/guiEditSetCaretIndex-1.lua description: This example makes the text cursor jump to the end of an edit box if the user is holding the Left Control button. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the index was successfully set, false otherwise. + oop: + element: guiedit + method: setCaretIndex + variable: caretIndex + static: false pair: guiEditGetCaretIndex - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditSetMasked.yaml b/functions/GUI/guiEditSetMasked.yaml index 5b4d548e..dfd1ac73 100644 --- a/functions/GUI/guiEditSetMasked.yaml +++ b/functions/GUI/guiEditSetMasked.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditSetMasked -client: +shared: name: guiEditSetMasked description: This function sets or removes masking (covering up the text being typed) for password text fields. - parameters: [] + parameters: + - name: theElement + type: element + description: The edit box to be changed. + - name: status + type: bool + description: A boolean value indicating whether masking is to be enabled or disabled. examples: - path: examples/guiEditSetMasked-1.lua description: This example creates an edit box and an OK button. The user types in his password, and it checks if the password was correct side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function is successful, false otherwise. + oop: + element: guiedit + method: setMasked + variable: masked + static: false pair: guiEditIsMasked - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditSetMaxLength.yaml b/functions/GUI/guiEditSetMaxLength.yaml index b79110af..69b9ad1a 100644 --- a/functions/GUI/guiEditSetMaxLength.yaml +++ b/functions/GUI/guiEditSetMaxLength.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditSetMaxLength -client: +shared: name: guiEditSetMaxLength description: This function sets the maximum text length that can be typed into an edit box. - parameters: [] + parameters: + - name: guiEdit + type: element + description: MISSING_PARAM_DESC + - name: length + type: int + description: An integer indicating the maximum number of characters that can be + typed into the box. examples: - path: examples/guiEditSetMaxLength-1.lua description: This example creates an edit box with a limit on text length, alongside an "Output!" button. When the button is clicked, it will output the message in the edit box into the chatbox. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the max length was set successfully, false otherwise. + oop: + element: guiedit + method: setMaxLength + variable: maxLength + static: false pair: guiEditGetMaxLength - incomplete: true + requires_review: true diff --git a/functions/GUI/guiEditSetReadOnly.yaml b/functions/GUI/guiEditSetReadOnly.yaml index d5969ed8..9364ca1d 100644 --- a/functions/GUI/guiEditSetReadOnly.yaml +++ b/functions/GUI/guiEditSetReadOnly.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiEditSetReadOnly -client: +shared: name: guiEditSetReadOnly description: This function allows you to set or remove read\-only status for an edit box. If read\-only is set to *true*, the box is not editable. - parameters: [] + parameters: + - name: editField + type: element + description: The element of the edit field to be modified. + - name: status + type: bool + description: A boolean value indicating whether read-only is to be enabled or + disabled. examples: - path: examples/guiEditSetReadOnly-1.lua description: This example creates a little advert field on the bottom right corner of the screen and sets it to read only. side: client + returns: + values: + - type: bool + name: value + description: Returns true if edit field's read-only status was changed successfully, + false otherwise. + oop: + element: guiedit + method: setReadOnly + variable: readOnly + static: false pair: guiEditIsReadOnly - incomplete: true + requires_review: true diff --git a/functions/GUI/guiFocus.yaml b/functions/GUI/guiFocus.yaml index 6f122256..2aca93ac 100644 --- a/functions/GUI/guiFocus.yaml +++ b/functions/GUI/guiFocus.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiFocus -client: +shared: name: guiFocus description: This function focuses a defocused GUI element. Used primarily for edit fields and memos. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element that you want to focus examples: - path: examples/guiFocus-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: guielement + method: focus + static: false + requires_review: true diff --git a/functions/GUI/guiGetAlpha.yaml b/functions/GUI/guiGetAlpha.yaml index 32b6c9c3..e7768f2f 100644 --- a/functions/GUI/guiGetAlpha.yaml +++ b/functions/GUI/guiGetAlpha.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetAlpha -client: +shared: name: guiGetAlpha description: Alpha represents the transparency of a gui element. This function allows retrieval of a gui element's current alpha. - parameters: [] + parameters: + - name: guiElement + type: element + description: The gui element in which you want to retrieve the alpha of. examples: - path: examples/guiGetAlpha-1.lua description: This example provides aguiFadefunction, which allows you to fade in/out a GUI. side: client + returns: + values: + - type: float + name: value + description: This function returns a positive integer in between 0 and 1 of the + gui element's current alpha, or false if it could not be retrieved. + oop: + element: guielement + method: getAlpha + variable: alpha + static: false pair: guiSetAlpha - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetBrowser.yaml b/functions/GUI/guiGetBrowser.yaml index e1710bbe..a1a23071 100644 --- a/functions/GUI/guiGetBrowser.yaml +++ b/functions/GUI/guiGetBrowser.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetBrowser -client: +shared: name: guiGetBrowser description: This function gets the browser element behind a gui\-browser (a browser that has been created via [guiCreateBrowser](/wiki/GuiCreateBrowser "GuiCreateBrowser")). - parameters: [] + parameters: + - name: theBrowser + type: gui-browser + description: The gui-browser examples: - path: examples/guiGetBrowser-1.lua description: This examples get's browser element from gui-browser and attach a webbrowser to a CEGUI window. side: client - incomplete: true + returns: + values: + - type: browser + name: value + description: Returns the Browser element if a correct gui-browser has been passed, + false otherwise. + oop: + element: guibrowser + method: getBrowser + variable: browser + static: false + requires_review: true diff --git a/functions/GUI/guiGetCursorType.yaml b/functions/GUI/guiGetCursorType.yaml index 042588a8..0524ba8b 100644 --- a/functions/GUI/guiGetCursorType.yaml +++ b/functions/GUI/guiGetCursorType.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetCursorType -client: +shared: name: guiGetCursorType description: This function is used to get the type of the current cursor image. parameters: [] @@ -7,4 +7,14 @@ client: - path: examples/guiGetCursorType-1.lua description: This example prints the current cursor type in the console. side: client - incomplete: true + returns: + values: + - type: string + name: value + description: 'Returns a string containing the cursor type:' + oop: + element: GuiElement + method: ) + variable: cursorType + static: true + requires_review: true diff --git a/functions/GUI/guiGetEnabled.yaml b/functions/GUI/guiGetEnabled.yaml index e7fce68c..61032339 100644 --- a/functions/GUI/guiGetEnabled.yaml +++ b/functions/GUI/guiGetEnabled.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetEnabled -client: +shared: name: guiGetEnabled description: This function determines if a GUI element is enabled. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element to be checked. examples: - path: examples/guiGetEnabled-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the element is enabled, false otherwise. + oop: + element: guielement + method: getEnabled + variable: enabled + static: false pair: guiSetEnabled - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetFont.yaml b/functions/GUI/guiGetFont.yaml index e34e6469..319c1039 100644 --- a/functions/GUI/guiGetFont.yaml +++ b/functions/GUI/guiGetFont.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetFont -client: +shared: name: guiGetFont description: This function is used to get the current font that is used to draw text in GUI elements. - parameters: [] + parameters: + - name: guiElement + type: element + description: element you wish to get the font of. examples: - path: examples/guiGetFont-1.lua description: This example sets and gets the font of a pre-made gui element and outputs it to chat box. side: client + returns: + values: + - type: string + name: value1 + - type: element + name: value2 + description: This example sets and gets the font of a pre-made gui element and + outputs it to chat box. + oop: + element: guielement + method: getFont + variable: font + static: false pair: guiSetFont - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetInputEnabled.yaml b/functions/GUI/guiGetInputEnabled.yaml index b9c3a5d5..971fc32b 100644 --- a/functions/GUI/guiGetInputEnabled.yaml +++ b/functions/GUI/guiGetInputEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetInputEnabled -client: +shared: name: guiGetInputEnabled description: This function checks whether user input is focused on the GUI or the game. @@ -9,5 +9,16 @@ client: description: This example adds a command with which you can check whether the input is focused on GUI or game. side: client + returns: + values: + - type: bool + name: value + description: Returns true if input is focused on GUI, false if it's focused on + the game. + oop: + element: GuiElement + method: ) + variable: inputEnabled + static: true pair: guiSetInputEnabled - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetInputMode.yaml b/functions/GUI/guiGetInputMode.yaml index 58038ceb..c1e0345b 100644 --- a/functions/GUI/guiGetInputMode.yaml +++ b/functions/GUI/guiGetInputMode.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetInputMode -client: +shared: name: guiGetInputMode description: 'This function returns the current input mode as set by [guiSetInputMode](/wiki/GuiSetInputMode "GuiSetInputMode"). @@ -10,5 +10,16 @@ client: - path: examples/guiGetInputMode-1.lua description: '' side: client + returns: + values: + - type: string + name: value + description: 'Returns a string defining the current input mode, potential values + are:' + oop: + element: GuiElement + method: ) + variable: inputMode + static: true pair: guiSetInputMode - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetPosition.yaml b/functions/GUI/guiGetPosition.yaml index cf9242dd..ff447b6e 100644 --- a/functions/GUI/guiGetPosition.yaml +++ b/functions/GUI/guiGetPosition.yaml @@ -1,12 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetPosition -client: +shared: name: guiGetPosition description: This function allows retrieval of a GUI element's current position, relative to its parent. - parameters: [] + parameters: + - name: guiElement + type: element + description: The gui element of which you wish to retrieve the position. + - name: relative + type: bool + description: A boolean representing whether the position should be relative to + the element's parent width, or the number of offset pixels from the parent's + origin. examples: - path: examples/guiGetPosition-1.lua description: This example checks which corner a gui element exists in side: client + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns floats representing the x and y position of the element, + or false if the position could not be retrieved. + oop: + element: guielement + method: getPosition + variable: position + static: false pair: guiSetPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetProperties.yaml b/functions/GUI/guiGetProperties.yaml index 1b27eaba..45b646dd 100644 --- a/functions/GUI/guiGetProperties.yaml +++ b/functions/GUI/guiGetProperties.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetProperties -client: +shared: name: guiGetProperties description: This function gets a list of the CEGUI property names and values of a GUI element. To find out what the different properties mean, check out the [CEGUI properties page](http://static.cegui.org.uk/static/WindowsLookProperties.html). - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element you wish to get the properties of. examples: - path: examples/guiGetProperties-1.lua description: The following example code will create a button and lists its properties in the console if the /btn command is entered. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: If the function succeeds, the return value is a table. Its keys are + property names, the corresponding values are the values of the properties (both + names and values are always strings). If the function fails, it returns false + . + oop: + element: guielement + method: getProperties + variable: properties + static: false + requires_review: true diff --git a/functions/GUI/guiGetProperty.yaml b/functions/GUI/guiGetProperty.yaml index 75dbdc40..5e66e8d0 100644 --- a/functions/GUI/guiGetProperty.yaml +++ b/functions/GUI/guiGetProperty.yaml @@ -1,15 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetProperty -client: +shared: name: guiGetProperty description: This function gets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the [CEGUI properties page](http://static.cegui.org.uk/static/WindowsLookProperties.html). - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element you wish to get a property of. + - name: property + type: string + description: the name of of property you want the value of. examples: - path: examples/guiGetProperty-1.lua description: This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable). side: client + returns: + values: + - type: string + name: value + description: If the function succeeds, it returns a string with the value of the + property. If it fails, it returns false . + oop: + element: guielement + method: getProperty + static: false pair: guiSetProperty - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetScreenSize.yaml b/functions/GUI/guiGetScreenSize.yaml index 9346c2f7..9eaf24e3 100644 --- a/functions/GUI/guiGetScreenSize.yaml +++ b/functions/GUI/guiGetScreenSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize -client: +shared: name: guiGetScreenSize description: This function retrieves the local screen size according to the resolution they are using. @@ -9,4 +9,14 @@ client: description: This example checks whether a player is using a low resolution, and warns them that GUI may appear incorrect. side: client - incomplete: true + returns: + values: + - type: float float + name: value + description: This returns two floats representing the player's screen resolution, + width and height . + oop: + element: GuiElement + method: getScreenSize + static: true + requires_review: true diff --git a/functions/GUI/guiGetSelectedTab.yaml b/functions/GUI/guiGetSelectedTab.yaml index e7f9d5ac..d01c997f 100644 --- a/functions/GUI/guiGetSelectedTab.yaml +++ b/functions/GUI/guiGetSelectedTab.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetSelectedTab -client: +shared: name: guiGetSelectedTab description: This function returns the currently selected tab in the specified [tab panel](/wiki/Element/GUI/Tab_panel "Element/GUI/Tab panel"). - parameters: [] + parameters: + - name: tabPanel + type: element + description: The tab panel which current tab you want to retrieve. examples: - path: examples/guiGetSelectedTab-1.lua description: This example gets the current selected tab and sets the selected tab to the next available tab. side: client + returns: + values: + - type: element + name: value + description: Returns an element of the tab if a tab was selected or nil if no + tab was selected. If passed arguments were invalid or something went wrong, + the function will return false . + oop: + element: guitabpanel + method: getSelectedTab + variable: selectedTab + static: false pair: guiSetSelectedTab - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetSize.yaml b/functions/GUI/guiGetSize.yaml index 2f4b318a..21a3719d 100644 --- a/functions/GUI/guiGetSize.yaml +++ b/functions/GUI/guiGetSize.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetSize -client: +shared: name: guiGetSize description: This function gets the size of a GUI element. - parameters: [] + parameters: + - name: theElement + type: element + description: The GUI element to get size of. + - name: relative + type: bool + description: A boolean representing whether the size should be relative to the + element's parent width, or an absolute size in pixels. examples: - path: examples/guiGetSize-1.lua description: This example creates a random sized gui window and outputs its size to the chatbox. side: client + returns: + values: + - type: float float + name: value + description: Returns the GUI element size x and y if the function has been successful, + false otherwise. + oop: + element: guielement + method: getSize + static: false pair: guiSetSize - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetText.yaml b/functions/GUI/guiGetText.yaml index ac486d9d..b64acbd2 100644 --- a/functions/GUI/guiGetText.yaml +++ b/functions/GUI/guiGetText.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetText -client: +shared: name: guiGetText description: This function is used to get the text of GUI elements like edit boxes, labels, buttons etc. - parameters: [] + parameters: + - name: guiElement + type: element + description: element you wish to get text of. examples: - path: examples/guiGetText-1.lua description: This example gets the text of a pre-made gui element and outputs it to chat box. side: client + returns: + values: + - type: string + name: value + description: Returns a string containing the requested element's text, or false + if the gui element passed to the function is invalid. + oop: + element: guielement + method: getText + variable: text + static: false pair: guiSetText - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGetVisible.yaml b/functions/GUI/guiGetVisible.yaml index 6c950a5c..8c504177 100644 --- a/functions/GUI/guiGetVisible.yaml +++ b/functions/GUI/guiGetVisible.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGetVisible -client: +shared: name: guiGetVisible description: This function determines if a GUI element is visible. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element to be checked examples: - path: examples/guiGetVisible-1.lua description: This example toggles the visibility of myWindow. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the element is visible, false otherwise. + oop: + element: guielement + method: getVisible + variable: visible + static: false pair: guiSetVisible - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGridListAddColumn.yaml b/functions/GUI/guiGridListAddColumn.yaml index 8860530b..35293fa0 100644 --- a/functions/GUI/guiGridListAddColumn.yaml +++ b/functions/GUI/guiGridListAddColumn.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListAddColumn -client: +shared: name: guiGridListAddColumn description: This function is used to create columns in grid lists. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a column to + - name: title + type: string + description: Title of the column + - name: width + type: float + description: Column width, relative to the grid list width examples: - path: examples/guiGridListAddColumn-1.lua description: This example creates a player list on the right side of the screen and fills it with the currently connected players. side: client + returns: + values: + - type: int + name: value + description: Returns the column id if it was created, false otherwise. + oop: + element: guigridlist + method: addColumn + static: false notes: - type: info content: If the width of all columns exceeds 0.95 horizontal scrollbar will appear. - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGridListAddRow.yaml b/functions/GUI/guiGridListAddRow.yaml index 71420e32..9d50dc7b 100644 --- a/functions/GUI/guiGridListAddRow.yaml +++ b/functions/GUI/guiGridListAddRow.yaml @@ -1,13 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListAddRow -client: +shared: name: guiGridListAddRow description: Adds a row to a grid list, and optionally add simple text items with your rows. Use [guiGridListSetItemText](/wiki/GuiGridListSetItemText "GuiGridListSetItemText") to add row headers. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a row to + - name: itemText1 + type: int/string + description: The text for the first column item in the row. Either a string or + a number can be passed (use numbers for sorting purposes). + - name: itemText2 + type: int/string + description: The text for the second column item in the row. Either a string + or a number can be passed (use numbers for sorting purposes). + - name: '...' + type: unknown + description: Item text for any other columns examples: - path: examples/guiGridListAddRow-1.lua description: This example creates a player list on the right side of the screen and fills it with the names of the connected players. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the row id if it has been created, false otherwise. + oop: + element: guigridlist + method: addRow + static: false + requires_review: true diff --git a/functions/GUI/guiGridListAutoSizeColumn.yaml b/functions/GUI/guiGridListAutoSizeColumn.yaml index 1664209b..2d555184 100644 --- a/functions/GUI/guiGridListAutoSizeColumn.yaml +++ b/functions/GUI/guiGridListAutoSizeColumn.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListAutoSizeColumn -client: +shared: name: guiGridListAutoSizeColumn description: This allows you to automatically size a column to display everything in it correctly, with the most minimal width. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list element where the column is located. + - name: columnIndex + type: int + description: The ID of the column you want to be auto-sized. examples: - path: examples/guiGridListAutoSizeColumn-1.lua description: This example creates a random list of numbers of various lengths. This function is used to adjust the width to display them all. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the column was auto-sized, false otherwise. + oop: + element: guigridlist + method: autoSizeColumn + static: false + requires_review: true diff --git a/functions/GUI/guiGridListClear.yaml b/functions/GUI/guiGridListClear.yaml index 83df1e8e..0e4354bb 100644 --- a/functions/GUI/guiGridListClear.yaml +++ b/functions/GUI/guiGridListClear.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListClear -client: +shared: name: guiGridListClear description: This function clears all the data from a grid list. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list element to be cleared examples: - path: examples/guiGridListClear-1.lua description: 'This creates a player list and then clears it when a button is clicked:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the grid list element is valid and has been cleared + successfully, false otherwise. + oop: + element: guigridlist + method: clear + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetColumnCount.yaml b/functions/GUI/guiGridListGetColumnCount.yaml index a878b1e4..185b0701 100644 --- a/functions/GUI/guiGridListGetColumnCount.yaml +++ b/functions/GUI/guiGridListGetColumnCount.yaml @@ -1,7 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetColumnCount -client: +shared: name: guiGridListGetColumnCount description: This allows you to get the count of existing columns in a gridlist. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a column to examples: [] - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer with the amount of columns in the gridlist, false + otherwise. + oop: + element: guigridlist + method: getColumnCount + variable: columnCount + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetColumnTitle.yaml b/functions/GUI/guiGridListGetColumnTitle.yaml index 70248f3e..1bdfa531 100644 --- a/functions/GUI/guiGridListGetColumnTitle.yaml +++ b/functions/GUI/guiGridListGetColumnTitle.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetColumnTitle -client: +shared: name: guiGridListGetColumnTitle description: This function is used to get the column title of a gridlist column. - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to get the column title from + - name: columnIndex + type: int + description: Column ID examples: - path: examples/guiGridListGetColumnTitle-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the column title, or false otherwise. + oop: + element: guigridlist + method: getColumnTitle + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetColumnWidth.yaml b/functions/GUI/guiGridListGetColumnWidth.yaml index 6baa7c08..e953b253 100644 --- a/functions/GUI/guiGridListGetColumnWidth.yaml +++ b/functions/GUI/guiGridListGetColumnWidth.yaml @@ -1,10 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetColumnWidth -client: +shared: name: guiGridListGetColumnWidth description: This allows you to get the width of an existing column in a gridlist. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a column to + - name: columnIndex + type: int + description: Column ID of the Get size + - name: relative + type: bool + description: A boolean defining whether width measurements will be relative to + the Gridlist size, or absolute pixels. examples: - path: examples/guiGridListGetColumnWidth-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns the width of the gridlist column, false if bad arguments + were given. + oop: + element: guigridlist + method: getColumnWidth + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetHorizontalScrollPosition.yaml b/functions/GUI/guiGridListGetHorizontalScrollPosition.yaml index 610edd70..fbdc7140 100644 --- a/functions/GUI/guiGridListGetHorizontalScrollPosition.yaml +++ b/functions/GUI/guiGridListGetHorizontalScrollPosition.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetHorizontalScrollPosition -client: +shared: name: guiGridListGetHorizontalScrollPosition description: This function is used to get the horizontal scroll position from a grid list - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to get the horizontal scroll position from examples: - path: examples/guiGridListGetHorizontalScrollPosition-1.lua description: This example gets the position of the horizontal scroll and outputs it to the chatbox. side: client + returns: + values: + - type: float + name: value + description: Returns a integer between 0 and 100 indicating the horizontal scroll + position, or false otherwise. + oop: + element: guigridlist + method: getHorizontalScrollPosition + variable: horizontalScrollPosition + static: false pair: guiGridListSetHorizontalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGridListGetItemColor.yaml b/functions/GUI/guiGridListGetItemColor.yaml index 4385fac5..844e2b24 100644 --- a/functions/GUI/guiGridListGetItemColor.yaml +++ b/functions/GUI/guiGridListGetItemColor.yaml @@ -1,8 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetItemColor -client: +shared: name: guiGridListGetItemColor description: This function gets the color of a gridlist item. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list element + - name: rowIndex + type: int + description: Row ID + - name: columnIndex + type: int + description: Column ID examples: - path: examples/guiGridListGetItemColor-1.lua description: 'This example creates a player list on the right of the screen and @@ -11,4 +20,14 @@ client: When the player clicks on a grid list item, it''ll output the color of it.' side: client - incomplete: true + returns: + values: + - type: int int int int + name: value + description: Returns four int values, representing the amount of red, green, blue + and alpha if successful. false otherwise. + oop: + element: guigridlist + method: getItemColor + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetItemData.yaml b/functions/GUI/guiGridListGetItemData.yaml index 2c9d604f..60c2bdc0 100644 --- a/functions/GUI/guiGridListGetItemData.yaml +++ b/functions/GUI/guiGridListGetItemData.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetItemData -client: +shared: name: guiGridListGetItemData description: "With this function you can retrieve the [string](/wiki/String \"String\"\ ) data associated with an item in a [grid list](/wiki/Element/GUI/Gridlist \"\ @@ -8,9 +8,28 @@ client: \ \n\n**Note:** This function will only work **after** you set the item's text\ \ using [guiGridListSetItemText](/wiki/GuiGridListSetItemText \"GuiGridListSetItemText\"\ )!" - parameters: [] + parameters: + - name: gridList + type: element + description: the grid list containing the item you're interested in + - name: rowIndex + type: int + description: the row index of the item + - name: columnIndex + type: int + description: the column index of the item examples: - path: examples/guiGridListGetItemData-1.lua description: This example displays a random item data from the gridlist. side: client - incomplete: true + returns: + values: + - type: var + name: value + description: Returns the item data of the specified item if succesful, false if + one of the arguments was invalid. + oop: + element: guigridlist + method: getItemData + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetItemText.yaml b/functions/GUI/guiGridListGetItemText.yaml index 1a22ef99..45bbb270 100644 --- a/functions/GUI/guiGridListGetItemText.yaml +++ b/functions/GUI/guiGridListGetItemText.yaml @@ -1,8 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetItemText -client: +shared: name: guiGridListGetItemText description: This function retrieves the text from a specific grid list item. - parameters: [] + parameters: + - name: gridList + type: element + description: the gridlist containing the item you're interested in + - name: rowIndex + type: int + description: row id of the item (first is 0) + - name: columnIndex + type: int + description: column id of the item (first is 0) examples: - path: examples/guiGridListGetItemText-1.lua description: 'Example 1: This example creates a gridlist with entries "Hello" @@ -13,4 +22,13 @@ client: description: 'Example 2: This example creates a player list on resource start, clicking on it will output the selected player name to the chatbox.' side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the text of the item if the arguments are right, false otherwise. + oop: + element: guigridlist + method: getItemText + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetRowCount.yaml b/functions/GUI/guiGridListGetRowCount.yaml index 3d6f33d0..823c142b 100644 --- a/functions/GUI/guiGridListGetRowCount.yaml +++ b/functions/GUI/guiGridListGetRowCount.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetRowCount -client: +shared: name: guiGridListGetRowCount description: This function returns the number of rows in a grid list. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list to get the number of rows from. examples: - path: examples/guiGridListGetRowCount-1.lua description: This example creates a gui grid list, fills it with the names of the connected players and prints the number of rows (players) in the chatbox. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the number of rows if the function is successful, false otherwise. + oop: + element: guigridlist + method: getRowCount + variable: rowCount + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetSelectedCount.yaml b/functions/GUI/guiGridListGetSelectedCount.yaml index 95fc274c..b2f319c2 100644 --- a/functions/GUI/guiGridListGetSelectedCount.yaml +++ b/functions/GUI/guiGridListGetSelectedCount.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetSelectedCount -client: +shared: name: guiGridListGetSelectedCount description: This function returns the amount of options selected in the specified [grid list](/wiki/Element/GUI/Gridlist "Element/GUI/Gridlist"). - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list which amount of selected items you want to retrieve. examples: - path: examples/guiGridListGetSelectedCount-1.lua description: This example creates a gridlist filled with players names then check who has the letter "a" in their name, after it selects everyone who has the letter "a" then it outputs the selected rows. TESTED! side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer representing the amount of selected options if + everything was successful or false if invalid arguments were passed. + oop: + element: guigridlist + method: getSelectedCount + variable: selectedCount + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetSelectedItem.yaml b/functions/GUI/guiGridListGetSelectedItem.yaml index 7259e382..ea91a79e 100644 --- a/functions/GUI/guiGridListGetSelectedItem.yaml +++ b/functions/GUI/guiGridListGetSelectedItem.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetSelectedItem -client: +shared: name: guiGridListGetSelectedItem description: This function returns the row and column indexes of the selected item in a grid list. First selected row and column is (0, 0\). - parameters: [] + parameters: + - name: gridList + type: element + description: the grid list you want to know the selected row index of examples: - path: examples/guiGridListGetSelectedItem-1.lua description: This code creates a grid list and fills it with the names of the connected players. When the user selects an item, its text (the player name) will be output in the chat box. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns the row and column indexes of the selected item if the specified + grid list is valid and has a selected item, (-1, -1) if no item is selected, + false otherwise. + oop: + element: guigridlist + method: getSelectedItem + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetSelectedItems.yaml b/functions/GUI/guiGridListGetSelectedItems.yaml index d48eb024..9afc36f7 100644 --- a/functions/GUI/guiGridListGetSelectedItems.yaml +++ b/functions/GUI/guiGridListGetSelectedItems.yaml @@ -1,8 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetSelectedItems -client: +shared: name: guiGridListGetSelectedItems description: This function returns the items selected in the specified [grid list](/wiki/Element/GUI/Gridlist "Element/GUI/Gridlist"). - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list which selected items you want to retrieve. examples: [] - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table over the selected items in the grid list in this + format:' + oop: + element: guigridlist + method: getSelectedItems + variable: selectedItems + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetSelectionMode.yaml b/functions/GUI/guiGridListGetSelectionMode.yaml index 738b61f9..d2ef1bc8 100644 --- a/functions/GUI/guiGridListGetSelectionMode.yaml +++ b/functions/GUI/guiGridListGetSelectionMode.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetSelectionMode -client: +shared: name: guiGridListGetSelectionMode description: This function retrieves the current selection mode of a gui gridlist. - parameters: [] + parameters: + - name: gridlist + type: gui-Element + description: The gridlist you want to get the selection mode of. examples: - path: examples/guiGridListGetSelectionMode-1.lua description: This example creates a grid list and adds the command 'getmode' which will show the gridlist selection mode. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the ID of the current gridlist's selection mode. + oop: + element: guigridlist + method: getSelectionMode + variable: selectionMode + static: false + requires_review: true diff --git a/functions/GUI/guiGridListGetVerticalScrollPosition.yaml b/functions/GUI/guiGridListGetVerticalScrollPosition.yaml index 47bef1cb..ae18bf4a 100644 --- a/functions/GUI/guiGridListGetVerticalScrollPosition.yaml +++ b/functions/GUI/guiGridListGetVerticalScrollPosition.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListGetVerticalScrollPosition -client: +shared: name: guiGridListGetVerticalScrollPosition description: This function is used to get the vertical scroll position from a grid list - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to get the vertical scroll position from examples: - path: examples/guiGridListGetVerticalScrollPosition-1.lua description: This example gets the position of the vertical scroll and outputs it to the chatbox. side: client + returns: + values: + - type: float + name: value + description: Returns a integer between 0 and 100 indicating the vertical scroll + position, or false otherwise. + oop: + element: guigridlist + method: getVerticalScrollPosition + variable: verticalScrollPosition + static: false pair: guiGridListSetVerticalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGridListInsertRowAfter.yaml b/functions/GUI/guiGridListInsertRowAfter.yaml index 5ee5efce..d5e1d536 100644 --- a/functions/GUI/guiGridListInsertRowAfter.yaml +++ b/functions/GUI/guiGridListInsertRowAfter.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListInsertRowAfter -client: +shared: name: guiGridListInsertRowAfter description: This allows you to insert a new row after a specified row, and simultaneously set text. Good for inserting new rows in the middle of existing rows. To insert at the top use \-1 as row index. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a row to + - name: rowIndex + type: int + description: Row ID of the row you want to insert the new row after. examples: - path: examples/guiGridListInsertRowAfter-1.lua description: This example would create a gridlist then add the current players in the server and if anyone joins, it would insert a row at the bottom. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns row id if the row was successfully added, false otherwise. + oop: + element: guigridlist + method: insertRowAfter + static: false + requires_review: true diff --git a/functions/GUI/guiGridListIsSortingEnabled.yaml b/functions/GUI/guiGridListIsSortingEnabled.yaml index 38e90551..00d946b6 100644 --- a/functions/GUI/guiGridListIsSortingEnabled.yaml +++ b/functions/GUI/guiGridListIsSortingEnabled.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListIsSortingEnabled -client: +shared: name: guiGridListIsSortingEnabled description: This function checks whether the gridlist sorting is enabled or disabled. - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The GUI gridlist you wish to check if sorting is enabled or not. examples: - path: examples/guiGridListIsSortingEnabled-1.lua description: Example 1:This example creates a gridlist with all server players and adds a command that enables and disables the gridlist sorting. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sorting is enabled, false otherwise. + oop: + element: guigridlist + method: isSortingEnabled + variable: sortingEnabled + static: false + requires_review: true diff --git a/functions/GUI/guiGridListRemoveColumn.yaml b/functions/GUI/guiGridListRemoveColumn.yaml index a1b7d845..88be0020 100644 --- a/functions/GUI/guiGridListRemoveColumn.yaml +++ b/functions/GUI/guiGridListRemoveColumn.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListRemoveColumn -client: +shared: name: guiGridListRemoveColumn description: This allows you to delete columns that exist in grid lists. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to remove a column from + - name: columnIndex + type: int + description: Column ID examples: - path: examples/guiGridListRemoveColumn-1.lua description: This example creates a grid list and adds 4 columns to it when the script starts. After 3 seconds, it randomly deletes a column and outputs to the chat box which column was deleted. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the grid list column was successfully removed, false + otherwise. + oop: + element: guigridlist + method: removeColumn + static: false + requires_review: true diff --git a/functions/GUI/guiGridListRemoveRow.yaml b/functions/GUI/guiGridListRemoveRow.yaml index 77988b4e..a0e5a02b 100644 --- a/functions/GUI/guiGridListRemoveRow.yaml +++ b/functions/GUI/guiGridListRemoveRow.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListRemoveRow -client: +shared: name: guiGridListRemoveRow description: This allows you to delete rows that exist in grid lists. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to remove a row from + - name: rowIndex + type: int + description: The row ID which you want to remove examples: - path: examples/guiGridListRemoveRow-1.lua description: In this example, when the script starts, a grid list with 1 column and 2 rows, which have text assigned to them. After 3 seconds, one row is randomly deleted. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the grid list row was successfully removed, false + otherwise. + oop: + element: guigridlist + method: removeRow + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetColumnTitle.yaml b/functions/GUI/guiGridListSetColumnTitle.yaml index 299723a7..422327bb 100644 --- a/functions/GUI/guiGridListSetColumnTitle.yaml +++ b/functions/GUI/guiGridListSetColumnTitle.yaml @@ -1,10 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetColumnTitle -client: +shared: name: guiGridListSetColumnTitle description: This function is used to change the column title of a gridlist column. - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to change the column title from + - name: columnIndex + type: int + description: Column ID + - name: title + type: string + description: The title of the column examples: - path: examples/guiGridListSetColumnTitle-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the new title was set, or false otherwise. + oop: + element: guigridlist + method: setColumnTitle + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetColumnWidth.yaml b/functions/GUI/guiGridListSetColumnWidth.yaml index 9ae04e3f..9ae5e5ee 100644 --- a/functions/GUI/guiGridListSetColumnWidth.yaml +++ b/functions/GUI/guiGridListSetColumnWidth.yaml @@ -1,12 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetColumnWidth -client: +shared: name: guiGridListSetColumnWidth description: This allows you to set the width of an existing column in a gridlist. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list you want to add a column to + - name: columnIndex + type: int + description: Column ID of the size you want to change + - name: width + type: number + description: A float or integer of the width of the column depending on the relative + argument. + - name: relative + type: bool + description: A boolean defining whether width measurements will be relative to + the Gridlist size, or absolute pixels. examples: - path: examples/guiGridListSetColumnWidth-1.lua description: This example creates a gridlist with one column that is too small to display. After the column has been successfully created, we give it a new width so you can see column. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the gridlist column width was successfully set, false + if bad arguments were given. + oop: + element: guigridlist + method: setColumnWidth + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetHorizontalScrollPosition.yaml b/functions/GUI/guiGridListSetHorizontalScrollPosition.yaml index 470a0f5b..1e2d51a3 100644 --- a/functions/GUI/guiGridListSetHorizontalScrollPosition.yaml +++ b/functions/GUI/guiGridListSetHorizontalScrollPosition.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetHorizontalScrollPosition -client: +shared: name: guiGridListSetHorizontalScrollPosition description: This function is used to set the horizontal scroll position from a grid list - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to set the horizontal scroll position from + - name: fPosition + type: float + description: A float representing the horizontal scroll position (0-100) examples: - path: examples/guiGridListSetHorizontalScrollPosition-1.lua description: This example sets the position of the horizontal scroll and outputs it to the chatbox. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the horizontal scroll position was set, or false + otherwise. + oop: + element: guigridlist + method: setHorizontalScrollPosition + variable: horizontalScrollPosition + static: false pair: guiGridListGetHorizontalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiGridListSetItemColor.yaml b/functions/GUI/guiGridListSetItemColor.yaml index ba646ced..892444e9 100644 --- a/functions/GUI/guiGridListSetItemColor.yaml +++ b/functions/GUI/guiGridListSetItemColor.yaml @@ -1,12 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetItemColor -client: +shared: name: guiGridListSetItemColor description: This function changes the color of a gridlist item. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list element + - name: rowIndex + type: int + description: Row ID + - name: columnIndex + type: int + description: Column ID + - name: red + type: int + description: The amount of red in the color (0-255) + - name: green + type: int + description: The amount of green in the color (0-255) + - name: blue + type: int + description: The amount of blue in the color (0-255) + - name: alpha + type: int + description: The amount of alpha in the color (0-255). + default: '255' examples: - path: examples/guiGridListSetItemColor-1.lua description: This example creates a player list on the right of the screen and fills it with players online and sets the grid list item color according to their nametag color. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the item color was set successfully, false otherwise. + oop: + element: guigridlist + method: setItemColor + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetItemData.yaml b/functions/GUI/guiGridListSetItemData.yaml index 964b523a..8d8265a8 100644 --- a/functions/GUI/guiGridListSetItemData.yaml +++ b/functions/GUI/guiGridListSetItemData.yaml @@ -1,15 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetItemData -client: +shared: name: guiGridListSetItemData description: "This function sets a Item Data associated to a grid list item. \n\ \n**Note:** This function will only work **after** you set the item's text using\ \ [guiGridListSetItemText](/wiki/GuiGridListSetItemText \"GuiGridListSetItemText\"\ )!" - parameters: [] + parameters: + - name: gridList + type: element + description: A gridlist element of the data you wish to set to + - name: rowIndex + type: int + description: The row of the item you wish to set to + - name: columnIndex + type: int + description: The column of the item you wish to set to + - name: data + type: var + description: The data you wish to set to the item. examples: - path: examples/guiGridListSetItemData-1.lua description: In this example, the gridlist shows the list of players without their color codes and outputs their names with color-codes at the chatbox when player is selected. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the data was set successfully, false otherwise + oop: + element: guigridlist + method: setItemData + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetItemText.yaml b/functions/GUI/guiGridListSetItemText.yaml index f8cdbf00..9b8e81f8 100644 --- a/functions/GUI/guiGridListSetItemText.yaml +++ b/functions/GUI/guiGridListSetItemText.yaml @@ -1,11 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetItemText -client: +shared: name: guiGridListSetItemText description: This function changes the text of a gridlist item. - parameters: [] + parameters: + - name: gridList + type: element + description: The grid list element + - name: rowIndex + type: int + description: Row ID + - name: columnIndex + type: int + description: Column ID + - name: text + type: string + description: The text you want to put in (does NOT accept numbers, use tostring() + for that) + - name: section + type: bool + description: Determines if the item is a section + - name: number + type: bool + description: Tells whether the text item is a number value or not (used for sorting) examples: - path: examples/guiGridListSetItemText-1.lua description: This example creates a player list on the right of the screen and fills it side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the item text was set successfully, false otherwise. + oop: + element: guigridlist + method: setItemText + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetScrollBars.yaml b/functions/GUI/guiGridListSetScrollBars.yaml index 7e01daad..486c194c 100644 --- a/functions/GUI/guiGridListSetScrollBars.yaml +++ b/functions/GUI/guiGridListSetScrollBars.yaml @@ -1,12 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetScrollBars -client: +shared: name: guiGridListSetScrollBars description: This function allows a gridlist's scrollbar to be forced **on**, or returned to default. - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The GUI gridlist you wish to change the state of scrollbars + - name: horizontalBar + type: bool + description: A bool where true forces the horizontal scrollbar on, and false returns + them to default. + - name: verticalBar + type: bool + description: A bool where true forces the verical scrollbar on, and false returns + them to default. examples: - path: examples/guiGridListSetScrollBars-1.lua description: This example creates a gridlist and checks if it's created then sets the scroll bars. (TESTED!) side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the scrollbars were successfully set, false otherwise. + oop: + element: guigridlist + method: setScrollBars + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetSelectedItem.yaml b/functions/GUI/guiGridListSetSelectedItem.yaml index 32b9c659..17e11b01 100644 --- a/functions/GUI/guiGridListSetSelectedItem.yaml +++ b/functions/GUI/guiGridListSetSelectedItem.yaml @@ -1,11 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetSelectedItem -client: +shared: name: guiGridListSetSelectedItem description: This function selects an item from a gridlist. If you wish to deselect whatever item is selected, pass *0* as both the *rowIndex* and *columnIndex* arguments. - parameters: [] + parameters: + - name: gridList + type: element + description: the grid list you want to select an item from + - name: rowIndex + type: int + description: the row you want to select (index 0 is the first row) + - name: columnIndex + type: int + description: the column you want to select (index 1 is the first column) + - name: bReset + type: bool + description: MISSING_PARAM_DESC + default: 'true' examples: - path: examples/guiGridListSetSelectedItem-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the passed arguments are correct and the item has + been selected, false otherwise. + oop: + element: guigridlist + method: setSelectedItem + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetSelectionMode.yaml b/functions/GUI/guiGridListSetSelectionMode.yaml index dc563727..e0ca6c5e 100644 --- a/functions/GUI/guiGridListSetSelectionMode.yaml +++ b/functions/GUI/guiGridListSetSelectionMode.yaml @@ -1,10 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetSelectionMode -client: +shared: name: guiGridListSetSelectionMode description: This function sets the selection mode of a gui gridlist. For example, the MTA *server browser* selects a whole row, while the *Controls* dialog selects a single cell. To select multiple items you must be holding down 'ctrl'. - parameters: [] + parameters: + - name: gridlist + type: gui-Element + description: The gridlist in which you wish to set the selection mode. + - name: mode + type: int + description: 'The mode of the selection. Can be the following values: 0: Single + row selection 1: Multiple row selection 2: Single cell selection 3: Multiple + cell selection 4: Nominated(First) single column selection 5: Nominated(First) + multiple column selection 6: Single column selection 7: Multiple column selection + 8: Nominated(First) single row selection 9: Nominated(First) multiple row selection' examples: - path: examples/guiGridListSetSelectionMode-1.lua description: 'This example creates a grid list with 3 columns and 3 rows, each @@ -12,4 +22,14 @@ client: on. The player can use the command ''setmode #'' to change how the grid list can be selected.' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the selection mode was successfully set, false otherwise. + oop: + element: guigridlist + method: setSelectionMode + variable: selectionMode + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetSortingEnabled.yaml b/functions/GUI/guiGridListSetSortingEnabled.yaml index 3de21785..59321718 100644 --- a/functions/GUI/guiGridListSetSortingEnabled.yaml +++ b/functions/GUI/guiGridListSetSortingEnabled.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetSortingEnabled -client: +shared: name: guiGridListSetSortingEnabled description: This function allows the disabling or enabling of *sorting* within a gridlist. Sorting is achieved by clicking a column header. Gridlist items will be sorted according to the clicked column. By default, gridlists have sorting enabled. This function will allow you to toggle this. - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The GUI gridlist you wish to toggle the sorting of. + - name: enabled + type: bool + description: A boolean representing whether the sorting is enabled, or disabled. examples: - path: examples/guiGridListSetSortingEnabled-1.lua description: Example 1:This example creates a gridlist, fills it with players connected to the server and disables the sorting for that gridlist side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sorting was successfully toggled., false otherwise. + oop: + element: guigridlist + method: setSortingEnabled + variable: sortingEnabled + static: false + requires_review: true diff --git a/functions/GUI/guiGridListSetVerticalScrollPosition.yaml b/functions/GUI/guiGridListSetVerticalScrollPosition.yaml index 8886d68c..8a047d12 100644 --- a/functions/GUI/guiGridListSetVerticalScrollPosition.yaml +++ b/functions/GUI/guiGridListSetVerticalScrollPosition.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiGridListSetVerticalScrollPosition -client: +shared: name: guiGridListSetVerticalScrollPosition description: This function is used to set the vertical scroll position from a grid list - parameters: [] + parameters: + - name: guiGridlist + type: element + description: The grid list you want to set the vertical scroll position from + - name: fPosition + type: float + description: A float representing the vertical scroll position (0-100) examples: - path: examples/guiGridListSetVerticalScrollPosition-1.lua description: This example sets the position of the vertical scroll and outputs it to the chatbox. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the vertical scroll position was set, or false otherwise. + oop: + element: guigridlist + method: setVerticalScrollPosition + variable: verticalScrollPosition + static: false pair: guiGridListGetVerticalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiLabelGetColor.yaml b/functions/GUI/guiLabelGetColor.yaml index 4d2c4aed..d8c34999 100644 --- a/functions/GUI/guiLabelGetColor.yaml +++ b/functions/GUI/guiLabelGetColor.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelGetColor -client: +shared: name: guiLabelGetColor description: This function gets the color of a label. - parameters: [] + parameters: + - name: theLabel + type: gui-element + description: The label to get color. examples: - path: examples/guiLabelGetColor-1.lua description: '' side: client + returns: + values: + - type: int int int + name: value + description: Returns three int values, representing the amount of red, green, + blue if successful. false otherwise. + oop: + element: guilabel + method: getColor + static: false pair: guiLabelSetColor - incomplete: true + requires_review: true diff --git a/functions/GUI/guiLabelGetFontHeight.yaml b/functions/GUI/guiLabelGetFontHeight.yaml index 8d6a543d..5121a409 100644 --- a/functions/GUI/guiLabelGetFontHeight.yaml +++ b/functions/GUI/guiLabelGetFontHeight.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelGetFontHeight -client: +shared: name: guiLabelGetFontHeight description: This function returns the height of the font currently used in a GUI text label. - parameters: [] + parameters: + - name: theLabel + type: element + description: The text label to get the font height from. examples: - path: examples/guiLabelGetFontHeight-1.lua description: This example creates a window, a text label, gets the text extent and font height, and sets the text label size according to these values. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns the absolute height of the font currently used in the text + label if the function is successful, false otherwise. + oop: + element: guilabel + method: getFontHeight + variable: fontHeight + static: false + requires_review: true diff --git a/functions/GUI/guiLabelGetTextExtent.yaml b/functions/GUI/guiLabelGetTextExtent.yaml index baeb8ba8..c06a3de0 100644 --- a/functions/GUI/guiLabelGetTextExtent.yaml +++ b/functions/GUI/guiLabelGetTextExtent.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelGetTextExtent -client: +shared: name: guiLabelGetTextExtent description: This function returns the extent, or width, of the current text inside a GUI text label. - parameters: [] + parameters: + - name: theLabel + type: element + description: The text label to get the text extent from. examples: - path: examples/guiLabelGetTextExtent-1.lua description: This example creates a window, a text label, gets the text extent and font height, and sets the text label size according to these values. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns the absolute width of the current text inside the text label + if the function is successful, false otherwise. + oop: + element: guilabel + method: getTextExtent + variable: textExtent + static: false + requires_review: true diff --git a/functions/GUI/guiLabelSetColor.yaml b/functions/GUI/guiLabelSetColor.yaml index 4576d872..90a821d4 100644 --- a/functions/GUI/guiLabelSetColor.yaml +++ b/functions/GUI/guiLabelSetColor.yaml @@ -1,12 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelSetColor -client: +shared: name: guiLabelSetColor description: This function allows you to set the color of a GUI label. - parameters: [] + parameters: + - name: theElement + type: element + description: The label to be changed. + - name: red + type: int + description: An integer specifying the amount of red (0 to 255). + - name: green + type: int + description: An integer specifying the amount of green (0 to 255). + - name: blue + type: int + description: An integer specifying the amount of blue (0 to 255). examples: - path: examples/guiLabelSetColor-1.lua description: This example creates a label with text "Hello World!" and sets it to a random color. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the the color of the gui label was successfully changed, + false otherwise. + oop: + element: guilabel + method: setColor + static: false pair: guiLabelGetColor - incomplete: true + requires_review: true diff --git a/functions/GUI/guiLabelSetHorizontalAlign.yaml b/functions/GUI/guiLabelSetHorizontalAlign.yaml index 0c82c225..ba588915 100644 --- a/functions/GUI/guiLabelSetHorizontalAlign.yaml +++ b/functions/GUI/guiLabelSetHorizontalAlign.yaml @@ -1,10 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelSetHorizontalAlign -client: +shared: name: guiLabelSetHorizontalAlign description: This function sets the horizontal alignment of a text label. - parameters: [] + parameters: + - name: theLabel + type: element + description: The text label to set the horizontal alignment on. + - name: align + type: string + description: 'The alignment type. Valid type strings are: "left" "center" "right"' + - name: wordwrap + type: bool + description: Whether or not to enable wordwrap for the gui-label. + default: 'false' examples: - path: examples/guiLabelSetHorizontalAlign-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: guilabel + method: setHorizontalAlign + variable: horizontalAlign + static: false + requires_review: true diff --git a/functions/GUI/guiLabelSetVerticalAlign.yaml b/functions/GUI/guiLabelSetVerticalAlign.yaml index 5c42f90f..4d464155 100644 --- a/functions/GUI/guiLabelSetVerticalAlign.yaml +++ b/functions/GUI/guiLabelSetVerticalAlign.yaml @@ -1,10 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiLabelSetVerticalAlign -client: +shared: name: guiLabelSetVerticalAlign description: This function sets the vertical alignment of a text label. - parameters: [] + parameters: + - name: theLabel + type: element + description: The text label to set the vertical alignment on. + - name: align + type: string + description: 'The alignment type. Valid type strings are: "top" "center" "bottom"' examples: - path: examples/guiLabelSetVerticalAlign-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: guilabel + method: setVerticalAlign + variable: verticalAlign + static: false + requires_review: true diff --git a/functions/GUI/guiMemoGetCaretIndex.yaml b/functions/GUI/guiMemoGetCaretIndex.yaml index a71dc317..16306128 100644 --- a/functions/GUI/guiMemoGetCaretIndex.yaml +++ b/functions/GUI/guiMemoGetCaretIndex.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoGetCaretIndex -client: +shared: name: guiMemoGetCaretIndex description: This function returns the caret (the text cursor) position within the memo box. - parameters: [] + parameters: + - name: theElement + type: element + description: The memo box you want to get the caret position from examples: - path: examples/guiMemoGetCaretIndex-1.lua description: This example outputs the caret position of the memo to the chat side: client + returns: + values: + - type: int + name: value + description: Returns the caret index on success, false otherwise. + oop: + element: guimemo + method: getCaretIndex + variable: caretIndex + static: false pair: guiMemoSetCaretIndex - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMemoGetVerticalScrollPosition.yaml b/functions/GUI/guiMemoGetVerticalScrollPosition.yaml index 3df4977f..8884fe1f 100644 --- a/functions/GUI/guiMemoGetVerticalScrollPosition.yaml +++ b/functions/GUI/guiMemoGetVerticalScrollPosition.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoGetVerticalScrollPosition -client: +shared: name: guiMemoGetVerticalScrollPosition description: This function is used to get the vertical scroll position of a memo as a percentage. - parameters: [] + parameters: + - name: theMemo + type: gui-memo + description: the memo you want to know the vertical scroll position of. examples: - path: examples/guiMemoGetVerticalScrollPosition-1.lua description: This example gets the position of a memo called "theMemo" created withguiCreateMemo, and outputs it to the chatbox. side: client + returns: + values: + - type: float + name: value + description: Returns a float ranging between 0 and 100, or false otherwise. + oop: + element: guimemo + method: getVerticalScrollPosition + variable: verticalScrollPosition + static: false pair: guiMemoSetVerticalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMemoIsReadOnly.yaml b/functions/GUI/guiMemoIsReadOnly.yaml index 6dd05a3c..24f553b1 100644 --- a/functions/GUI/guiMemoIsReadOnly.yaml +++ b/functions/GUI/guiMemoIsReadOnly.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoIsReadOnly -client: +shared: name: guiMemoIsReadOnly description: This function checking if memo is read only or no. - parameters: [] + parameters: + - name: theMemo + type: gui-memo + description: The memo to check read-only status of. examples: - path: examples/guiMemoIsReadOnly-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the memo is read only, false if the memo isn't read + only, nil otherwise. + oop: + element: guimemo + method: isReadOnly + variable: readOnly + static: false pair: guiMemoSetReadOnly - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMemoSetCaretIndex.yaml b/functions/GUI/guiMemoSetCaretIndex.yaml index eb40316c..87e441be 100644 --- a/functions/GUI/guiMemoSetCaretIndex.yaml +++ b/functions/GUI/guiMemoSetCaretIndex.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoSetCaretIndex -client: +shared: name: guiMemoSetCaretIndex description: This function sets the current position of the caret (the text cursor) within the memo. - parameters: [] + parameters: + - name: theMemo + type: gui-memo + description: The memo edit box where the caret position is to be changed. + - name: index + type: int + description: An integer referring to the desired character position within the + box. 0 would be before the first character in the box, 1 before the second, + etc. examples: - path: examples/guiMemoSetCaretIndex-1.lua description: This example would create a memo and set the caret before the "H" in "Hi". side: client + returns: + values: + - type: bool + name: value + description: Returns true if the caret was successfully moved, false otherwise. + oop: + element: guimemo + method: setCaretIndex + variable: caretIndex + static: false pair: guiMemoGetCaretIndex - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMemoSetReadOnly.yaml b/functions/GUI/guiMemoSetReadOnly.yaml index 5a45e6a5..85af9853 100644 --- a/functions/GUI/guiMemoSetReadOnly.yaml +++ b/functions/GUI/guiMemoSetReadOnly.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoSetReadOnly -client: +shared: name: guiMemoSetReadOnly description: This function allows you to set or remove read\-only status for a GUI memo. If read\-only is set to *true*, the contents are not editable. - parameters: [] + parameters: + - name: theMemo + type: gui-memo + description: The memo to change read-only status of. + - name: status + type: bool + description: A boolean value indicating whether read-only is to be enabled or + disabled. examples: - path: examples/guiMemoSetReadOnly-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the status was successfully changed, false otherwise. + oop: + element: guimemo + method: setReadOnly + variable: readOnly + static: false pair: guiMemoIsReadOnly - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMemoSetVerticalScrollPosition.yaml b/functions/GUI/guiMemoSetVerticalScrollPosition.yaml index e8b991f6..fdd74e9e 100644 --- a/functions/GUI/guiMemoSetVerticalScrollPosition.yaml +++ b/functions/GUI/guiMemoSetVerticalScrollPosition.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMemoSetVerticalScrollPosition -client: +shared: name: guiMemoSetVerticalScrollPosition description: This function is used to set the vertical scroll position of a memo as a percentage. - parameters: [] + parameters: + - name: theMemo + type: gui-memo + description: the memo you want to change the vertical scroll position of. + - name: position + type: float + description: a float ranging between 0 and 100. examples: - path: examples/guiMemoSetVerticalScrollPosition-1.lua description: This example sets the position of a memo called "theMemo" created withguiCreateMemo, and outputs it to the chatbox. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the position was set, false otherwise. + oop: + element: guimemo + method: setVerticalScrollPosition + variable: verticalScrollPosition + static: false pair: guiMemoGetVerticalScrollPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiMoveToBack.yaml b/functions/GUI/guiMoveToBack.yaml index 1c246e02..86e71ded 100644 --- a/functions/GUI/guiMoveToBack.yaml +++ b/functions/GUI/guiMoveToBack.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiMoveToBack -client: +shared: name: guiMoveToBack description: This function moves a GUI element to the very back of all other GUI elements. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element that you want to move to the back examples: - path: examples/guiMoveToBack-1.lua description: This example creates a gui window and moves it to the back side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: guielement + method: moveToBack + static: false + requires_review: true diff --git a/functions/GUI/guiProgressBarGetProgress.yaml b/functions/GUI/guiProgressBarGetProgress.yaml index 1633888b..289488a7 100644 --- a/functions/GUI/guiProgressBarGetProgress.yaml +++ b/functions/GUI/guiProgressBarGetProgress.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiProgressBarGetProgress -client: +shared: name: guiProgressBarGetProgress description: This function gets the progress of a progress bar as a percentage. - parameters: [] + parameters: + - name: theProgressbar + type: progressBar + description: The progressbar you want to check. examples: - path: examples/guiProgressBarGetProgress-1.lua description: This example gets the progress of a bar called "somebar" created withguiCreateProgressBar, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float ranging between 0 and 100. + requires_review: true diff --git a/functions/GUI/guiProgressBarSetProgress.yaml b/functions/GUI/guiProgressBarSetProgress.yaml index 025fe656..d90c0053 100644 --- a/functions/GUI/guiProgressBarSetProgress.yaml +++ b/functions/GUI/guiProgressBarSetProgress.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiProgressBarSetProgress -client: +shared: name: guiProgressBarSetProgress description: This function is used to set the progress of a progressbar as a percentage. - parameters: [] + parameters: + - name: theProgressbar + type: progressBar + description: The progressbar you want to change the progress of + - name: progress + type: float + description: a float ranging from 0 - 100 examples: - path: examples/guiProgressBarSetProgress-1.lua description: This example sets the progress of a bar called "somebar" created withguiCreateProgressBar, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the progress was set, false otherwise. + requires_review: true diff --git a/functions/GUI/guiRadioButtonGetSelected.yaml b/functions/GUI/guiRadioButtonGetSelected.yaml index 8eda41c3..95b9b3eb 100644 --- a/functions/GUI/guiRadioButtonGetSelected.yaml +++ b/functions/GUI/guiRadioButtonGetSelected.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiRadioButtonGetSelected -client: +shared: name: guiRadioButtonGetSelected description: This function gets a radio button's selection state. - parameters: [] + parameters: + - name: guiRadioButton + type: element + description: The radio button you wish to retrieve the selection state of. examples: - path: examples/guiRadioButtonGetSelected-1.lua description: This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!) side: client + returns: + values: + - type: bool + name: value + description: Returns true if the radio button is selected, false if it is not. + oop: + element: guiradiobutton + method: getSelected + variable: selected + static: false pair: guiRadioButtonSetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiRadioButtonSetSelected.yaml b/functions/GUI/guiRadioButtonSetSelected.yaml index 7f706c11..51efeec1 100644 --- a/functions/GUI/guiRadioButtonSetSelected.yaml +++ b/functions/GUI/guiRadioButtonSetSelected.yaml @@ -1,13 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiRadioButtonSetSelected -client: +shared: name: guiRadioButtonSetSelected description: This function selects or unselects a radio button. - parameters: [] + parameters: + - name: guiRadioButton + type: element + description: The GUI radio button in which you wish to change the selection state + of + - name: state + type: bool + description: The state of the radio button, where true indicates selected, and + false indicates unselected. examples: - path: examples/guiRadioButtonSetSelected-1.lua description: This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!) side: client + returns: + values: + - type: bool + name: value + description: Returns true if the radio button's selection state was successfully + set, false otherwise. + oop: + element: guiradiobutton + method: setSelected + variable: selected + static: false pair: guiRadioButtonGetSelected - incomplete: true + requires_review: true diff --git a/functions/GUI/guiScrollBarGetScrollPosition.yaml b/functions/GUI/guiScrollBarGetScrollPosition.yaml index 78e9b65e..4d291cdc 100644 --- a/functions/GUI/guiScrollBarGetScrollPosition.yaml +++ b/functions/GUI/guiScrollBarGetScrollPosition.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollBarGetScrollPosition -client: +shared: name: guiScrollBarGetScrollPosition description: This function gets the scroll amount of a scrollbar as a percentage. - parameters: [] + parameters: + - name: theScrollBar + type: gui-scrollBar + description: The scrollbar you want to check. examples: - path: examples/guiScrollBarGetScrollPosition-1.lua description: This example outputs a message with the new scroll position when a scrollbar is scrolled. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float ranging between 0 and 100, representing the amount + the scrollbar has been scrolled. + requires_review: true diff --git a/functions/GUI/guiScrollBarSetScrollPosition.yaml b/functions/GUI/guiScrollBarSetScrollPosition.yaml index 06a4051e..95885aa2 100644 --- a/functions/GUI/guiScrollBarSetScrollPosition.yaml +++ b/functions/GUI/guiScrollBarSetScrollPosition.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollBarSetScrollPosition -client: +shared: name: guiScrollBarSetScrollPosition description: This function is used to set the scroll amount of a scrollbar as a percentage. - parameters: [] + parameters: + - name: theScrollBar + type: gui-scrollBar + description: The scrollbar you want to change the progress of + - name: amount + type: float + description: a float ranging from 0 - 100 representing the amount you wish to + set the scroll bar. examples: - path: examples/guiScrollBarSetScrollPosition-1.lua description: In this example, you can set the scrolling position using the command /pos side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the scroll position was successfully set, false otherwise. + requires_review: true diff --git a/functions/GUI/guiScrollPaneGetHorizontalScrollPosition.yaml b/functions/GUI/guiScrollPaneGetHorizontalScrollPosition.yaml index 6723eaf7..3b443274 100644 --- a/functions/GUI/guiScrollPaneGetHorizontalScrollPosition.yaml +++ b/functions/GUI/guiScrollPaneGetHorizontalScrollPosition.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollPaneGetHorizontalScrollPosition -client: +shared: name: guiScrollPaneGetHorizontalScrollPosition description: This function is used to get the position of a horizontal scroll pane as a percentage. - parameters: [] + parameters: + - name: horizontalScrollPane + type: element + description: The scroll pane you want to know the position of examples: - path: examples/guiScrollPaneGetHorizontalScrollPosition-1.lua description: This example gets the position of a scroll pane called "myScrollPane" created withguiCreateScrollPane, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float ranging between 0 and 100, or false otherwise. + requires_review: true diff --git a/functions/GUI/guiScrollPaneGetVerticalScrollPosition.yaml b/functions/GUI/guiScrollPaneGetVerticalScrollPosition.yaml index cca5c046..70e3487b 100644 --- a/functions/GUI/guiScrollPaneGetVerticalScrollPosition.yaml +++ b/functions/GUI/guiScrollPaneGetVerticalScrollPosition.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollPaneGetVerticalScrollPosition -client: +shared: name: guiScrollPaneGetVerticalScrollPosition description: This function is used to get the position of a vertical scroll pane as a percentage. - parameters: [] + parameters: + - name: verticalScrollPane + type: element + description: The scroll pane you want to know the position of examples: - path: examples/guiScrollPaneGetVerticalScrollPosition-1.lua description: This example gets the position of a scroll pane called "myScrollPane" created withguiCreateScrollPane, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float ranging between 0 and 100, or false otherwise. + requires_review: true diff --git a/functions/GUI/guiScrollPaneSetHorizontalScrollPosition.yaml b/functions/GUI/guiScrollPaneSetHorizontalScrollPosition.yaml index 968b5a2d..2bfcd6d0 100644 --- a/functions/GUI/guiScrollPaneSetHorizontalScrollPosition.yaml +++ b/functions/GUI/guiScrollPaneSetHorizontalScrollPosition.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollPaneSetHorizontalScrollPosition -client: +shared: name: guiScrollPaneSetHorizontalScrollPosition description: This function is used to set the position of a horizontal scroll pane as a percentage. - parameters: [] + parameters: + - name: horizontalScrollPane + type: element + description: The scroll pane you want to change the position of + - name: position + type: float + description: a float ranging from 0 - 100 examples: - path: examples/guiScrollPaneSetHorizontalScrollPosition-1.lua description: This example sets the position of a scroll pane called "myScrollPane" created withguiCreateScrollPane, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position was set, false otherwise. + requires_review: true diff --git a/functions/GUI/guiScrollPaneSetScrollBars.yaml b/functions/GUI/guiScrollPaneSetScrollBars.yaml index 83033946..1cb51d47 100644 --- a/functions/GUI/guiScrollPaneSetScrollBars.yaml +++ b/functions/GUI/guiScrollPaneSetScrollBars.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollPaneSetScrollBars -client: +shared: name: guiScrollPaneSetScrollBars description: This function allows a scrollpane's scrollbars to be forced **on**, or returned to default. - parameters: [] + parameters: + - name: scrollPane + type: element + description: the GUI scrollpane element you want to set the scrollbars of. + - name: horizontal + type: bool + description: A bool where true forces the horizontal scrollbar on, and false returns + them to default. + - name: vertical + type: bool + description: A bool where true forces the vertical scrollbar on, and false returns + them to default. examples: - path: examples/guiScrollPaneSetScrollBars-1.lua description: This example just checks to see if the scrollpane is created then sets the scrollbars. (TESTED!) side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the call was successfully, false otherwise. + requires_review: true diff --git a/functions/GUI/guiScrollPaneSetVerticalScrollPosition.yaml b/functions/GUI/guiScrollPaneSetVerticalScrollPosition.yaml index ea04e904..38777a58 100644 --- a/functions/GUI/guiScrollPaneSetVerticalScrollPosition.yaml +++ b/functions/GUI/guiScrollPaneSetVerticalScrollPosition.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiScrollPaneSetVerticalScrollPosition -client: +shared: name: guiScrollPaneSetVerticalScrollPosition description: This function is used to set the position of a vertical scroll pane as a percentage. - parameters: [] + parameters: + - name: verticalScrollPane + type: element + description: The scroll pane you want to change the position of + - name: position + type: float + description: a float ranging from 0 - 100 examples: - path: examples/guiScrollPaneSetVerticalScrollPosition-1.lua description: This example sets the position of a scroll pane called "myScrollPane" created withguiCreateScrollPane, and outputs it to the chatbox. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position was set, false otherwise. + requires_review: true diff --git a/functions/GUI/guiSetAlpha.yaml b/functions/GUI/guiSetAlpha.yaml index d2b2c40b..f9d17717 100644 --- a/functions/GUI/guiSetAlpha.yaml +++ b/functions/GUI/guiSetAlpha.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetAlpha -client: +shared: name: guiSetAlpha description: This changes the alpha level (the visibleness/transparency) of a GUI element - parameters: [] + parameters: + - name: guielement + type: element + description: MISSING_PARAM_DESC + - name: alpha + type: float + description: The visibility/transparency of the GUI element. Ranges from 0 (fully + transparent) to 1 (fully opaque). Default value is 0.80. examples: - path: examples/guiSetAlpha-1.lua description: This creates a GUI window and allows a player to change it's alpha (the visibleness/transparency) value with a command. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the gui element's alpha was successfully changed, + false otherwise. + oop: + element: guielement + method: setAlpha + variable: alpha + static: false pair: guiGetAlpha - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetEnabled.yaml b/functions/GUI/guiSetEnabled.yaml index caba4da5..32c5edbb 100644 --- a/functions/GUI/guiSetEnabled.yaml +++ b/functions/GUI/guiSetEnabled.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetEnabled -client: +shared: name: guiSetEnabled description: This function enables/disables a GUI element. A disabled GUI element can't be used, gets a gray aspect and doesn't receive any events. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element you wish to enable or disable + - name: enabled + type: bool + description: the new state examples: - path: examples/guiSetEnabled-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: If the function succeeds it returns true , if it fails it returns + false . + oop: + element: guielement + method: setEnabled + variable: enabled + static: false pair: guiGetEnabled - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetFont.yaml b/functions/GUI/guiSetFont.yaml index fc1082be..84186984 100644 --- a/functions/GUI/guiSetFont.yaml +++ b/functions/GUI/guiSetFont.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetFont -client: +shared: name: guiSetFont description: This function sets the font of a [GUI element](/wiki/GUI_widgets "GUI widgets") to be used when drawing text. - parameters: [] + parameters: + - name: guiElement + type: element + description: The GUI element you wish to change the font of + - name: font + type: mixed + description: Either a custom GUI font element or the name of a built-in GUI font. + See Standard GUI Font Names examples: - path: examples/guiSetFont-1.lua description: This example sets and gets the font of a pre-made gui element and outputs it to chat box. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the font has been successfully set on the gui element, + false otherwise. + oop: + element: guielement + method: setFont + variable: font + static: false pair: guiGetFont - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetInputEnabled.yaml b/functions/GUI/guiSetInputEnabled.yaml index fe30971c..e31d7778 100644 --- a/functions/GUI/guiSetInputEnabled.yaml +++ b/functions/GUI/guiSetInputEnabled.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetInputEnabled -client: +shared: name: guiSetInputEnabled description: This function enables or disables input focus for the GUI. This means that any keybinds or MTA binds are overidden so that text can be input into an editbox, for example. In other words, keys such as *t* and *y* which activate the chatbox are disabled. - parameters: [] + parameters: + - name: enabled + type: bool + description: true if input should go to GUI, false if it should go to the game. examples: - path: examples/guiSetInputEnabled-1.lua description: This example enables or disables the Input. side: client + returns: + values: + - type: bool + name: value + description: Returns true if input mode could be changed, false if invalid parameters + are passed. + oop: + element: GuiElement + method: ) + variable: inputEnabled + static: true pair: guiGetInputEnabled - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetInputMode.yaml b/functions/GUI/guiSetInputMode.yaml index ac552783..993829a3 100644 --- a/functions/GUI/guiSetInputMode.yaml +++ b/functions/GUI/guiSetInputMode.yaml @@ -1,15 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetInputMode -client: +shared: name: guiSetInputMode description: 'This function controls the input mode to define whether or not (and when) keybinds or MTA binds are overridden (disabled) so that text can be input into an editbox, for example. Available input modes are:' - parameters: [] + parameters: + - name: mode + type: string + description: 'a string representing the desired input mode. Accepted values are: + "allow_binds": binds are enabled, hence using a key such as t in an editbox + will still open the chatbox (default) "no_binds": binds are disabled, hence + using a key such as t will never open the chatbox "no_binds_when_editing": binds + are enabled except when an editbox or memo has input focus' examples: - path: examples/guiSetInputMode-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if input mode could be changed, false if invalid parameters + are passed. + oop: + element: GuiElement + method: ) + variable: inputMode + static: true pair: guiGetInputMode - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetPosition.yaml b/functions/GUI/guiSetPosition.yaml index 98341722..26884502 100644 --- a/functions/GUI/guiSetPosition.yaml +++ b/functions/GUI/guiSetPosition.yaml @@ -1,13 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetPosition -client: +shared: name: guiSetPosition description: This function sets the position of a GUI element. - parameters: [] + parameters: + - name: theElement + type: element + description: The GUI element to change position for + - name: x + type: float + description: Position over the X axis + - name: "y" + type: float + description: Position over the Y axis + - name: relative + type: bool + description: Bool that indicates if the x/y positions are relative to the elements + parent element. examples: - path: examples/guiSetPosition-1.lua description: This example creates a label. When an element is clicked, the label displays in the position of the element telling you what kind of element you have clicked. It hides after 5 seconds. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the position has been successfully set, false otherwise. + oop: + element: guielement + method: setPosition + variable: position + static: false pair: guiGetPosition - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetProperty.yaml b/functions/GUI/guiSetProperty.yaml index 74e132e3..b28e76e0 100644 --- a/functions/GUI/guiSetProperty.yaml +++ b/functions/GUI/guiSetProperty.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetProperty -client: +shared: name: guiSetProperty description: This function sets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the [CEGUI properties page](http://static.cegui.org.uk/static/WindowsLookProperties.html). - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element you wish to get a property of. + - name: property + type: string + description: the name of of property you want the value of. + - name: value + type: string + description: the new value for the property. examples: - path: examples/guiSetProperty-1.lua description: This example creates a button when the resource starts and defines @@ -15,5 +24,15 @@ client: description: This example creates a button when the resource starts and defines its normal color to red and hover color to yellow. side: client + returns: + values: + - type: bool + name: value + description: If the function succeeds it returns true , if it fails it returns + false . + oop: + element: guielement + method: setProperty + static: false pair: guiGetProperty - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetSelectedTab.yaml b/functions/GUI/guiSetSelectedTab.yaml index 4865b225..b48afbc5 100644 --- a/functions/GUI/guiSetSelectedTab.yaml +++ b/functions/GUI/guiSetSelectedTab.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetSelectedTab -client: +shared: name: guiSetSelectedTab description: This function is used to change the currently selected [tab](/wiki/Element/GUI/Tab "Element/GUI/Tab") in a [tab panel](/wiki/Element/GUI/Tab_panel "Element/GUI/Tab panel"). - parameters: [] + parameters: + - name: tabPanel + type: element + description: The tab panel which current tab you want to change. + - name: theTab + type: element + description: The tab which will be the new active tab. examples: - path: examples/guiSetSelectedTab-1.lua description: This example changes the selected tab to the next available tab. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the selected tab was changed to a new one successfully, + false otherwise. + requires_review: true diff --git a/functions/GUI/guiSetSize.yaml b/functions/GUI/guiSetSize.yaml index ef32b8fd..6e6a029a 100644 --- a/functions/GUI/guiSetSize.yaml +++ b/functions/GUI/guiSetSize.yaml @@ -1,14 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetSize -client: +shared: name: guiSetSize description: This function sets the dimensions (size) of a GUI element. It refers to the bounding box size for GUI elements. It does not make GUI elements smaller or larger in appearance. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element whose visibility is to be changed + - name: width + type: float + description: The desired width setting for the gui element + - name: height + type: float + description: The desired height setting for the gui element + - name: relative + type: bool + description: This is whether sizes and positioning are relative. If this is true + , then all x,y,width,height floats must be between 0 and 1, representing sizes + relative to the parent. examples: - path: examples/guiSetSize-1.lua description: This example creates a gui window and changes the x and y width of the window every 2 seconds. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the gui element's size was set successfully, false + otherwise. + oop: + element: guielement + method: setSize + static: false pair: guiGetSize - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetText.yaml b/functions/GUI/guiSetText.yaml index b3b00c37..df89f1db 100644 --- a/functions/GUI/guiSetText.yaml +++ b/functions/GUI/guiSetText.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetText -client: +shared: name: guiSetText description: This function sets the text of a GUI element. - parameters: [] + parameters: + - name: guiElement + type: element + description: The GUI element you wish to change the text of + - name: text + type: string + description: The new text examples: - path: examples/guiSetText-1.lua description: This example creates a label. When an element is clicked, the label displays in the position of the element telling you what kind of element you have clicked. It hides after 5 seconds. side: client + returns: + values: + - type: bool + name: value + description: Returns true if text has been successfully set on the gui element, + false otherwise. + oop: + element: guielement + method: setText + variable: text + static: false pair: guiGetText - incomplete: true + requires_review: true diff --git a/functions/GUI/guiSetVisible.yaml b/functions/GUI/guiSetVisible.yaml index ba5e44fc..c16ccdbf 100644 --- a/functions/GUI/guiSetVisible.yaml +++ b/functions/GUI/guiSetVisible.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiSetVisible -client: +shared: name: guiSetVisible description: This function changes the visibility state of a GUI element. - parameters: [] + parameters: + - name: guiElement + type: element + description: the GUI element whose visibility is to be changed + - name: state + type: bool + description: the new visibility state examples: - path: examples/guiSetVisible-1.lua description: This example creates a GUI window and changes its visibility every @@ -12,5 +18,16 @@ client: description: This example creates a GUI window withyesandnobuttons and you can toggle its visibility with thexkey. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the element's visibility could be changed, false + otherwise. + oop: + element: guielement + method: setVisible + variable: visible + static: false pair: guiGetVisible - incomplete: true + requires_review: true diff --git a/functions/GUI/guiStaticImageGetNativeSize.yaml b/functions/GUI/guiStaticImageGetNativeSize.yaml index ce9bf733..68154852 100644 --- a/functions/GUI/guiStaticImageGetNativeSize.yaml +++ b/functions/GUI/guiStaticImageGetNativeSize.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiStaticImageGetNativeSize -client: +shared: name: guiStaticImageGetNativeSize description: This function gets the native size of image. That means the original size in pixels of the image file. - parameters: [] + parameters: + - name: theImage + type: element + description: The static image element to get the original size of. examples: - path: examples/guiStaticImageGetNativeSize-1.lua description: This example creates an image at the resource's start and changes its size to the original size so it keeps the best quality. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns two integers where first is the width and second the height + of the image in pixels, false if the image element was invalid. + requires_review: true diff --git a/functions/GUI/guiStaticImageLoadImage.yaml b/functions/GUI/guiStaticImageLoadImage.yaml index f26a3982..28b95867 100644 --- a/functions/GUI/guiStaticImageLoadImage.yaml +++ b/functions/GUI/guiStaticImageLoadImage.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiStaticImageLoadImage -client: +shared: name: guiStaticImageLoadImage description: 'This function allows you to change the image in GUI static image element to another one. **Tip**: If you set other images as children you will have to use [setElementCallPropagationEnabled](/wiki/SetElementCallPropagationEnabled "SetElementCallPropagationEnabled") to only affect the parent image.' - parameters: [] + parameters: + - name: theElement + type: element + description: The static image element to be changed. + - name: filename + type: string + description: A string specifying the filepath of the image file being loaded in + current resource. examples: - path: examples/guiStaticImageLoadImage-1.lua description: This example creates a static image ("myimage.png") and replaces it with other image ("otherimage.png") 10 seconds after creation. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the the image in the static image element was successfully + changed, false otherwise. + oop: + element: guistaticimage + method: loadImage + variable: image + static: false + requires_review: true diff --git a/functions/GUI/guiWindowIsMovable.yaml b/functions/GUI/guiWindowIsMovable.yaml index cb89a1ef..cbc7e437 100644 --- a/functions/GUI/guiWindowIsMovable.yaml +++ b/functions/GUI/guiWindowIsMovable.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiWindowIsMovable -client: +shared: name: guiWindowIsMovable description: This function checks if a GUI window is movable. - parameters: [] + parameters: + - name: guiWindow + type: gui-window + description: the window to check the movable flag of examples: - path: examples/guiWindowIsMovable-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the window is movable, false if not, nil if an invalid + window was provided. pair: guiWindowSetMovable - incomplete: true + requires_review: true diff --git a/functions/GUI/guiWindowIsSizable.yaml b/functions/GUI/guiWindowIsSizable.yaml index 09d5b9b4..7bb20b90 100644 --- a/functions/GUI/guiWindowIsSizable.yaml +++ b/functions/GUI/guiWindowIsSizable.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiWindowIsSizable -client: +shared: name: guiWindowIsSizable description: This function checks if a GUI window is sizable. - parameters: [] + parameters: + - name: guiWindow + type: gui-window + description: the window to check the sizable flag of examples: - path: examples/guiWindowIsSizable-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the window is sizable, false if not, nil if an invalid + window was provided. pair: guiWindowSetSizable - incomplete: true + requires_review: true diff --git a/functions/GUI/guiWindowSetMovable.yaml b/functions/GUI/guiWindowSetMovable.yaml index 6fc2ffcc..e794be81 100644 --- a/functions/GUI/guiWindowSetMovable.yaml +++ b/functions/GUI/guiWindowSetMovable.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiWindowSetMovable -client: +shared: name: guiWindowSetMovable description: This function allows you to specify whether or not a user can move a GUI window. - parameters: [] + parameters: + - name: theElement + type: element + description: The window to be changed. + - name: status + type: bool + description: A boolean value indicating whether the window is movable or not. examples: - path: examples/guiWindowSetMovable-1.lua description: This example creates a gui window and sets it to be not movable side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function is successful, false otherwise. + oop: + element: guiwindow + method: setMovable + variable: movable + static: false pair: guiWindowIsMovable - incomplete: true + requires_review: true diff --git a/functions/GUI/guiWindowSetSizable.yaml b/functions/GUI/guiWindowSetSizable.yaml index 964eac98..2e22dabd 100644 --- a/functions/GUI/guiWindowSetSizable.yaml +++ b/functions/GUI/guiWindowSetSizable.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GuiWindowSetSizable -client: +shared: name: guiWindowSetSizable description: This function enables or disables user resizing of a GUI window. - parameters: [] + parameters: + - name: theElement + type: element + description: The window to be changed. + - name: status + type: bool + description: A boolean value indicating whether user resizing is to be enabled + or disabled. examples: - path: examples/guiWindowSetSizable-1.lua description: This example creates a gui window and sets it to be not sizable side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function is successful, false otherwise. + oop: + element: guiwindow + method: setSizable + variable: sizable + static: false pair: guiWindowIsSizable - incomplete: true + requires_review: true diff --git a/functions/GUI/isChatBoxInputActive.yaml b/functions/GUI/isChatBoxInputActive.yaml index be4b2a99..8deebcaf 100644 --- a/functions/GUI/isChatBoxInputActive.yaml +++ b/functions/GUI/isChatBoxInputActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsChatBoxInputActive -client: +shared: name: isChatBoxInputActive description: This function returns whether the ingame chatbox is being used (accepting chatbox input) or not. @@ -9,4 +9,14 @@ client: description: This example shows how you can check if a user has the chat box active (and presumably typing a message). side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the chatbox is receiving input, false if not active. + oop: + element: GuiElement + method: ) + variable: chatBoxInputActive + static: true + requires_review: true diff --git a/functions/GUI/isConsoleActive.yaml b/functions/GUI/isConsoleActive.yaml index 03dc5d3c..26a65953 100644 --- a/functions/GUI/isConsoleActive.yaml +++ b/functions/GUI/isConsoleActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsConsoleActive -client: +shared: name: isConsoleActive description: This function returns whether the ingame console window is visible or not. @@ -8,4 +8,14 @@ client: - path: examples/isConsoleActive-1.lua description: This example does... side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the console is visible, false if not. + oop: + element: guielement + method: isConsoleActive + variable: consoleActive + static: false + requires_review: true diff --git a/functions/GUI/isDebugViewActive.yaml b/functions/GUI/isDebugViewActive.yaml index e1b6fbb4..82db161b 100644 --- a/functions/GUI/isDebugViewActive.yaml +++ b/functions/GUI/isDebugViewActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsDebugViewActive -client: +shared: name: isDebugViewActive description: This function returns whether the ingame debug window is visible or not. This is the debugwindow visible using the "debugscript \" command. @@ -9,5 +9,15 @@ client: description: This example makes a /debug command to check if the client's debugscript is on or off. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the debug view is visible, false if not. + oop: + element: GuiElement + method: ) + variable: debugViewActive + static: true pair: setDebugViewActive - incomplete: true + requires_review: true diff --git a/functions/GUI/isMTAWindowActive.yaml b/functions/GUI/isMTAWindowActive.yaml index 19c65414..de86b516 100644 --- a/functions/GUI/isMTAWindowActive.yaml +++ b/functions/GUI/isMTAWindowActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsMTAWindowActive -client: +shared: name: isMTAWindowActive description: 'This function returns whether any system windows that take focus are active. This includes:' @@ -9,8 +9,17 @@ client: description: This piece of script will kill a player if he has any of the above system windows open side: client + returns: + values: + - type: bool + name: value + description: Returns true if the focus is on the MTA window, false if it isn't. + oop: + element: GuiElement + method: ) + static: true notes: - type: info content: You cannot rely on this function to get the focus state of the MTA window - use isMTAWindowFocused instead - incomplete: true + requires_review: true diff --git a/functions/GUI/isMainMenuActive.yaml b/functions/GUI/isMainMenuActive.yaml index d58d3877..b697f71b 100644 --- a/functions/GUI/isMainMenuActive.yaml +++ b/functions/GUI/isMainMenuActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsMainMenuActive -client: +shared: name: isMainMenuActive description: This function returns whether the user is in the mainmenu or not. parameters: [] @@ -7,4 +7,14 @@ client: - path: examples/isMainMenuActive-1.lua description: This example check if the player is afk. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the mainmenu is visible, false if not. + oop: + element: GuiElement + method: ) + variable: mainMenuActive + static: true + requires_review: true diff --git a/functions/GUI/isTransferBoxActive.yaml b/functions/GUI/isTransferBoxActive.yaml index 743f6526..15b04745 100644 --- a/functions/GUI/isTransferBoxActive.yaml +++ b/functions/GUI/isTransferBoxActive.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTransferBoxActive -client: +shared: name: isTransferBoxActive description: This function returns whether the file downloading dialog box is active or not. This appears when a resource is started and the client doesn't have all @@ -9,4 +9,13 @@ client: - path: examples/isTransferBoxActive-1.lua description: This makes the camera fade in, once all resource downloads are finished. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the file transfer box is visible, false if not. + oop: + element: GuiElement + method: ) + static: true + requires_review: true diff --git a/functions/GUI/setChatboxCharacterLimit.yaml b/functions/GUI/setChatboxCharacterLimit.yaml index dc3329f2..e5556e3c 100644 --- a/functions/GUI/setChatboxCharacterLimit.yaml +++ b/functions/GUI/setChatboxCharacterLimit.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetChatboxCharacterLimit -client: +shared: name: setChatboxCharacterLimit description: Sets the maximum amount of characters that can be input via chatbox - parameters: [] + parameters: + - name: charLimit + type: int + description: an integer between 0-255. Passing -1 will reset the character limit + (96) examples: - path: examples/setChatboxCharacterLimit-1.lua description: This example shows how you can set the character limit to maximum when a player joins the server (assuming this resource is running when they join). side: client + returns: + values: + - type: bool + name: value + description: Returns true if the character limit was set, false otherwise + oop: + element: GuiElement + method: ) + variable: chatboxCharacterLimit + static: true pair: getChatboxCharacterLimit - incomplete: true + requires_review: true diff --git a/functions/GUI/setDebugViewActive.yaml b/functions/GUI/setDebugViewActive.yaml index 9a1a91cc..d036d6b1 100644 --- a/functions/GUI/setDebugViewActive.yaml +++ b/functions/GUI/setDebugViewActive.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDebugViewActive -client: +shared: name: setDebugViewActive description: This function enables or disables the debug window. - parameters: [] + parameters: + - name: enabled + type: bool + description: true if debug window should be visible, false otherwise. examples: - path: examples/setDebugViewActive-1.lua description: This example enables or disables the debug window. side: client + returns: + values: + - type: bool + name: value + description: Returns true , false if invalid parameters are passed. + oop: + element: GuiElement + method: ) + variable: debugViewActive + static: true pair: isDebugViewActive - incomplete: true + requires_review: true diff --git a/functions/HTTP/httpClear.yaml b/functions/HTTP/httpClear.yaml index 07598142..68c06a52 100644 --- a/functions/HTTP/httpClear.yaml +++ b/functions/HTTP/httpClear.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpClear -server: +shared: name: httpClear description: This function removes all text from the current HTML output. parameters: [] @@ -15,4 +15,10 @@ server: - path: examples/httpClear-3.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the output buffer was cleared successfully, false + otherwise. + requires_review: true diff --git a/functions/HTTP/httpRequestLogin.yaml b/functions/HTTP/httpRequestLogin.yaml index 24f6fe6f..d3a34261 100644 --- a/functions/HTTP/httpRequestLogin.yaml +++ b/functions/HTTP/httpRequestLogin.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpRequestLogin -server: +shared: name: httpRequestLogin description: This function makes the user's browser show a 'basic authentication' login box. The result of the login is handled automatically by the server. If @@ -15,4 +15,10 @@ server: description: This example shows how you can make a page that only registered users can see. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the relevant headers and return codes have been set, + false otherwise. Essentially, always returns true . + requires_review: true diff --git a/functions/HTTP/httpSetResponseCode.yaml b/functions/HTTP/httpSetResponseCode.yaml index 2a55469a..5dd52cc0 100644 --- a/functions/HTTP/httpSetResponseCode.yaml +++ b/functions/HTTP/httpSetResponseCode.yaml @@ -1,13 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpSetResponseCode -server: +shared: name: httpSetResponseCode description: This function sets the HTTP status code that will be sent for the current HTML page. - parameters: [] + parameters: + - name: code + type: int + description: MISSING_PARAM_DESC examples: - path: examples/httpSetResponseCode-1.lua description: This example displays a 'Page not found' error message and the response code 404. The location of thehttpSetResponseCodecall is unimportant - it can be placed anywhere in the document. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the code was set successfully, false otherwise. + requires_review: true diff --git a/functions/HTTP/httpSetResponseCookie.yaml b/functions/HTTP/httpSetResponseCookie.yaml index 4d5b1654..2f6e98a9 100644 --- a/functions/HTTP/httpSetResponseCookie.yaml +++ b/functions/HTTP/httpSetResponseCookie.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpSetResponseCookie -server: +shared: name: httpSetResponseCookie description: This function sets the value for the specified HTTP cookie of the current HTML page. - parameters: [] + parameters: + - name: cookieName + type: string + description: MISSING_PARAM_DESC + - name: cookieValue + type: string + description: MISSING_PARAM_DESC examples: - path: examples/httpSetResponseCookie-1.lua description: This example is going to get the current users account name and save their name to a cookie. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the cookie value was set successfully, false otherwise. + requires_review: true diff --git a/functions/HTTP/httpSetResponseHeader.yaml b/functions/HTTP/httpSetResponseHeader.yaml index 11b6b589..ca32b599 100644 --- a/functions/HTTP/httpSetResponseHeader.yaml +++ b/functions/HTTP/httpSetResponseHeader.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpSetResponseHeader -server: +shared: name: httpSetResponseHeader description: This function sets the value for the specified HTTP response header of the current HTML page. - parameters: [] + parameters: + - name: headerName + type: string + description: MISSING_PARAM_DESC + - name: headerValue + type: string + description: MISSING_PARAM_DESC examples: - path: examples/httpSetResponseHeader-1.lua description: Using httpSetResponseHeader to set the content type. (Example fromhttpWrite) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the header value was set successfully, false otherwise. + requires_review: true diff --git a/functions/HTTP/httpWrite.yaml b/functions/HTTP/httpWrite.yaml index 295cff09..a7c41769 100644 --- a/functions/HTTP/httpWrite.yaml +++ b/functions/HTTP/httpWrite.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/HttpWrite -server: +shared: name: httpWrite description: This function adds text to the output of the current HTTP file of the [HTTP interface](/wiki/Resource_Web_Access "Resource Web Access"). The function @@ -7,7 +7,14 @@ server: support outputing binary data, if you specify the length of the data you are outtputing. If you do this, you should ensure you set an accurate content\-type using [httpSetResponseHeader](/wiki/HttpSetResponseHeader "HttpSetResponseHeader") otherwise it may be displayed inconsistently by browsers. - parameters: [] + parameters: + - name: data + type: string + description: the data to be added to the page's output. + - name: length + type: int + description: The length of the data being written. Generally only should be required + for writing binary data. examples: - path: examples/httpWrite-1.lua description: Example 1:This sample resource page will output a random quote from @@ -19,7 +26,12 @@ server: This is useful as the internal server doesn't not support subdirectories reliably so you can create a page to return files to you. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the text was added to the output buffer successfully, + false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -27,3 +39,4 @@ server: - Missing section: Shortcut syntax ' + requires_review: true diff --git a/functions/Input/addCommandHandler.yaml b/functions/Input/addCommandHandler.yaml index 0b9d6b75..e55d8a93 100644 --- a/functions/Input/addCommandHandler.yaml +++ b/functions/Input/addCommandHandler.yaml @@ -1,4 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddCommandHandler +client: + name: addCommandHandler + description: This function will attach a scripting function (handler) to a console + command, so that whenever a player or administrator uses the command the function + is called. + parameters: [] + examples: + - path: examples/addCommandHandler-4.lua + description: Example 1:This example warps the local player to a random nearby + location (useful for when a player gets stuck somewhere). + side: client + returns: + values: + - type: bool + name: value + description: Returns true if the command handler was added successfully, false + otherwise. + notes: &id001 + - type: info + content: You can't use "check", "list", "test" and "help" as a command name. + - type: important + content: Do NOT use the same name for your handler function as the command name, + as this can lead to confusion if multiple handler functions are used. Use a + name that describes your handler's purpose more specifically. + requires_review: true server: name: addCommandHandler description: This function will attach a scripting function (handler) to a console @@ -26,15 +51,11 @@ server: to put this shared logic in a separate function instead, as this gives you more control over the flow. side: server - - path: examples/addCommandHandler-4.lua - description: Example 1:This example warps the local player to a random nearby - location (useful for when a player gets stuck somewhere). - side: client - notes: - - type: info - content: You can't use "check", "list", "test" and "help" as a command name. - - type: important - content: Do NOT use the same name for your handler function as the command name, - as this can lead to confusion if multiple handler functions are used. Use a - name that describes your handler's purpose more specifically. - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the command handler was added successfully, false + otherwise. + notes: *id001 + requires_review: true diff --git a/functions/Input/bindKey.yaml b/functions/Input/bindKey.yaml index dbb33bc8..3270e8ec 100644 --- a/functions/Input/bindKey.yaml +++ b/functions/Input/bindKey.yaml @@ -1,26 +1,79 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BindKey -server: +client: name: bindKey description: Binds a player's key to a handler function or command, which will be called when the key is pressed. - parameters: [] + parameters: + - name: key + type: string + description: The key or control you wish to bind to the command. See key names + for a list of possible keys. + - name: keyState + type: string + description: 'A string that has one of the following values: "up": If the bound + key should trigger the function when the key is released "down": If the bound + key should trigger the function when the key is pressed "both": If the bound + key should trigger the function when the key is pressed or released' + - name: commandName + type: string + description: The name of the command that the key should be binded to. + - name: arguments + type: string + description: '' examples: - - path: examples/bindKey-1.lua - description: This example will bind a player's 'F1' key and 'fire' control to - 1 input function. - side: server - path: examples/bindKey-2.lua description: This example will bind a player's 'F1' key and 'fire' control to 1 input function, clientside. side: client - - path: examples/bindKey-3.lua - description: This example says how cool is the MTA:SA is if players wants to move. - side: server - notes: + returns: + values: + - type: bool + name: value + description: Returns true if the key was bound, false otherwise. + notes: &id001 - type: info content: Using escape key or F8 key will always return false. Use onClientKey event instead. - type: info content: Handler function won't be triggered while focused in CEGUI editbox. You can use guiSetInputMode or onClientKey in order to fix that. - incomplete: true + requires_review: true +server: + name: bindKey + description: Binds a player's key to a handler function or command, which will be + called when the key is pressed. + parameters: + - name: thePlayer + type: player + description: The player you wish to bind the key of. + - name: key + type: string + description: The key or control you wish to bind to the command. See key names + for a list of possible keys. + - name: keyState + type: string + description: 'A string that has one of the following values: "up": If the bound + key should trigger the function when the key is released "down": If the bound + key should trigger the function when the key is pressed "both": If the bound + key should trigger the function when the key is pressed or released' + - name: commandName + type: string + description: The name of the command that the key should be binded to. + - name: arguments + type: string + description: '' + examples: + - path: examples/bindKey-1.lua + description: This example will bind a player's 'F1' key and 'fire' control to + 1 input function. + side: server + - path: examples/bindKey-3.lua + description: This example says how cool is the MTA:SA is if players wants to move. + side: server + returns: + values: + - type: bool + name: value + description: Returns true if the key was bound, false otherwise. + notes: *id001 + requires_review: true diff --git a/functions/Input/executeCommandHandler.yaml b/functions/Input/executeCommandHandler.yaml index 4ca45707..04ddfe73 100644 --- a/functions/Input/executeCommandHandler.yaml +++ b/functions/Input/executeCommandHandler.yaml @@ -1,20 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ExecuteCommandHandler +client: + name: executeCommandHandler + description: This function will call all the attached functions of an existing console + command, for a specified player. + parameters: + - name: commandName + type: string + description: MISSING_PARAM_DESC + - name: args + type: string + description: MISSING_PARAM_DESC + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the command handler was called successfully, false + otherwise. + notes: &id001 + - type: info + content: You can only execute commands created with addCommandHandler. You cannot + execute MTA harcoded commands due to security reasons. + - type: info + content: Serverside commands can only be executed by the server. The same applies + to the client side + requires_review: true server: name: executeCommandHandler description: This function will call all the attached functions of an existing console command, for a specified player. - parameters: [] + parameters: + - name: commandName + type: string + description: MISSING_PARAM_DESC + - name: thePlayer + type: player + description: MISSING_PARAM_DESC + - name: args + type: string + description: MISSING_PARAM_DESC examples: - path: examples/executeCommandHandler-1.lua description: This example defines a command handler for the commandcreatemarker(which creates a red marker at the caller's position). It then creates a second command handlercreatemarker2which will call the first one. side: server - notes: - - type: info - content: You can only execute commands created with addCommandHandler. You cannot - execute MTA harcoded commands due to security reasons. - - type: info - content: Serverside commands can only be executed by the server. The same applies - to the client side - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the command handler was called successfully, false + otherwise. + notes: *id001 + requires_review: true diff --git a/functions/Input/getAnalogControlState.yaml b/functions/Input/getAnalogControlState.yaml index bf1e79fe..36a8d33f 100644 --- a/functions/Input/getAnalogControlState.yaml +++ b/functions/Input/getAnalogControlState.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAnalogControlState -client: +shared: name: getAnalogControlState description: This retrieves the analog control state of a control. This is useful for detecting sensitive controls, such as those used on a joypad. - parameters: [] + parameters: + - name: control + type: string + description: The control that you want to get the state of. See control names + for a list of possible controls. + - name: rawValue + type: bool + description: A bool indicating if it should return the raw player input value. examples: - path: examples/getAnalogControlState-1.lua description: This creates an/forwardscommand, which toggles yourforwardscontrol state between 0 and 1. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float between 0 and 1 indicating the amount the control + is pressed. + requires_review: true diff --git a/functions/Input/getBoundKeys.yaml b/functions/Input/getBoundKeys.yaml index b709e526..f877cf50 100644 --- a/functions/Input/getBoundKeys.yaml +++ b/functions/Input/getBoundKeys.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetBoundKeys -client: +shared: name: getBoundKeys description: Returns a list of key names that are bound to the specified game [control](/wiki/Control_names "Control names") or console command. - parameters: [] + parameters: + - name: command/control + type: string + description: the name of a game control or a console command. See the control + names page for valid controls. examples: - path: examples/getBoundKeys-1.lua description: This code adds a command handler with which you can check out the keybinds for any game control. As an example, typing "/keys forwards" would list all the keys which you can press to make the player walk forward. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: If one or more keys are bound to the specified control or console + command, a table is returned indexed by the names of the keys and containing + key states as values. If no keys are bound or an invalid name was passed, returns + false . + requires_review: true diff --git a/functions/Input/getCommandHandlers.yaml b/functions/Input/getCommandHandlers.yaml index 0c9e8b65..6b9b7129 100644 --- a/functions/Input/getCommandHandlers.yaml +++ b/functions/Input/getCommandHandlers.yaml @@ -1,11 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCommandHandlers -server: +shared: name: getCommandHandlers description: 'This function is used to retrieve a list of all the registered command handlers of a given resource (or of all resources). Function also added client\-side.' - parameters: [] + parameters: + - name: theResource + type: resource + description: The resource from which you wish to retrieve all command handlers. + Or leave it empty to retrieve command handlers of all resources. examples: - path: examples/getCommandHandlers-1.lua description: This example add a command to output list of all commands in the @@ -15,4 +19,11 @@ server: description: 'This example add a command to output list of all commands for the resource in the chat. Syntax: /commands [resource-name]' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table containing all the commands of the given resource + or a table with subtables containing the command and theResource pointer ( { + "command", theResource } ). See examples below if you don't understand it. + requires_review: true diff --git a/functions/Input/getCommandsBoundToKey.yaml b/functions/Input/getCommandsBoundToKey.yaml index c9c83495..1ec80524 100644 --- a/functions/Input/getCommandsBoundToKey.yaml +++ b/functions/Input/getCommandsBoundToKey.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCommandsBoundToKey -client: +shared: name: getCommandsBoundToKey description: Gets the commands bound to a key. - parameters: [] + parameters: + - name: theKey + type: string + description: See key names for a list of possible keys + - name: keyState + type: string + description: 'A string that has one of the following values: "up": If the bound + key should trigger the function when the key is released "down": If the bound + key should trigger the function when the key is pressed "both": If the bound + key should trigger the function when the key is pressed or released' examples: - path: examples/getCommandsBoundToKey-1.lua description: This example adds the command /keycommands side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of the commands bound on that key. + requires_review: true diff --git a/functions/Input/getFunctionsBoundToKey.yaml b/functions/Input/getFunctionsBoundToKey.yaml index edd90b90..4231cf7d 100644 --- a/functions/Input/getFunctionsBoundToKey.yaml +++ b/functions/Input/getFunctionsBoundToKey.yaml @@ -1,16 +1,54 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetFunctionsBoundToKey -server: +client: name: getFunctionsBoundToKey description: Gets the functions bound to a key. To bind a function to a key use the [bindKey](/wiki/BindKey "BindKey") function - parameters: [] + parameters: + - name: key + type: string + description: MISSING_PARAM_DESC + - name: keyState + type: string + description: 'A string that has one of the following values: "up": If the bound + key should trigger the function when the key is released "down": If the bound + key should trigger the function when the key is pressed "both": If the bound + key should trigger the function when the key is pressed or released' examples: - path: examples/getFunctionsBoundToKey-1.lua description: This loops through all the keys and outputs the keyname and the function bound to that key. side: client + returns: + values: + - type: table + name: value + description: Returns a table of the key function(s). + requires_review: true +server: + name: getFunctionsBoundToKey + description: Gets the functions bound to a key. To bind a function to a key use + the [bindKey](/wiki/BindKey "BindKey") function + parameters: + - name: thePlayer + type: player + description: The player to get the functions from a key. + - name: key + type: string + description: MISSING_PARAM_DESC + - name: keyState + type: string + description: 'A string that has one of the following values: "up": If the bound + key should trigger the function when the key is released "down": If the bound + key should trigger the function when the key is pressed "both": If the bound + key should trigger the function when the key is pressed or released' + examples: - path: examples/getFunctionsBoundToKey-2.lua description: This loops through all the keys and outputs the keyname and the function bound to that key. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of the key function(s). + requires_review: true diff --git a/functions/Input/getKeyBoundToCommand.yaml b/functions/Input/getKeyBoundToCommand.yaml index e4e92ad0..aac9bba2 100644 --- a/functions/Input/getKeyBoundToCommand.yaml +++ b/functions/Input/getKeyBoundToCommand.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetKeyBoundToCommand -client: +shared: name: getKeyBoundToCommand description: This function allow you get first key bound to command. - parameters: [] + parameters: + - name: command + type: string + description: command what you need check. examples: - path: examples/getKeyBoundToCommand-1.lua description: This example adds a /getcommandbind command, allowing players to see what keys are bound to the given command. side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string of first key binded to current command. + requires_review: true diff --git a/functions/Input/getKeyBoundToFunction.yaml b/functions/Input/getKeyBoundToFunction.yaml index 7f6d5537..ab552b34 100644 --- a/functions/Input/getKeyBoundToFunction.yaml +++ b/functions/Input/getKeyBoundToFunction.yaml @@ -1,11 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetKeyBoundToFunction -server: +client: name: getKeyBoundToFunction description: getKeyBoundToFunction allows retrieval of the first key bound to a function. - parameters: [] + parameters: + - name: theFunction + type: function + description: The function in which you would like to check the bound key examples: - path: examples/getKeyBoundToFunction-1.lua description: /key command gives bounded key to our chat function side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string of the first key the function was bound to. + requires_review: true +server: + name: getKeyBoundToFunction + description: getKeyBoundToFunction allows retrieval of the first key bound to a + function. + parameters: + - name: thePlayer + type: player + description: The player you are checking the function bound to a key + - name: theFunction + type: function + description: The function in which you would like to check the bound key + examples: [] + returns: + values: + - type: string + name: value + description: Returns a string of the first key the function was bound to. + requires_review: true diff --git a/functions/Input/getKeyState.yaml b/functions/Input/getKeyState.yaml index d8f0e8ec..cca08e8f 100644 --- a/functions/Input/getKeyState.yaml +++ b/functions/Input/getKeyState.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetKeyState -client: +shared: name: getKeyState description: This function determines if a certain key is pressed or not. - parameters: [] + parameters: + - name: keyName + type: string + description: The name of the key you're checking state of. See Key names . examples: - path: examples/getKeyState-1.lua description: This clientside example prints a message when "p" is pressed, and a different one for the "control+p" combination. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the specified key is pressed, false if it isn't or + if an invalid key name is passed. + requires_review: true diff --git a/functions/Input/isCapsLockEnabled.yaml b/functions/Input/isCapsLockEnabled.yaml index e9c6666c..3d02ed57 100644 --- a/functions/Input/isCapsLockEnabled.yaml +++ b/functions/Input/isCapsLockEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsCapsLockEnabled -client: +shared: name: isCapsLockEnabled description: This function returns the state of the caps lock. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/isCapsLockEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if caps lock is toggled (on), false otherwise. + requires_review: true diff --git a/functions/Input/isControlEnabled.yaml b/functions/Input/isControlEnabled.yaml index 2cf65897..e05b8c05 100644 --- a/functions/Input/isControlEnabled.yaml +++ b/functions/Input/isControlEnabled.yaml @@ -1,12 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsControlEnabled +client: + name: isControlEnabled + description: Checks whether a GTA control is enabled or disabled for a certain player. + parameters: + - name: control + type: string + description: The control you wish to check. See control names for a list of possible + controls. + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if control is enabled, false otherwise. + requires_review: true server: name: isControlEnabled description: Checks whether a GTA control is enabled or disabled for a certain player. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish the control status of. + - name: control + type: string + description: The control you wish to check. See control names for a list of possible + controls. examples: - path: examples/isControlEnabled-1.lua description: This example uses a command handler to allow a player to toggle whether he can use vehicle weapons by disabling or enabling the primary and secondary vehicle fire keys. The command handler is trigged with 'toggleweapons' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if control is enabled, false otherwise. + requires_review: true diff --git a/functions/Input/isKeyBound.yaml b/functions/Input/isKeyBound.yaml index 0f61d029..46edb114 100644 --- a/functions/Input/isKeyBound.yaml +++ b/functions/Input/isKeyBound.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsKeyBound -server: +shared: name: isKeyBound description: This function can be used to find out if a key has already been bound. If you do not specify a keyState or handler, any instances of key being bound will cause isKeyBound to return true. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you're checking. + - name: key + type: string + description: The key you're checking. See Key names for a list of valid key names. + - name: keyState + type: string + description: 'Is the state of the key when it calls the function, Can be either: + "up": when the key is released "down": when the key is pressed' + - name: handler + type: function + description: The function you're checking against examples: - path: examples/isKeyBound-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the key is bound, false otherwise. + requires_review: true diff --git a/functions/Input/removeCommandHandler.yaml b/functions/Input/removeCommandHandler.yaml index 8f6680f4..4815f5d9 100644 --- a/functions/Input/removeCommandHandler.yaml +++ b/functions/Input/removeCommandHandler.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveCommandHandler -server: +shared: name: removeCommandHandler description: This function removes a command handler, that is one that has been added using [addCommandHandler](/wiki/AddCommandHandler "AddCommandHandler"). This function can only remove command handlers that were added by the resource that it is called in. - parameters: [] + parameters: + - name: commandName + type: string + description: the name of the command you wish to remove. + - name: handler + type: function + description: the specific handler function to remove. If not specified, all handler + functions for the command (from the calling resource) will be removed. This + argument is only available in the server. examples: - path: examples/removeCommandHandler-1.lua description: 'This example adds a command handler that briefly shows the position @@ -15,4 +23,10 @@ server: description: 'This example adds a command handler that briefly shows the position of ''huntedPlayer'', and removes the command handler when ''huntedPlayer'' dies:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the command handler was removed successfully, false + if the command doesn't exist. + requires_review: true diff --git a/functions/Input/setAnalogControlState.yaml b/functions/Input/setAnalogControlState.yaml index 087938d5..f087ad0b 100644 --- a/functions/Input/setAnalogControlState.yaml +++ b/functions/Input/setAnalogControlState.yaml @@ -1,10 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetAnalogControlState -client: +shared: name: setAnalogControlState description: This sets the analog control state of a control for the local player. To change the analog controls for a [ped](/wiki/Ped "Ped"), please use [setPedAnalogControlState](/wiki/SetPedAnalogControlState "SetPedAnalogControlState"). - parameters: [] + parameters: + - name: control + type: string + description: The control that you want to set the state of. See control names + for a list of possible controls. + - name: state + type: float + description: A float between 0 and 1 indicating the amount the control is pressed. + If no value is provided, the analog control is removed. + - name: forceOverrideNextFrame + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setAnalogControlState-1.lua description: This creates an/forwardscommand, which toggles yourforwardscontrol @@ -13,4 +25,9 @@ client: - path: examples/setAnalogControlState-2.lua description: This script invertes left and right vehicle steering for the player. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the control state was successfully set, false otherwise. + requires_review: true diff --git a/functions/Input/toggleAllControls.yaml b/functions/Input/toggleAllControls.yaml index 35124aa5..56d2c3cf 100644 --- a/functions/Input/toggleAllControls.yaml +++ b/functions/Input/toggleAllControls.yaml @@ -1,11 +1,60 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ToggleAllControls +client: + name: toggleAllControls + description: Enables or disables the use of all GTA controls for a specified player. + parameters: + - name: enabled + type: bool + description: A boolean value representing whether or not the controls will be + usable. + - name: gtaControls + type: bool + description: A boolean deciding whether the enabled parameter will affect GTA's + internal controls. + default: 'true' + - name: mtaControls + type: bool + description: A boolean deciding whether the enabled parameter will affect MTA's + own controls., e.g. chatbox. + default: 'true' + examples: [] + returns: + values: + - type: bool + name: value + description: This function returns true if controls were toggled successfully, + false otherwise. + requires_review: true server: name: toggleAllControls description: Enables or disables the use of all GTA controls for a specified player. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to toggle the control ability of. + - name: enabled + type: bool + description: A boolean value representing whether or not the controls will be + usable. + - name: gtaControls + type: bool + description: A boolean deciding whether the enabled parameter will affect GTA's + internal controls. + default: 'true' + - name: mtaControls + type: bool + description: A boolean deciding whether the enabled parameter will affect MTA's + own controls., e.g. chatbox. + default: 'true' examples: - path: examples/toggleAllControls-1.lua description: This function will disable the use of all controls in order to freeze a player, which will be used every time someone enters a vehicle. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns true if controls were toggled successfully, + false otherwise. + requires_review: true diff --git a/functions/Input/toggleControl.yaml b/functions/Input/toggleControl.yaml index c30a9129..9e9904b3 100644 --- a/functions/Input/toggleControl.yaml +++ b/functions/Input/toggleControl.yaml @@ -1,19 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ToggleControl -server: +client: name: toggleControl description: Enables or disables the use of a GTA control for a specific player. - parameters: [] + parameters: + - name: control + type: string + description: The control that you want to toggle the ability of. See control names + for a list of possible controls. + - name: enabled + type: bool + description: A boolean value representing whether or not the key will be usable + or not. examples: - - path: examples/toggleControl-1.lua - description: This function will disable the use of the vehicle secondary-fire - key for anyone in a Hydra, consequently removing the ability to fire rockets. - side: server - path: examples/toggleControl-2.lua description: This function will disable the use of the vehicle secondary-fire key for anyone in a Hydra, consequently removing the ability to fire rockets. side: client - notes: + returns: + values: + - type: bool + name: value + description: This function true if the control was set successfully, false otherwise. + notes: &id001 - type: info content: If you want to disable weapons fire, remember to also disable the control action in addition to the control fire . - incomplete: true + requires_review: true +server: + name: toggleControl + description: Enables or disables the use of a GTA control for a specific player. + parameters: + - name: thePlayer + type: player + description: The player you wish to toggle the control ability of. + - name: control + type: string + description: The control that you want to toggle the ability of. See control names + for a list of possible controls. + - name: enabled + type: bool + description: A boolean value representing whether or not the key will be usable + or not. + examples: + - path: examples/toggleControl-1.lua + description: This function will disable the use of the vehicle secondary-fire + key for anyone in a Hydra, consequently removing the ability to fire rockets. + side: server + returns: + values: + - type: bool + name: value + description: This function true if the control was set successfully, false otherwise. + notes: *id001 + requires_review: true diff --git a/functions/Input/unbindKey.yaml b/functions/Input/unbindKey.yaml index 32aa05a1..7fbe9637 100644 --- a/functions/Input/unbindKey.yaml +++ b/functions/Input/unbindKey.yaml @@ -1,19 +1,61 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UnbindKey +client: + name: unbindKey + description: Removes an existing key bind from the specified player. + parameters: + - name: key + type: string + description: The key you wish to unbind. See Key names for a list of valid key + names. + - name: keyState + type: string + description: is optional in Syntax 2. + - name: command + type: string + description: MISSING_PARAM_DESC + examples: [] + returns: + values: + - type: bool + name: value + description: Returns ' true if the key was unbound, false if it was not previously + bound or invalid arguments were passed to the function. + notes: &id001 + - type: info + content: unbindKey will only work on binds that were added by the same resource + - type: info + content: unbindKey on the server may return true on failure + - type: info + content: 'If you call unbindKey twice, it will break other scripts: Issue 497' + requires_review: true server: name: unbindKey description: Removes an existing key bind from the specified player. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to unbind the key of. + - name: key + type: string + description: The key you wish to unbind. See Key names for a list of valid key + names. + - name: keyState + type: string + description: is optional in Syntax 2. + - name: command + type: string + description: MISSING_PARAM_DESC examples: - path: examples/unbindKey-1.lua description: This function binds the player'sF1key to a functiongoMoowhich outputs a chat message when pressed. The key is then unbound so that it can effectively only be used once per life. side: server - notes: - - type: info - content: unbindKey will only work on binds that were added by the same resource - - type: info - content: unbindKey on the server may return true on failure - - type: info - content: 'If you call unbindKey twice, it will break other scripts: Issue 497' - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns ' true if the key was unbound, false if it was not previously + bound or invalid arguments were passed to the function. + notes: *id001 + requires_review: true diff --git a/functions/Light/createLight.yaml b/functions/Light/createLight.yaml index daadfc08..6a78baf2 100644 --- a/functions/Light/createLight.yaml +++ b/functions/Light/createLight.yaml @@ -1,14 +1,71 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateLight -client: +shared: name: createLight description: This function creates a 3D [light](/wiki/Element/Light "Element/Light") in the world. - parameters: [] + parameters: + - name: lightType + type: int + description: 'An integer representing the type of light to create. 0 : Point light, + which illuminates surroundings evenly across the light radius. 1 : Spot light, + which illuminates the direction of the light defined by dirX , dirY and dirZ + . 2 : Dark light, which darkens its surrounding elements to full black.' + - name: posX + type: float + description: A floating point number representing the X coordinate on the map. + - name: posY + type: float + description: A floating point number representing the Y coordinate on the map. + - name: posZ + type: float + description: A floating point number representing the Z coordinate on the map. + - name: radius + type: float + description: A floating point number representing the radius of the light. + default: '3' + - name: r + type: int + description: An integer number representing the amount of red to use in the colouring + of the light (0 - 255). + default: '255' + - name: g + type: int + description: An integer number representing the amount of green to use in the + colouring of the light (0 - 255). + default: '0' + - name: b + type: int + description: An integer number representing the amount of blue to use in the colouring + of the light (0 - 255). + default: '0' + - name: dirX + type: float + description: A floating point number representing the light direction's X coordinate + on the map. + default: '0' + - name: dirY + type: float + description: A floating point number representing the light direction's Y coordinate + on the map. + default: '0' + - name: dirZ + type: float + description: A floating point number representing the light direction's Z coordinate + on the map. + default: '0' examples: - path: examples/createLight-1.lua description: This example will make every player to look completely black without using shaders. It will also dark vehicles he uses too. side: client + returns: + values: + - type: light + name: value + description: Returns the light element if creation was successful, false otherwise. + oop: + element: light + constructorclass: Light notes: - type: info content: The direction of the light only has any effect if the light type is spot @@ -16,4 +73,4 @@ client: and number plates (like a emergency vehicle siren light does). Two or more lights will apply illumination effects to everything (excluding objects) that is in range of, at least, two of them. - incomplete: true + requires_review: true diff --git a/functions/Light/getLightColor.yaml b/functions/Light/getLightColor.yaml index 794ae7b8..ee67a3ce 100644 --- a/functions/Light/getLightColor.yaml +++ b/functions/Light/getLightColor.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLightColor -client: +shared: name: getLightColor description: This function returns the color for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to retrieve the color of. examples: - path: examples/getLightColor-1.lua description: '' side: client + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: Returns three ints corresponding to the amount of red, green and + blue (respectively) of the light, false if invalid arguments were passed. + oop: + element: light + method: getColor + variable: color + static: false pair: setLightColor - incomplete: true + requires_review: true diff --git a/functions/Light/getLightDirection.yaml b/functions/Light/getLightDirection.yaml index 53fe5530..68ab20f6 100644 --- a/functions/Light/getLightDirection.yaml +++ b/functions/Light/getLightDirection.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLightDirection -client: +shared: name: getLightDirection description: This function returns the direction for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to retrieve the direction of. examples: - path: examples/getLightDirection-1.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three ints corresponding to the x, y and z coordinates (respectively) + of the light direction, false if invalid arguments were passed. + oop: + element: light + method: getDirection + variable: direction + static: false pair: setLightDirection - incomplete: true + requires_review: true diff --git a/functions/Light/getLightRadius.yaml b/functions/Light/getLightRadius.yaml index d14d863f..deb34691 100644 --- a/functions/Light/getLightRadius.yaml +++ b/functions/Light/getLightRadius.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLightRadius -client: +shared: name: getLightRadius description: This function returns the radius for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to retrieve the radius of. examples: - path: examples/getLightRadius-1.lua description: '' side: client + returns: + values: + - type: float + name: value + description: Returns a float containing the radius of the specified light, false + if invalid arguments were passed. + oop: + element: light + method: getRadius + variable: radius + static: false pair: setLightRadius - incomplete: true + requires_review: true diff --git a/functions/Light/getLightType.yaml b/functions/Light/getLightType.yaml index 74120cf6..99e52f2b 100644 --- a/functions/Light/getLightType.yaml +++ b/functions/Light/getLightType.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLightType -client: +shared: name: getLightType description: This function returns the type for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to retrieve the type of. examples: - path: examples/getLightType-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int containing the type of the specified light, false + if invalid arguments were passed. + oop: + element: light + method: getType + static: false + requires_review: true diff --git a/functions/Light/setLightColor.yaml b/functions/Light/setLightColor.yaml index 89cb024f..dcb67140 100644 --- a/functions/Light/setLightColor.yaml +++ b/functions/Light/setLightColor.yaml @@ -1,12 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetLightColor -client: +shared: name: setLightColor description: This function sets the color for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to set the color of. + - name: r + type: float + description: MISSING_PARAM_DESC + - name: g + type: float + description: MISSING_PARAM_DESC + - name: b + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setLightColor-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: light + method: setColor + variable: color + static: false pair: getLightColor - incomplete: true + requires_review: true diff --git a/functions/Light/setLightDirection.yaml b/functions/Light/setLightDirection.yaml index bc035928..7aa86984 100644 --- a/functions/Light/setLightDirection.yaml +++ b/functions/Light/setLightDirection.yaml @@ -1,12 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetLightDirection -client: +shared: name: setLightDirection description: This function sets the direction for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to set the direction of. + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setLightDirection-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: light + method: setDirection + variable: direction + static: false pair: getLightDirection - incomplete: true + requires_review: true diff --git a/functions/Light/setLightRadius.yaml b/functions/Light/setLightRadius.yaml index 563e5c1e..ce3aef6c 100644 --- a/functions/Light/setLightRadius.yaml +++ b/functions/Light/setLightRadius.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetLightRadius -client: +shared: name: setLightRadius description: This function sets the radius for a [light](/wiki/Element/Light "Element/Light") element. - parameters: [] + parameters: + - name: theLight + type: light + description: The light that you wish to set the radius of. + - name: radius + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setLightRadius-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: light + method: setRadius + variable: radius + static: false pair: getLightRadius - incomplete: true + requires_review: true diff --git a/functions/Map/loadMapData.yaml b/functions/Map/loadMapData.yaml index 634ac841..402a4f69 100644 --- a/functions/Map/loadMapData.yaml +++ b/functions/Map/loadMapData.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/LoadMapData -server: +shared: name: loadMapData description: This function is intended to load data from a loaded XML file into the element tree. This could be used for loading an external map, or part of another map. - parameters: [] + parameters: + - name: node + type: xmlnode + description: The node that you wish to load into the element tree . + - name: parent + type: element + description: The node you wish to be the parent of the new map data. examples: - path: examples/loadMapData-1.lua description: Example 1:This example is a function that you could use to load an @@ -14,4 +20,11 @@ server: description: Example 2:This example will destroy the loaded map data after 30 seconds. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element object that corresponds to the root of the new + data added, i.e. an element that represents the node xmlnode passed to the function. + Returns false if the arguments are invalid. + requires_review: true diff --git a/functions/Map/resetMapInfo.yaml b/functions/Map/resetMapInfo.yaml index b79dbf1e..a71ac367 100644 --- a/functions/Map/resetMapInfo.yaml +++ b/functions/Map/resetMapInfo.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetMapInfo -server: +shared: name: resetMapInfo description: This function is used to reset the state of a player. It is intended to restore a player to his default state as if he had just joined the server, without any scripts affecting him. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The specific player you wish to restore the state of. Not specifying + this will result in all players map info being reset. + default: root examples: - path: examples/resetMapInfo-1.lua description: This will reset all map info when the resource is stopped. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the map info was reset successfully, otherwise false + . + requires_review: true diff --git a/functions/Map/saveMapData.yaml b/functions/Map/saveMapData.yaml index 66c1e321..55968dcb 100644 --- a/functions/Map/saveMapData.yaml +++ b/functions/Map/saveMapData.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SaveMapData -server: +shared: name: saveMapData description: This converts a set of elements in the element tree into XML. This is a format that can then be loaded as a map file. Each element represents a single XML node. - parameters: [] + parameters: + - name: node + type: xmlnode + description: An existing node that should contain the contents of baseElement + - name: baseElement + type: element + description: The first element to output to the XML tree. This element and all + its children (and their children, etc) will be output. + - name: childrenOnly + type: bool + description: Defines if you want to only save children of the specified element. + default: 'false' examples: - path: examples/saveMapData-1.lua description: Saving your resource's data to anmap file(untested) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Saving your resource's data to an map file (untested) + requires_review: true diff --git a/functions/Marker/createMarker.yaml b/functions/Marker/createMarker.yaml index cce7a337..fec60f23 100644 --- a/functions/Marker/createMarker.yaml +++ b/functions/Marker/createMarker.yaml @@ -1,16 +1,70 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateMarker -server: +client: name: createMarker description: This function creates a marker. A marker is a 3D model in the world that can highlight a particular point or area, often used to instruct players where to go to perform actions such as entering buildings. - parameters: [] - examples: - - path: examples/createMarker-1.lua - description: 'This example creates a marker next to the player when they type - ''createmarker'':' - side: server - notes: + parameters: + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: theType + type: string + description: 'The visual type of the marker to be created. Possible values: "checkpoint" + : A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints + snap to ground and become invisible after going over a certain Z height. "ring" + : Doughnut shaped ring, normally used for aircraft. "cylinder" : Small glowing + ground ring. These are the glow markers you walk into to activate missions or + events in single player. "arrow" : Arrow pointing down. These are the arrows + on the doors you can enter in single player, except MTA''s are not animated + by default. "corona" : A glowing ball of light.' + default: '"checkpoint"' + - name: size + type: float + description: The diameter of the marker to be created, in meters. + default: '4.0' + - name: r + type: int + description: An integer number representing the amount of red to use in the colouring + of the marker (0 - 255). + default: '0' + - name: g + type: int + description: An integer number representing the amount of green to use in the + colouring of the marker (0 - 255). + default: '0' + - name: b + type: int + description: An integer number representing the amount of blue to use in the colouring + of the marker (0 - 255). + default: '255' + - name: a + type: int + description: An integer number representing the amount of alpha to use in the + colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque). + default: '255' + - name: ignoreAlphaLimits + type: bool + description: MISSING_PARAM_DESC + default: 'false' + examples: [] + returns: + values: + - type: marker + name: value + description: Returns the marker element that was created, or false if the arguments + are incorrect. + oop: &id001 + element: Marker( + method: '' + static: true + notes: &id002 - type: warning content: When using type "arrow" markers, you may experience positioning issues. This is a known issue with how GTA creates these types of markers. It is recommended @@ -19,4 +73,38 @@ server: content: '"cylinder" marker type doesn''t have the same size for collisions and visible textures. Note that the marker collisions are around 10-20% bigger than the visible texture.' - incomplete: true + requires_review: true +server: + name: createMarker + description: This function creates a marker. A marker is a 3D model in the world + that can highlight a particular point or area, often used to instruct players + where to go to perform actions such as entering buildings. + parameters: + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: string theType + type: '[,' + description: MISSING_PARAM_DESC + default: '"checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int + a = 255, element visibleTo = getRootElement(' + examples: + - path: examples/createMarker-1.lua + description: 'This example creates a marker next to the player when they type + ''createmarker'':' + side: server + returns: + values: + - type: marker + name: value + description: Returns the marker element that was created, or false if the arguments + are incorrect. + oop: *id001 + notes: *id002 + requires_review: true diff --git a/functions/Marker/getMarkerColor.yaml b/functions/Marker/getMarkerColor.yaml index 5f5dc822..62e817d6 100644 --- a/functions/Marker/getMarkerColor.yaml +++ b/functions/Marker/getMarkerColor.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerColor -server: +shared: name: getMarkerColor description: This function returns the color and transparency for a marker element. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker that you wish to retrieve the color of. examples: - path: examples/getMarkerColor-1.lua description: This example script fully heals players who hit a white marker, and kills players who hit a red one. side: server + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: Returns four ints corresponding to the amount of red , green , blue + and alpha (respectively) of the marker, false if invalid arguments were passed. + oop: + element: marker + method: getColor + static: false pair: setMarkerColor - incomplete: true + requires_review: true diff --git a/functions/Marker/getMarkerCount.yaml b/functions/Marker/getMarkerCount.yaml index 0452f930..36c93e58 100644 --- a/functions/Marker/getMarkerCount.yaml +++ b/functions/Marker/getMarkerCount.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerCount -server: +shared: name: getMarkerCount description: Returns the number of markers that currently exist in the world. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/getMarkerCount-1.lua description: This example outputs the amount of markers to the player. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the number of markers that currently exist. + requires_review: true diff --git a/functions/Marker/getMarkerIcon.yaml b/functions/Marker/getMarkerIcon.yaml index 30bc0e37..39de4178 100644 --- a/functions/Marker/getMarkerIcon.yaml +++ b/functions/Marker/getMarkerIcon.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerIcon -server: +shared: name: getMarkerIcon description: This function returns the icon name for a marker. - parameters: [] + parameters: + - name: theMarker + type: marker + description: A marker element referencing the specified marker. examples: - path: examples/getMarkerIcon-1.lua description: '' side: server + returns: + values: + - type: string + name: value + description: 'Returns false if the marker passed is invalid or a string containing + one of the following:' + oop: + element: marker + method: getIcon + variable: icon + static: false pair: setMarkerIcon - incomplete: true + requires_review: true diff --git a/functions/Marker/getMarkerSize.yaml b/functions/Marker/getMarkerSize.yaml index 7a860fd9..42daf066 100644 --- a/functions/Marker/getMarkerSize.yaml +++ b/functions/Marker/getMarkerSize.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerSize -server: +shared: name: getMarkerSize description: This function returns a [float](/wiki/Float "Float") containing the size of the specified marker. - parameters: [] + parameters: + - name: myMarker + type: marker + description: The marker that you wish to retrieve the size of. examples: - path: examples/getMarkerSize-1.lua description: This example creates a marker and outputs the size to everyone. side: server + returns: + values: + - type: float + name: value + description: Returns a float containing the size of the specified marker. + oop: + element: marker + method: getSize + variable: size + static: false pair: setMarkerSize - incomplete: true + requires_review: true diff --git a/functions/Marker/getMarkerTarget.yaml b/functions/Marker/getMarkerTarget.yaml index 2ec876d7..53de8f8d 100644 --- a/functions/Marker/getMarkerTarget.yaml +++ b/functions/Marker/getMarkerTarget.yaml @@ -1,15 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerTarget -server: +shared: name: getMarkerTarget description: This function returns the position of the specified marker's target, the position it points to. This only works for checkpoint markers and ring markers. For checkpoints it returns the position the arrow is pointing to, for ring markers it returns the position the ring is facing. You can set this target with [setMarkerTarget](/wiki/SetMarkerTarget "SetMarkerTarget"). - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker you wish to retrieve the target position of. examples: - path: examples/getMarkerTarget-1.lua description: '' side: server + returns: + values: + - type: float float float + name: value + description: Returns three float s if a target is set, or false in the first variable + and nil in the two others if the marker is invalid or no target is set. + oop: + element: marker + method: getTarget + variable: target + static: false pair: setMarkerTarget - incomplete: true + requires_review: true diff --git a/functions/Marker/getMarkerTargetArrowProperties.yaml b/functions/Marker/getMarkerTargetArrowProperties.yaml index 2bc1c575..619db9e7 100644 --- a/functions/Marker/getMarkerTargetArrowProperties.yaml +++ b/functions/Marker/getMarkerTargetArrowProperties.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerTargetArrowProperties -server: +shared: name: getMarkerTargetArrowProperties description: function returns the color, transparency and size for a checkpoint marker's target arrow. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker that you wish to retrieve the color and size of. examples: - path: examples/getMarkerTargetArrowProperties-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + description: Returns five ints corresponding to the amount of red , green , blue + , alpha and size of the marker's target arrow, false if invalid arguments were + passed. + requires_review: true diff --git a/functions/Marker/getMarkerType.yaml b/functions/Marker/getMarkerType.yaml index a0241abc..6589bb76 100644 --- a/functions/Marker/getMarkerType.yaml +++ b/functions/Marker/getMarkerType.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMarkerType -server: +shared: name: getMarkerType description: This function returns a marker's type. - parameters: [] + parameters: + - name: theMarker + type: marker + description: A marker element referencing the specified marker. examples: - path: examples/getMarkerType-1.lua description: This function creates a default marker at a given position and outputs its type. side: server + returns: + values: + - type: string + name: value + description: If an invalid marker is specified, false is returned. + oop: + element: marker + method: getMarkerType + variable: markerType + static: false pair: setMarkerType - incomplete: true + requires_review: true diff --git a/functions/Marker/isCoronaReflectionEnabled.yaml b/functions/Marker/isCoronaReflectionEnabled.yaml index ece8ddc4..2f01927d 100644 --- a/functions/Marker/isCoronaReflectionEnabled.yaml +++ b/functions/Marker/isCoronaReflectionEnabled.yaml @@ -1,8 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsCoronaReflectionEnabled -client: +shared: name: isCoronaReflectionEnabled description: This function gets visibility of corona reflection. - parameters: [] + parameters: + - name: theMarker + type: marker + description: marker examples: [] + returns: + values: + - type: bool + name: value + oop: + element: marker + method: isCoronaReflectionEnabled + static: false pair: setCoronaReflectionEnabled - incomplete: true + requires_review: true diff --git a/functions/Marker/setCoronaReflectionEnabled.yaml b/functions/Marker/setCoronaReflectionEnabled.yaml index c6a45550..66d956f6 100644 --- a/functions/Marker/setCoronaReflectionEnabled.yaml +++ b/functions/Marker/setCoronaReflectionEnabled.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCoronaReflectionEnabled -client: +shared: name: setCoronaReflectionEnabled description: This function sets visibility of corona reflection. - parameters: [] + parameters: + - name: theMarker + type: marker + description: the corona marker that you wish set visibility of corona reflection + - name: enabled + type: bool + description: whenever corona reflection should be visible examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if marker type is corona , false otherwise. + oop: + element: marker + method: setCoronaReflectionEnabled + static: false pair: isCoronaReflectionEnabled issues: - - id: '2755' + - id: 2755 description: Corona reflections do not render on custom placed objects - - id: '2750' + - id: 2750 description: Corona reflections do not render on all roads - incomplete: true + requires_review: true diff --git a/functions/Marker/setMarkerColor.yaml b/functions/Marker/setMarkerColor.yaml index 9d009af7..967a2a46 100644 --- a/functions/Marker/setMarkerColor.yaml +++ b/functions/Marker/setMarkerColor.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerColor -server: +shared: name: setMarkerColor description: This function sets the color of the specified marker by modifying the values for red, green, blue and alpha. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker that you wish to set the color of. + - name: r + type: int + description: The amount of red in the final color (0 to 255). + - name: g + type: int + description: The amount of green in the final color (0 to 255). + - name: b + type: int + description: The amount of blue in the final color (0 to 255). + - name: a + type: int + description: The amount of alpha in the final color (0 to 255). examples: - path: examples/setMarkerColor-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + oop: + element: marker + method: setColor + static: false pair: getMarkerColor - incomplete: true + requires_review: true diff --git a/functions/Marker/setMarkerIcon.yaml b/functions/Marker/setMarkerIcon.yaml index b1091fe6..5315ceca 100644 --- a/functions/Marker/setMarkerIcon.yaml +++ b/functions/Marker/setMarkerIcon.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerIcon -server: +shared: name: setMarkerIcon description: This function allows changing the icon of a checkpoint marker. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker to change the visual style of + - name: icon + type: string + description: 'A string referring to the type of icon, acceptable values are: "none" + : No icon "arrow" : Arrow icon. Only 5 arrows can be visible at the same time. + "finish" : Finish icon (at end of race)' examples: - path: examples/setMarkerIcon-1.lua description: This example creates a finish marker as you'd expect for the end of a race. side: server + returns: + values: + - type: bool + name: value + oop: + element: marker + method: setIcon + variable: icon + static: false pair: getMarkerIcon - incomplete: true + requires_review: true diff --git a/functions/Marker/setMarkerSize.yaml b/functions/Marker/setMarkerSize.yaml index a11f45ed..4dffb223 100644 --- a/functions/Marker/setMarkerSize.yaml +++ b/functions/Marker/setMarkerSize.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerSize -server: +shared: name: setMarkerSize description: This function sets the size of the specified marker. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker that you wish to set the size of. + - name: size + type: float + description: A float representing new size of the marker. examples: - path: examples/setMarkerSize-1.lua description: This example creates a cylinder marker at the position 0, 0, 2 and @@ -12,8 +18,17 @@ server: description: This example creates a cylinder marker at the position 0, 0, 2 and plus its size by1by using 'getMarkerSize'. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false if failed. + oop: + element: marker + method: setSize + variable: size + static: false pair: getMarkerSize - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -23,3 +38,4 @@ server: - Missing section: Server ' + requires_review: true diff --git a/functions/Marker/setMarkerTarget.yaml b/functions/Marker/setMarkerTarget.yaml index 0e7fcb5b..e63731e0 100644 --- a/functions/Marker/setMarkerTarget.yaml +++ b/functions/Marker/setMarkerTarget.yaml @@ -1,12 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerTarget -server: +shared: name: setMarkerTarget description: This function sets the 'target' for a marker. Only the *checkpoint* and *ring* marker types can have a target. - parameters: [] + parameters: + - name: theMarker + type: marker + description: The marker to set the target of + - name: x + type: float + description: The x axis of the coordinate to target the marker at + - name: "y" + type: float + description: The y axis of the coordinate to target the marker at + - name: z + type: float + description: The z axis of the coordinate to target the marker at examples: - path: examples/setMarkerTarget-1.lua description: Creates a marker in the center of the map and points it north. side: server + returns: + values: + - type: bool + name: value + description: Returns true if target was set, false otherwise. + oop: + element: marker + method: setTarget + variable: target + static: false pair: getMarkerTarget - incomplete: true + requires_review: true diff --git a/functions/Marker/setMarkerTargetArrowProperties.yaml b/functions/Marker/setMarkerTargetArrowProperties.yaml index 44096cb8..6fa7270f 100644 --- a/functions/Marker/setMarkerTargetArrowProperties.yaml +++ b/functions/Marker/setMarkerTargetArrowProperties.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerTargetArrowProperties -server: +shared: name: setMarkerTargetArrowProperties description: This function changes the color and size of the checkpoint marker's target arrow. - parameters: [] + parameters: + - name: marker + type: element + description: MISSING_PARAM_DESC + - name: r + type: int + description: The amount of red in the final color (0 to 255). + default: '255' + - name: g + type: int + description: The amount of green in the final color (0 to 255). + default: '64' + - name: b + type: int + description: The amount of blue in the final color (0 to 255). + default: '64' + - name: a + type: int + description: The amount of alpha in the final color (0 to 255). + default: '255' + - name: size + type: float + description: Target arrow size. + default: markerSize * 0.625 examples: - path: examples/setMarkerTargetArrowProperties-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + requires_review: true diff --git a/functions/Marker/setMarkerType.yaml b/functions/Marker/setMarkerType.yaml index 7ba3579c..4400253d 100644 --- a/functions/Marker/setMarkerType.yaml +++ b/functions/Marker/setMarkerType.yaml @@ -1,16 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMarkerType -server: +shared: name: setMarkerType description: This function changes a marker's type. The type controls how the marker is displayed in the game. It's important that you use marker types that users are used to from the single player game. For example, checkpoints are used in races, rings are used for aircraft races, arrows are used for entering buildings etc. - parameters: [] + parameters: + - name: theMarker + type: marker + description: A marker element referencing the specified marker. + - name: markerType + type: string + description: 'A string denoting the marker type. Valid values are: "checkpoint" + : A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints + snap to ground and become invisible after going over a certain Z height. "ring" + : Doughnut shaped ring, normally used for aircraft. "cylinder" : Small glowing + ground ring. These are the glow markers you walk into to activate missions or + events in single player. "arrow" : Arrow pointing down. These are the arrows + on the doors you can enter in single player, except MTA''s are not animated + by default. "corona" : A glowing ball of light.' examples: - path: examples/setMarkerType-1.lua description: This function changes all existing markers' type to the specified one. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the marker type was changed, false if it wasn't or + marker values were invalid. + oop: + element: marker + method: setMarkerType + variable: markerType + static: false pair: getMarkerType - incomplete: true + requires_review: true diff --git a/functions/Module/getLoadedModules.yaml b/functions/Module/getLoadedModules.yaml index 9a27b74c..1b3053b0 100644 --- a/functions/Module/getLoadedModules.yaml +++ b/functions/Module/getLoadedModules.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLoadedModules -server: +shared: name: getLoadedModules description: This function returns all the currently loaded [modules](/wiki/Modules "Modules") of the server. @@ -8,4 +8,10 @@ server: - path: examples/getLoadedModules-1.lua description: Adds a command that lists all loaded modules in the server log. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the currently loaded modules . If no modules + are loaded, the table will be empty. + requires_review: true diff --git a/functions/Module/getModuleInfo.yaml b/functions/Module/getModuleInfo.yaml index ae805d51..794cfc56 100644 --- a/functions/Module/getModuleInfo.yaml +++ b/functions/Module/getModuleInfo.yaml @@ -1,12 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetModuleInfo -server: +shared: name: getModuleInfo description: This function returns information about the specified [module](/wiki/Modules "Modules"). - parameters: [] + parameters: + - name: moduleName + type: string + description: A string containing the module you wish to get information of e.g. + "hashing.dll" examples: - path: examples/getModuleInfo-1.lua description: This example adds a commandcheckmoduleswith which you can view information about currently loaded modules. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table containing information about module. These keys + are present in the table:' + requires_review: true diff --git a/functions/Object/breakObject.yaml b/functions/Object/breakObject.yaml index 26cc21f1..3a5a383c 100644 --- a/functions/Object/breakObject.yaml +++ b/functions/Object/breakObject.yaml @@ -1,14 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BreakObject -server: +shared: name: breakObject description: This function breaks a specific object. - parameters: [] + parameters: + - name: theObject + type: object + description: an object element examples: - path: examples/breakObject-1.lua description: This example checks if the object created is breakable and if it is then breaks it. side: server + returns: + values: + - type: bool + name: value + description: This example checks if the object created is breakable and if it + is then breaks it. + oop: + element: object + method: break + static: false notes: - type: info content: Only breakable objects can be broken. - incomplete: true + requires_review: true diff --git a/functions/Object/createObject.yaml b/functions/Object/createObject.yaml index 9b52c14e..621ba927 100644 --- a/functions/Object/createObject.yaml +++ b/functions/Object/createObject.yaml @@ -1,9 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateObject -server: +shared: name: createObject description: Creates an [object](/wiki/Object "Object") [element](/wiki/Element "Element") at a given position and rotation. - parameters: [] + parameters: + - name: modelId + type: int + description: A whole integer specifying the GTA:SA object model ID. See Object + IDs for a list of model IDs. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rx + type: float + description: A floating point number representing the rotation about the X axis + in degrees. + - name: ry + type: float + description: A floating point number representing the rotation about the Y axis + in degrees. + - name: rz + type: float + description: A floating point number representing the rotation about the Z axis + in degrees. + - name: isLowLOD + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/createObject-1.lua description: This example shows you how to automatically create an object or building @@ -16,11 +45,17 @@ server: description: 'This example creates an object near the player who write /createObject in the chat:' side: server + returns: + values: + - type: object + name: value + oop: + element: object + constructorclass: Object notes: - type: info content: Dynamic objects do not automatically have physics applied to them. Use setElementVelocity (object, 0, 0, 0) to fix this. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -28,3 +63,4 @@ server: - Missing section: Important info aboutObjects ' + requires_review: true diff --git a/functions/Object/getObjectMass.yaml b/functions/Object/getObjectMass.yaml index 956e2401..449a3604 100644 --- a/functions/Object/getObjectMass.yaml +++ b/functions/Object/getObjectMass.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetObjectMass -client: +shared: name: getObjectMass description: This function returns the mass of a specified object. - parameters: [] + parameters: + - name: theObject + type: object + description: the object whose mass you want to get. examples: - path: examples/getObjectMass-1.lua description: This script basically creates an object then get's the mass and set's its mass 300 more than it's original mass, then tell the client the old and new mass of the object. side: client + returns: + values: + - type: float + name: value + description: This script basically creates an object then get's the mass and set's + its mass 300 more than it's original mass, then tell the client the old and + new mass of the object. + oop: + element: object + method: getMass + variable: mass + static: false pair: setObjectMass - incomplete: true + requires_review: true diff --git a/functions/Object/getObjectProperty.yaml b/functions/Object/getObjectProperty.yaml index d979db90..54f87f28 100644 --- a/functions/Object/getObjectProperty.yaml +++ b/functions/Object/getObjectProperty.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetObjectProperty -client: +shared: name: getObjectProperty description: This function gets a property of the specified [object](/wiki/Object "Object"). - parameters: [] + parameters: + - name: theObject + type: object + description: the object you wish to get a property of. + - name: property + type: string + description: 'the property you want to get the value of:' examples: - path: examples/getObjectProperty-1.lua description: '' side: client + returns: + values: + - type: mixed + name: value + description: 'On success: table for all , 3 floats for center_of_mass or float + for other properties' + oop: + element: object + method: getProperty + static: false pair: setProperty - incomplete: true + requires_review: true diff --git a/functions/Object/getObjectScale.yaml b/functions/Object/getObjectScale.yaml index bca30f77..bf9f664c 100644 --- a/functions/Object/getObjectScale.yaml +++ b/functions/Object/getObjectScale.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetObjectScale -server: +shared: name: getObjectScale description: This function returns the visible size of an object. - parameters: [] + parameters: + - name: theObject + type: object + description: the object you wish to return the scale of. examples: - path: examples/getObjectScale-1.lua description: This example adds a command namedgetscalewhich creates an object and prints out the scale of it. side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + oop: + element: object + method: getScale + variable: scale + static: false pair: setObjectScale - incomplete: true + requires_review: true diff --git a/functions/Object/isObjectBreakable.yaml b/functions/Object/isObjectBreakable.yaml index e5d310e9..3f93757a 100644 --- a/functions/Object/isObjectBreakable.yaml +++ b/functions/Object/isObjectBreakable.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsObjectBreakable -server: +shared: name: isObjectBreakable description: This function checks if an object / model ID is breakable. - parameters: [] + parameters: + - name: theObject / int modelId + type: object + description: MISSING_PARAM_DESC examples: - path: examples/isObjectBreakable-1.lua description: This example creates an object when the resource starts and checks if the object is breakable. side: server + returns: + values: + - type: bool + name: value + description: This example creates an object when the resource starts and checks + if the object is breakable. + oop: + element: object + method: isBreakable + variable: breakable + static: false pair: setObjectBreakable - incomplete: true + requires_review: true diff --git a/functions/Object/isObjectMoving.yaml b/functions/Object/isObjectMoving.yaml index 089cee07..ffd8ae64 100644 --- a/functions/Object/isObjectMoving.yaml +++ b/functions/Object/isObjectMoving.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsObjectMoving -server: +shared: name: isObjectMoving description: This function checks if an [object](/wiki/Object "Object") is moving. - parameters: [] + parameters: + - name: theObject + type: object + description: The object element . examples: - path: examples/isObjectMoving-1.lua description: 'This example creates an object when the resource starts and checks if the object is moving:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: 'This example creates an object when the resource starts and checks + if the object is moving:' + oop: + element: object + method: isMoving + variable: moving + static: false + requires_review: true diff --git a/functions/Object/isObjectRespawnable.yaml b/functions/Object/isObjectRespawnable.yaml index e0bc79b3..9387307d 100644 --- a/functions/Object/isObjectRespawnable.yaml +++ b/functions/Object/isObjectRespawnable.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsObjectRespawnable -server: +shared: name: isObjectRespawnable description: This function checks if the object has respawn enabled, which can be toggled using [toggleObjectRespawn](/wiki/ToggleObjectRespawn "ToggleObjectRespawn"). - parameters: [] + parameters: + - name: theObject + type: object + description: an object element. examples: - path: examples/isObjectRespawnable-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the object has respawning enabled, false otherwise. + oop: + element: object + method: isRespawnable + static: false + requires_review: true diff --git a/functions/Object/moveObject.yaml b/functions/Object/moveObject.yaml index 1a6e1037..859cfe65 100644 --- a/functions/Object/moveObject.yaml +++ b/functions/Object/moveObject.yaml @@ -1,9 +1,51 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/MoveObject -server: +shared: name: moveObject description: This function will smoothly move an object from its current position to a specified rotation and position. - parameters: [] + parameters: + - name: theObject + type: object + description: the object that will be moved. + - name: time + type: int + description: the time in milliseconds the object will arrive at the destination. + - name: targetx + type: float + description: the X value of the target position + - name: targety + type: float + description: the Y value of the target position + - name: targetz + type: float + description: the Z value of the target position + - name: moverx + type: float + description: the rotation along the X axis relative to its current rotation, which + is its starting angle. + - name: movery + type: float + description: the rotation along the Y axis relative to its current rotation, which + is its starting angle. + - name: moverz + type: float + description: the rotation along the Z axis relative to its current rotation, which + is its starting angle. + - name: strEasingType + type: string + description: the easing function to use for the interpolation (default is "Linear") + - name: fEasingPeriod + type: float + description: the period of the easing function (only some easing functions use + this parameter) + - name: fEasingAmplitude + type: float + description: the amplitude of the easing function (only some easing functions + use this parameter) + - name: fEasingOvershoot + type: float + description: the overshoot of the easing function (only some easing functions + use this parameter) examples: - path: examples/moveObject-1.lua description: Example 1:This example moves every object in the game up 100 units @@ -23,7 +65,15 @@ server: - path: examples/moveObject-4.lua description: Example 4:This example move a gate with easing. side: server + returns: + values: + - type: bool + name: value + oop: + element: object + method: move + static: false issues: - - id: '549' + - id: 549 description: Object rotation is wrong after moveObject serverside - incomplete: true + requires_review: true diff --git a/functions/Object/respawnObject.yaml b/functions/Object/respawnObject.yaml index b75378ed..c00a578b 100644 --- a/functions/Object/respawnObject.yaml +++ b/functions/Object/respawnObject.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RespawnObject -server: +shared: name: respawnObject description: This function respawns a specific object. - parameters: [] + parameters: + - name: theObject + type: object + description: an object element examples: - path: examples/respawnObject-1.lua description: This example prevents objects from despawning. When an object breaks, it gets respawned right away. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: This example prevents objects from despawning. When an object breaks, + it gets respawned right away. + oop: + element: object + method: respawn + static: false + requires_review: true diff --git a/functions/Object/setObjectBreakable.yaml b/functions/Object/setObjectBreakable.yaml index f2f13c18..413cc0f4 100644 --- a/functions/Object/setObjectBreakable.yaml +++ b/functions/Object/setObjectBreakable.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetObjectBreakable -server: +shared: name: setObjectBreakable description: This function sets an object to be breakable/unbreakable. - parameters: [] + parameters: + - name: theObject + type: object + description: MISSING_PARAM_DESC + - name: breakable + type: bool + description: '' examples: - path: examples/setObjectBreakable-1.lua description: This example creates an object when the resource starts and sets it to be breakable. side: server + returns: + values: + - type: bool + name: value + description: This example creates an object when the resource starts and sets + it to be breakable. + oop: + element: object + method: setBreakable + variable: breakable + static: false pair: isObjectBreakable - incomplete: true + requires_review: true diff --git a/functions/Object/setObjectMass.yaml b/functions/Object/setObjectMass.yaml index e5b09db5..4a51f6ef 100644 --- a/functions/Object/setObjectMass.yaml +++ b/functions/Object/setObjectMass.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetObjectMass -client: +shared: name: setObjectMass description: This function sets the mass of a specified object. Changing the mass leads to a different movement behavior for especially dynamic objects. - parameters: [] + parameters: + - name: theObject + type: object + description: the object whose mass will be set. + - name: mass + type: float + description: the new mass. examples: - path: examples/setObjectMass-1.lua description: This script basically creates an object then get's the mass and set's its mass 300 more than it's original mass, then tell the client the old and new mass of the object. side: client + returns: + values: + - type: bool + name: value + description: This script basically creates an object then get's the mass and set's + its mass 300 more than it's original mass, then tell the client the old and + new mass of the object. + oop: + element: object + method: setMass + variable: mass + static: false pair: getObjectMass - incomplete: true + requires_review: true diff --git a/functions/Object/setObjectProperty.yaml b/functions/Object/setObjectProperty.yaml index edec778f..9a1b5027 100644 --- a/functions/Object/setObjectProperty.yaml +++ b/functions/Object/setObjectProperty.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetObjectProperty -client: +shared: name: setObjectProperty description: This function sets a property of the specified [object](/wiki/Object "Object"). - parameters: [] + parameters: + - name: theObject + type: object + description: the object you wish to change a property of. + - name: property + type: string + description: 'the property you want to set the value of:' + - name: value + type: var + description: MISSING_PARAM_DESC examples: - path: examples/setObjectProperty-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the property was set successfully, false otherwise. + oop: + element: object + method: setProperty + static: false pair: getProperty - incomplete: true + requires_review: true diff --git a/functions/Object/setObjectScale.yaml b/functions/Object/setObjectScale.yaml index 1de543e7..1260a3d6 100644 --- a/functions/Object/setObjectScale.yaml +++ b/functions/Object/setObjectScale.yaml @@ -1,15 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetObjectScale -server: +shared: name: setObjectScale description: This function changes the visible size of an object. - parameters: [] + parameters: + - name: theObject + type: object + description: the object you wish to change the scale of. + - name: scale + type: float + description: a float containing the new scale. 1.0 is the standard scale, with + 0.5 being half the size and 2.0 being twice the size. If the scaleY is set, + this will be scaleX. + - name: scaleY + type: float + description: a float containing the new scale on the Y axis + default: scale + - name: scaleZ + type: float + description: a float containing the new scale on the Z axis + default: scale examples: - path: examples/setObjectScale-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: This example creates an antenna, and changes the size of it. + oop: + element: object + method: setScale + variable: scale + static: false pair: getObjectScale notes: - type: info content: setObjectScale does not affect the collision models for the object, as such is unsuitable for use for interaction with players, vehicles or other objects. - incomplete: true + requires_review: true diff --git a/functions/Object/stopObject.yaml b/functions/Object/stopObject.yaml index 04d8ff41..e2332379 100644 --- a/functions/Object/stopObject.yaml +++ b/functions/Object/stopObject.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/StopObject -server: +shared: name: stopObject description: This will allow you to stop an object that is currently moving. - parameters: [] + parameters: + - name: theObject + type: object + description: the object whose movement you wish to stop examples: - path: examples/stopObject-1.lua description: This will allow you to toggle the random movement of a staircase @@ -10,4 +13,16 @@ server: the stopObject command. This is achieved by using a "toggleobjectmove" command with a "on" or "off" parameter. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: This will allow you to toggle the random movement of a staircase + object model using a randomObjectMovement function and stop it immediately with + the stopObject command. This is achieved by using a "toggleobjectmove" command + with a "on" or "off" parameter. + oop: + element: object + method: stop + static: false + requires_review: true diff --git a/functions/Object/toggleObjectRespawn.yaml b/functions/Object/toggleObjectRespawn.yaml index 2a0b735d..7d9bd0fc 100644 --- a/functions/Object/toggleObjectRespawn.yaml +++ b/functions/Object/toggleObjectRespawn.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ToggleObjectRespawn -server: +shared: name: toggleObjectRespawn description: This function is used to toggle if an object should respawn after it got destroyed - parameters: [] + parameters: + - name: theObject + type: object + description: the object you want to toggle the respawn from + - name: respawn + type: bool + description: a bool denoting whether we want to enable ( true ) or disable ( false + ) respawning examples: - path: examples/toggleObjectRespawn-1.lua description: This example adds commandtosthat toggles respawn of all the objects. side: server + returns: + values: + - type: bool + name: value + description: This example adds command tos that toggles respawn of all the objects. + oop: + element: object + method: toggleRespawn + static: false notes: - type: info content: The object will be respawned when it is streamed - incomplete: true + requires_review: true diff --git a/functions/Output/clearChatBox.yaml b/functions/Output/clearChatBox.yaml index 588a75e6..a8b2ddbc 100644 --- a/functions/Output/clearChatBox.yaml +++ b/functions/Output/clearChatBox.yaml @@ -1,10 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ClearChatBox -server: +client: name: clearChatBox description: This function clears the chatbox. It does not clear the console (F8\) parameters: [] + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the player's chat was cleared successfully, false + otherwise. + requires_review: true +server: + name: clearChatBox + description: This function clears the chatbox. It does not clear the console (F8\) + parameters: + - name: element clearFor + type: '[' + description: MISSING_PARAM_DESC + default: getRootElement( examples: - path: examples/clearChatBox-1.lua description: This example adds an admin command to clear the chatbox for everyone side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the player's chat was cleared successfully, false + otherwise. + requires_review: true diff --git a/functions/Output/clearDebugBox.yaml b/functions/Output/clearDebugBox.yaml index ab77327f..2d727576 100644 --- a/functions/Output/clearDebugBox.yaml +++ b/functions/Output/clearDebugBox.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ClearDebugBox -client: +shared: name: clearDebugBox description: This function clears the debug box. parameters: [] @@ -8,4 +8,9 @@ client: description: 'This example clears the debug window when any new debug message is displayed:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/Output/isChatInputBlocked.yaml b/functions/Output/isChatInputBlocked.yaml index 485f04a2..22416051 100644 --- a/functions/Output/isChatInputBlocked.yaml +++ b/functions/Output/isChatInputBlocked.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsChatInputBlocked -client: +shared: name: isChatInputBlocked description: This function checks if the player's chat input is blocked. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/isChatInputBlocked-1.lua description: 'This example shows how to block and unblock the chat input:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the chat input is blocked, false otherwise. + requires_review: true diff --git a/functions/Output/isChatVisible.yaml b/functions/Output/isChatVisible.yaml index e2559819..684a0d45 100644 --- a/functions/Output/isChatVisible.yaml +++ b/functions/Output/isChatVisible.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsChatVisible -client: +shared: name: isChatVisible description: This function checks if player's chat is visible. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/isChatVisible-1.lua description: This example does the same thing asshowchatcommand does. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the chat is visible, false otherwise. + requires_review: true diff --git a/functions/Output/outputChatBox.yaml b/functions/Output/outputChatBox.yaml index d2744007..5e2a4a04 100644 --- a/functions/Output/outputChatBox.yaml +++ b/functions/Output/outputChatBox.yaml @@ -1,15 +1,82 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/OutputChatBox +client: + name: outputChatBox + description: This outputs the specified text string to the chatbox. It can be specified + as a message to certain player(s) or all players. + parameters: + - name: text + type: string + description: MISSING_PARAM_DESC + - name: r + type: int + description: MISSING_PARAM_DESC + default: '231' + - name: g + type: int + description: MISSING_PARAM_DESC + default: '217' + - name: b + type: int + description: MISSING_PARAM_DESC + default: '176' + - name: colorCoded + type: bool + description: MISSING_PARAM_DESC + default: 'false' + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the message was displayed successfully. Returns false + if invalid arguments are specified. + oop: &id001 + element: player + method: outputChat + static: false + notes: &id002 + - type: info + content: Avoid outputting text to the chatbox that isn't actually chat, as this + can be annoying for players. Output information and status messages to the HUD. + requires_review: true server: name: outputChatBox description: This outputs the specified text string to the chatbox. It can be specified as a message to certain player(s) or all players. - parameters: [] + parameters: + - name: text + type: string + description: MISSING_PARAM_DESC + - name: visibleTo + type: table/element + description: MISSING_PARAM_DESC + default: root + - name: r + type: int + description: MISSING_PARAM_DESC + default: '231' + - name: g + type: int + description: MISSING_PARAM_DESC + default: '217' + - name: b + type: int + description: MISSING_PARAM_DESC + default: '176' + - name: colorCoded + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/outputChatBox-1.lua description: Example 1:This example displays a chat message to all users. side: server - notes: - - type: info - content: Avoid outputting text to the chatbox that isn't actually chat, as this - can be annoying for players. Output information and status messages to the HUD. - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the message was displayed successfully. Returns false + if invalid arguments are specified. + oop: *id001 + notes: *id002 + requires_review: true diff --git a/functions/Output/outputConsole.yaml b/functions/Output/outputConsole.yaml index 70bf1eba..363cc9ac 100644 --- a/functions/Output/outputConsole.yaml +++ b/functions/Output/outputConsole.yaml @@ -1,15 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/OutputConsole -server: +client: name: outputConsole description: This outputs the specified text string to the console window (accessed with F8 or \~ key). It can be specified as a message to certain player(s) or all players. - parameters: [] - examples: - - path: examples/outputConsole-1.lua - description: '' - side: server - notes: + parameters: + - name: text + type: string + description: The text string that you wish to send to the console window + examples: [] + returns: + values: + - type: bool + name: value + notes: &id001 - type: info content: visibleTo can also be a Team object, in this case, the text will be visible to all the players of that team. @@ -17,4 +21,27 @@ server: content: The serverside function has a limitation of 1000 characters for the text parameter. Anything beyond 1000 characters is trimmed away. This limitation does not apply to the clientside version. - incomplete: true + requires_review: true +server: + name: outputConsole + description: This outputs the specified text string to the console window (accessed + with F8 or \~ key). It can be specified as a message to certain player(s) or all + players. + parameters: + - name: text + type: string + description: The text string that you wish to send to the console window + - name: element visibleTo + type: '[' + description: MISSING_PARAM_DESC + default: getRootElement( + examples: + - path: examples/outputConsole-1.lua + description: '' + side: server + returns: + values: + - type: bool + name: value + notes: *id001 + requires_review: true diff --git a/functions/Output/outputDebugString.yaml b/functions/Output/outputDebugString.yaml index 0353c064..6c6dba5b 100644 --- a/functions/Output/outputDebugString.yaml +++ b/functions/Output/outputDebugString.yaml @@ -1,16 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/OutputDebugString -server: +shared: name: outputDebugString description: This function outputs scripting debug messages, which can be read by enabling the debug textbox. The debug display level can then be set so that info or warning messages get filtered out. - parameters: [] + parameters: + - name: text + type: string + description: the text to be output to the debug box. + - name: level + type: int + description: 'the debug message level. Possible values are: 0: Debug message 1: + Error message 2: Warning message 3: Information message (default) 4: Custom + message (omits file path and line number)' + default: '3' + - name: red + type: int + description: The amount of red in the color of the text. Default value is 255. + default: '255' + - name: green + type: int + description: The amount of green in the color of the text. Default value is 255. + default: '255' + - name: blue + type: int + description: The amount of blue in the color of the text. Default value is 255. + default: '255' examples: - path: examples/outputDebugString-1.lua description: 'This script notifies when its resource has been loaded using a debug message:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the debug message was successfully output, false + if invalid arguments are specified. notes: - type: info content: Color values are only applied when debug level is 0 or 4. - incomplete: true + requires_review: true diff --git a/functions/Output/outputServerLog.yaml b/functions/Output/outputServerLog.yaml index 87b58884..949db5ca 100644 --- a/functions/Output/outputServerLog.yaml +++ b/functions/Output/outputServerLog.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/OutputServerLog -server: +shared: name: outputServerLog description: This outputs a line of text to the server's log. This could be useful for debugging. - parameters: [] + parameters: + - name: text + type: string + description: The text to be output to the log. examples: - path: examples/outputServerLog-1.lua description: Example 1:This example outputs client logins to the server log. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/Output/showChat.yaml b/functions/Output/showChat.yaml index ecde1319..76a0e099 100644 --- a/functions/Output/showChat.yaml +++ b/functions/Output/showChat.yaml @@ -1,10 +1,49 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ShowChat -server: +client: name: showChat description: This function is used to show or hide the player's chat. - parameters: [] + parameters: + - name: show + type: bool + description: A boolean value determining whether to show ( true ) or hide ( false + ) the chat. + - name: inputBlocked + type: bool + description: A boolean value determining whether chat input is blocked/hidden, + regardless of chat visibility. If unset, this will keep the default behaviour + prior to r20898 ( true when chat is hidden, false when chat is visible). examples: - path: examples/showChat-1.lua description: This example toggle's the player's chat when they press the "i" key. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the player's chat was shown or hidden successfully, + false otherwise. + requires_review: true +server: + name: showChat + description: This function is used to show or hide the player's chat. + parameters: + - name: thePlayer + type: player + description: The player whose chat is to be hidden or shown. + - name: show + type: bool + description: A boolean value determining whether to show ( true ) or hide ( false + ) the chat. + - name: inputBlocked + type: bool + description: A boolean value determining whether chat input is blocked/hidden, + regardless of chat visibility. If unset, this will keep the default behaviour + prior to r20898 ( true when chat is hidden, false when chat is visible). + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the player's chat was shown or hidden successfully, + false otherwise. + requires_review: true diff --git a/functions/Path/pathIsDirectory.yaml b/functions/Path/pathIsDirectory.yaml index f8c60449..0721c499 100644 --- a/functions/Path/pathIsDirectory.yaml +++ b/functions/Path/pathIsDirectory.yaml @@ -2,9 +2,21 @@ shared: name: pathIsDirectory description: Checks if a specified path points to a directory. - parameters: [] + parameters: + - name: path + type: string + description: A string containing a path you want to check against examples: - path: examples/pathIsDirectory-1.lua description: This example lists entire structure of a folder side: shared - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the path points to a directory, false otherwise. + oop: + element: path + method: isDirectory + static: false + requires_review: true diff --git a/functions/Path/pathIsFile.yaml b/functions/Path/pathIsFile.yaml index 9ff776eb..1412e0d9 100644 --- a/functions/Path/pathIsFile.yaml +++ b/functions/Path/pathIsFile.yaml @@ -2,9 +2,21 @@ shared: name: pathIsFile description: Checks if a specified path points to a file. - parameters: [] + parameters: + - name: path + type: string + description: A string containing a path you want to check against examples: - path: examples/pathIsFile-1.lua description: This example lists all files in a directory side: shared - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the path points to a file, false otherwise. + oop: + element: path + method: isFile + static: false + requires_review: true diff --git a/functions/Path/pathListDir.yaml b/functions/Path/pathListDir.yaml index 4d4a5dda..18a0df33 100644 --- a/functions/Path/pathListDir.yaml +++ b/functions/Path/pathListDir.yaml @@ -3,15 +3,27 @@ shared: name: pathListDir description: Reads a specified directory and returns all entries inside of it. These entries can be file or folder names. - parameters: [] + parameters: + - name: path + type: string + description: A string containing a path you want to get entries from examples: - path: examples/pathListDir-1.lua description: This example loads all models from a certain directory side: client + returns: + values: + - type: table + name: value + description: Returns table with all entries in a specified directory. + oop: + element: path + method: listDir + static: false notes: - type: info content: Listing other resource directory can be done by passing ":resourceName/." For listing current resource (the one where code is executed), you can pass either "" or ":currentResourceName/." (preferably use first approach, because the latter will require removing this part, once result is ready) - incomplete: true + requires_review: true diff --git a/functions/Ped/IsPedFootBloodEnabled.yaml b/functions/Ped/IsPedFootBloodEnabled.yaml index c3678a45..e921d457 100644 --- a/functions/Ped/IsPedFootBloodEnabled.yaml +++ b/functions/Ped/IsPedFootBloodEnabled.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedFootBloodEnabled -client: +shared: name: IsPedFootBloodEnabled description: This function checks if player feets are bleeding. - parameters: [] + parameters: + - name: thePlayer + type: element + description: The player to give bloody foot prints to. examples: - path: examples/IsPedFootBloodEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if feets are bleeding, false otherwise + requires_review: true diff --git a/functions/Ped/addPedClothes.yaml b/functions/Ped/addPedClothes.yaml index a0b21804..05d970e8 100644 --- a/functions/Ped/addPedClothes.yaml +++ b/functions/Ped/addPedClothes.yaml @@ -1,16 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddPedClothes -server: +shared: name: addPedClothes description: This function is used to set the current clothes on a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose clothes you want to change. + - name: clothesTexture + type: string + description: A string determining the clothes texture that will be added. See + the clothes catalog . + - name: clothesModel + type: string + description: A string determining the clothes model that will be added. See the + clothes catalog . + - name: clothesType + type: int + description: A integer representing the clothes slot/type the clothes should be + added to. See the clothes catalog . examples: - path: examples/addPedClothes-1.lua description: This example adds a 'moto' helmet to a player when he gets on a nrg bike, and removes it when he gets off. side: server + returns: + values: + - type: bool + name: value + description: This function returns true if the clothes were successfully added + to the ped, false otherwise. + oop: + element: ped + method: addClothes + static: false pair: getPedClothes notes: - type: info content: This function only works with peds using CJ skin (ID 0). - incomplete: true + requires_review: true diff --git a/functions/Ped/canPedBeKnockedOffBike.yaml b/functions/Ped/canPedBeKnockedOffBike.yaml index 7a85de78..2335fff8 100644 --- a/functions/Ped/canPedBeKnockedOffBike.yaml +++ b/functions/Ped/canPedBeKnockedOffBike.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CanPedBeKnockedOffBike -client: +shared: name: canPedBeKnockedOffBike description: This function checks if the given ped can fall off bikes. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to check. examples: - path: examples/canPedBeKnockedOffBike-1.lua description: This example adds a console command with which the local player can toggle whether he can fall off bikes. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the ped can be knocked off bikes, false if he cannot + or an invalid element was passed. + oop: + element: ped + method: canBeKnockedOffBike + static: false pair: setPedCanBeKnockedOffBike - incomplete: true + requires_review: true diff --git a/functions/Ped/createPed.yaml b/functions/Ped/createPed.yaml index cf07d995..fc7a49d3 100644 --- a/functions/Ped/createPed.yaml +++ b/functions/Ped/createPed.yaml @@ -1,21 +1,78 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreatePed -server: +client: name: createPed description: Creates a Ped in the GTA world. - parameters: [] + parameters: + - name: modelid + type: int + description: A whole integer specifying the GTASA skin ID . + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rot + type: float + description: MISSING_PARAM_DESC + default: '0.0' examples: - - path: examples/createPed-1.lua - description: 'This example creates an ped when the resource starts:' - side: server - path: examples/createPed-2.lua description: 'This example creates a ped, and makes it damage proof:' side: client - issues: - - id: '375' + returns: + values: + - type: ped + name: value + description: Returns a ped element if it was successfully created. + oop: &id001 + element: ped + constructorclass: Ped + issues: &id002 + - id: 375 description: Sync distance of unoccupied vehicles and peds should match stream distance - - id: '605' + - id: 605 description: Ped fireing Projectiles doesn't work - - id: '492' + - id: 492 description: Peds shooting incorrectly - incomplete: true + requires_review: true +server: + name: createPed + description: Creates a Ped in the GTA world. + parameters: + - name: modelid + type: int + description: A whole integer specifying the GTASA skin ID . + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rot + type: float + description: MISSING_PARAM_DESC + default: '0.0' + - name: synced + type: bool + description: MISSING_PARAM_DESC + default: 'true' + examples: + - path: examples/createPed-1.lua + description: 'This example creates an ped when the resource starts:' + side: server + returns: + values: + - type: ped + name: value + description: Returns a ped element if it was successfully created. + oop: *id001 + issues: *id002 + requires_review: true diff --git a/functions/Ped/getPedAmmoInClip.yaml b/functions/Ped/getPedAmmoInClip.yaml index 88531f59..2ea47ae6 100644 --- a/functions/Ped/getPedAmmoInClip.yaml +++ b/functions/Ped/getPedAmmoInClip.yaml @@ -1,15 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedAmmoInClip -server: +shared: name: getPedAmmoInClip description: This function returns an integer that contains the ammo in a specified [ped](/wiki/Ped "Ped")'s weapon. See [Weapon Info](/wiki/Weapon "Weapon") - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose ammo you want to check. + - name: weaponSlot + type: int + description: an integer representing the weapon slot (set to the ped's currently + selected slot if not specified). + default: current examples: - path: examples/getPedAmmoInClip-1.lua description: 'This example outputs the amount of ammo the specified player has in his current slot. For example: ''ammo someguy''.' side: server + returns: + values: + - type: int + name: value + description: Returns an int containing the amount of ammo in the specified ped's + currently selected or specified clip, or 0 if the ped specified is invalid. + oop: + element: ped + method: getAmmoInClip + variable: ammoInClip + static: false issues: - - id: '734' + - id: 734 description: Sometimes wrong count of player ammo, if get it in onPlayerWeaponFire - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedAnalogControlState.yaml b/functions/Ped/getPedAnalogControlState.yaml index 1a4a3a19..f0a2d63b 100644 --- a/functions/Ped/getPedAnalogControlState.yaml +++ b/functions/Ped/getPedAnalogControlState.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedAnalogControlState -client: +shared: name: getPedAnalogControlState description: This function retrieves the analog control state of a [ped](/wiki/Ped "Ped"), as set by [setPedAnalogControlState](/wiki/SetPedAnalogControlState "SetPedAnalogControlState"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you wish to retrieve the control state of. + - name: controlName + type: string + description: The control. See control names for a list of possible controls. + - name: rawValue + type: bool + description: A bool indicating if it should return the raw player input value + (will always return script value for non-player peds). examples: - path: examples/getPedAnalogControlState-1.lua description: This exmaple creating a ped can drive with command/drive side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float between 0 (full release) and 1 (full push) indicating + the amount the control is pushed. + requires_review: true diff --git a/functions/Ped/getPedAnimation.yaml b/functions/Ped/getPedAnimation.yaml index 175dce07..80a2c723 100644 --- a/functions/Ped/getPedAnimation.yaml +++ b/functions/Ped/getPedAnimation.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedAnimation -client: +shared: name: getPedAnimation description: Gets the animation of a player or ped that was set using [setPedAnimation](/wiki/SetPedAnimation "SetPedAnimation"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to get the animation of. examples: - path: examples/getPedAnimation-1.lua description: This example adds a command that allows you to copy the animation @@ -14,8 +17,34 @@ client: performing. Note this will return "N/A" if you did not set an animation withsetPedAnimation. If you want to see what the player ped is doing as you control them that isgetPedTask. side: client + returns: + values: + - type: string + name: value1 + - type: string + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: bool + name: value5 + - type: bool + name: value6 + - type: bool + name: value7 + - type: int + name: value8 + - type: bool + name: value9 + description: 'The function returns 9 values in the same order as required by setPedAnimation + :' + oop: + element: ped + method: getAnimation + static: false pair: setPedAnimation notes: - type: info content: Use getPedTask to monitor what movements the player is currently doing. - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedArmor.yaml b/functions/Ped/getPedArmor.yaml index a6ea22e4..cf41cf62 100644 --- a/functions/Ped/getPedArmor.yaml +++ b/functions/Ped/getPedArmor.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedArmor -server: +shared: name: getPedArmor description: This function returns the current armor of the specified [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose armor you want to check examples: - path: examples/getPedArmor-1.lua description: This example defines a "showarmor" console command that shows the player that executes it how much armor he has. side: client + returns: + values: + - type: float + name: value + description: A float with the armor, false if an invalid ped was given. + oop: + element: ped + method: getArmor + variable: armor + static: false pair: setPedArmor - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedBonePosition.yaml b/functions/Ped/getPedBonePosition.yaml index 6a1ce849..2077b48f 100644 --- a/functions/Ped/getPedBonePosition.yaml +++ b/functions/Ped/getPedBonePosition.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedBonePosition -client: +shared: name: getPedBonePosition description: Returns the 3D world coordinates of a specific bone of a given ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to inspect. + - name: bone + type: int + description: the number of the bone to get the position of. examples: - path: examples/getPedBonePosition-1.lua description: This example renders name tags above a player's head bone. @@ -10,7 +16,20 @@ client: - path: examples/getPedBonePosition-2.lua description: This one draw all local player's bones side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns the x, y, z world position of the bone. + oop: + element: ped + method: getBonePosition + static: false notes: - type: tip content: If you want attach element to ped bone, use [ pAttach ] resource - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedCameraRotation.yaml b/functions/Ped/getPedCameraRotation.yaml index ee5a7ff4..7aba9dff 100644 --- a/functions/Ped/getPedCameraRotation.yaml +++ b/functions/Ped/getPedCameraRotation.yaml @@ -1,18 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedCameraRotation -client: +shared: name: getPedCameraRotation description: This function gets the current camera rotation of a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped to retrieve the camera rotation of. examples: - path: examples/getPedCameraRotation-1.lua description: This example creates a/getrotationcommand which outputs the expected camera rotation of the player which types it. side: client + returns: + values: + - type: float + name: value + description: Returns the camera rotation of the ped in degrees if successful. + Returns false if an invalid element was passed. + oop: + element: ped + method: getCameraRotation + variable: cameraRotation + static: false pair: setPedCameraRotation notes: - type: info content: The camera rotation angle returned by this function is 360ΒΊ - Ξ± (where Ξ± is the actual camera rotation angle). See example to know how to deal with this. - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedClothes.yaml b/functions/Ped/getPedClothes.yaml index 839d8b05..9110cad5 100644 --- a/functions/Ped/getPedClothes.yaml +++ b/functions/Ped/getPedClothes.yaml @@ -1,14 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedClothes -server: +shared: name: getPedClothes description: This function is used to get the current clothes texture and model of a certain type on a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose clothes you want to retrieve. + - name: clothesType + type: int + description: The type/slot of clothing you want to get. examples: - path: examples/getPedClothes-1.lua description: 'This example prints the model and texture of the current clothing on the player who enters the "clothes" command. For example: "clothes 3" for the shoes.' side: server + returns: + values: + - type: string + name: value1 + - type: string + name: value2 + description: This function returns 2 strings , the clothes texture and model. + The first return value will be false if this player's clothes type is empty + or an invalid player was specified. + oop: + element: ped + method: getClothes + static: false pair: addPedClothes - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedContactElement.yaml b/functions/Ped/getPedContactElement.yaml index 8164eb0d..1d367eb6 100644 --- a/functions/Ped/getPedContactElement.yaml +++ b/functions/Ped/getPedContactElement.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedContactElement -server: +shared: name: getPedContactElement description: This function detects the element a ped is standing on. This can be a vehicle or an object. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped of which you want to get the element he is standing on. examples: - path: examples/getPedContactElement-1.lua description: This clientside function outputs the name of the vehicle the specified player is standing on, or a message saying he isn't on one. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an object or a vehicle if the ped is standing on one, false + if he is touching none or an invalid element was passed. + oop: + element: ped + method: getContactElement + variable: contactElement + static: false + requires_review: true diff --git a/functions/Ped/getPedControlState.yaml b/functions/Ped/getPedControlState.yaml index 699ca244..2291825a 100644 --- a/functions/Ped/getPedControlState.yaml +++ b/functions/Ped/getPedControlState.yaml @@ -1,10 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedControlState -client: +shared: name: getPedControlState description: Checks whether a ped or the localplayer has a certain control pressed. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to check. + - name: control + type: string + description: the control to get the status of. See control names for a list of + valid names. examples: - path: examples/getPedControlState-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is pressing the specified control, false + if not or an invalid argument was passed. + oop: + element: ped + method: getControlState + static: false + requires_review: true diff --git a/functions/Ped/getPedFightingStyle.yaml b/functions/Ped/getPedFightingStyle.yaml index e8d0d76d..b9ca5e1f 100644 --- a/functions/Ped/getPedFightingStyle.yaml +++ b/functions/Ped/getPedFightingStyle.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedFightingStyle -server: +shared: name: getPedFightingStyle description: 'Retrieves the fighting style a player/ped is currently using. Function also added client\-side.' - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose current fighting style ID you wish to retrieve. examples: - path: examples/getPedFightingStyle-1.lua description: This will allow any player to check what fighting style they are currently using, by typing the 'getfightingstyle' command. side: server + returns: + values: + - type: int + name: value + description: Returns the ped's current fighting style as an integer ID, false + if it fails to retrieve a value. + oop: + element: ped + method: getFightingStyle + variable: fightingStyle + static: false pair: setPedFightingStyle - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedGravity.yaml b/functions/Ped/getPedGravity.yaml index 0d54260f..4359e2b1 100644 --- a/functions/Ped/getPedGravity.yaml +++ b/functions/Ped/getPedGravity.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedGravity -server: +shared: name: getPedGravity description: This function returns the current gravity for the specified [ped](/wiki/Ped "Ped"). The default gravity is 0\.008\. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose gravity you want to check. examples: - path: examples/getPedGravity-1.lua description: This example outputs the gravity of the player who entered the 'showGravity' command. side: server + returns: + values: + - type: float + name: value + description: Returns a float indicating the ped's gravity, or false if the ped + is invalid. Default value is 0.008. + oop: + element: ped + method: getGravity + variable: gravity + static: false pair: setPedGravity - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedMoveState.yaml b/functions/Ped/getPedMoveState.yaml index e63e1cb1..43e42e80 100644 --- a/functions/Ped/getPedMoveState.yaml +++ b/functions/Ped/getPedMoveState.yaml @@ -1,12 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedMoveState -client: +shared: name: getPedMoveState description: This function returns the current move state for the specified [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose move state you want to know examples: - path: examples/getPedMoveState-1.lua description: Example 1:This example shows how you can output a players current movestate. side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string indicating the ped's move state, or false if the + ped is not streamed in, the movement type is unknown, the ped is in a vehicle + or the ped is invalid. + requires_review: true diff --git a/functions/Ped/getPedOccupiedVehicle.yaml b/functions/Ped/getPedOccupiedVehicle.yaml index 48e626b9..b7a4ed65 100644 --- a/functions/Ped/getPedOccupiedVehicle.yaml +++ b/functions/Ped/getPedOccupiedVehicle.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedOccupiedVehicle -server: +shared: name: getPedOccupiedVehicle description: This function gets the [vehicle](/wiki/Vehicle "Vehicle") that the ped is currently in or is trying to enter, if any. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose vehicle you're looking up. examples: - path: examples/getPedOccupiedVehicle-1.lua description: When a ped enters the 'getcarname' command and is currently in a vehicle, this example outputs the name of the vehicle. side: server + returns: + values: + - type: vehicle + name: value + description: Returns the vehicle that the specified ped is in, or false if the + ped is not in a vehicle or is an invalid ped. + oop: + element: ped + note: Set the variable to nil to executeremovePedFromVehicle + method: getOccupiedVehicle + variable: vehicle + static: false pair: warpPedIntoVehicle - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedOccupiedVehicleSeat.yaml b/functions/Ped/getPedOccupiedVehicleSeat.yaml index 9dfc66f6..6e1c2a74 100644 --- a/functions/Ped/getPedOccupiedVehicleSeat.yaml +++ b/functions/Ped/getPedOccupiedVehicleSeat.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedOccupiedVehicleSeat -server: +shared: name: getPedOccupiedVehicleSeat description: This function gets the seat that a specific ped is sitting in in a vehicle. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose vehicle seat you're looking up. examples: - path: examples/getPedOccupiedVehicleSeat-1.lua description: This example finds what seat a random player is sitting in and outputs it to the chat box. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns false if the ped is on foot, or the ped doesn't exist. + oop: + element: ped + note: Prior to 1.5, the variable was .occupiedVehicleSeat + method: getOccupiedVehicleSeat + variable: vehicleSeat + static: false + requires_review: true diff --git a/functions/Ped/getPedOxygenLevel.yaml b/functions/Ped/getPedOxygenLevel.yaml index 3583ec11..03b1ccd8 100644 --- a/functions/Ped/getPedOxygenLevel.yaml +++ b/functions/Ped/getPedOxygenLevel.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedOxygenLevel -client: +shared: name: getPedOxygenLevel description: This function returns the current oxygen level of the specified [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose oxygen level you want to check examples: - path: examples/getPedOxygenLevel-1.lua description: This example defines a "showoxygen" console command that shows the player that executes it which oxygen level he has. side: client + returns: + values: + - type: float + name: value + description: A float with the oxygen level, false if an invalid ped was given. + oop: + element: ped + method: getOxygenLevel + variable: oxygenLevel + static: false pair: setPedOxygenLevel - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedSimplestTask.yaml b/functions/Ped/getPedSimplestTask.yaml index 55689de1..cd12d4e7 100644 --- a/functions/Ped/getPedSimplestTask.yaml +++ b/functions/Ped/getPedSimplestTask.yaml @@ -1,15 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedSimplestTask -client: +shared: name: getPedSimplestTask description: This function is used to get the name of a specified ped's current simplest [task](/wiki/Task "Task"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose task you want to retrieve. examples: - path: examples/getPedSimplestTask-1.lua description: This example prints the name of a player's simplest task to the chat, when they use the "simplestTask" command. side: client + returns: + values: + - type: string + name: value + description: Returns a string representing the name of the ped's simplest, active + task . notes: - type: info content: See getPedTask to get a ped's task. - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedStat.yaml b/functions/Ped/getPedStat.yaml index b9b38294..530fd1b8 100644 --- a/functions/Ped/getPedStat.yaml +++ b/functions/Ped/getPedStat.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedStat -server: +shared: name: getPedStat description: This function returns the value of the specified statistic of a specific [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose stat you want to retrieve. + - name: stat + type: int + description: A whole number determining the stat ID. examples: - path: examples/getPedStat-1.lua description: This example announces whether a player is fat upon spawn side: server - incomplete: true + returns: + values: + - type: float + name: value + description: Returns the value of the requested statistic. + oop: + element: ped + method: getStat + static: false + requires_review: true diff --git a/functions/Ped/getPedTarget.yaml b/functions/Ped/getPedTarget.yaml index 3f4d541a..ed5d65b8 100644 --- a/functions/Ped/getPedTarget.yaml +++ b/functions/Ped/getPedTarget.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTarget -server: +shared: name: getPedTarget description: This function is used to get the element a [ped](/wiki/Ped "Ped") is currently targeting. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose target you want to retrieve. examples: - path: examples/getPedTarget-1.lua description: This example blows up any vehicle a player targets (aims at). side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the element that's being targeted, or false if there isn't + one. + oop: + element: ped + method: getTarget + static: false + requires_review: true diff --git a/functions/Ped/getPedTargetCollision.yaml b/functions/Ped/getPedTargetCollision.yaml index c6ae5bd5..1fa4fee3 100644 --- a/functions/Ped/getPedTargetCollision.yaml +++ b/functions/Ped/getPedTargetCollision.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTargetCollision -client: +shared: name: getPedTargetCollision description: This function allows retrieval of where a ped's target is blocked. It will only be blocked if there is an obstacle within a ped's target range. - parameters: [] + parameters: + - name: targetingPed + type: ped + description: This is the ped whose target collision you wish to retrieve examples: - path: examples/getPedTargetCollision-1.lua description: This Example draws a line from where the PedΒ΄s Target Starts to the Point where the Targets Collision is. side: client - incomplete: true + returns: + values: + - type: float float float + name: value + description: Returns three floats, x , y , z , representing the position where + the ped's target collides, or false if it was unsuccessful. + requires_review: true diff --git a/functions/Ped/getPedTargetEnd.yaml b/functions/Ped/getPedTargetEnd.yaml index 23197463..522982de 100644 --- a/functions/Ped/getPedTargetEnd.yaml +++ b/functions/Ped/getPedTargetEnd.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTargetEnd -client: +shared: name: getPedTargetEnd description: This function allows retrieval of the position where a ped's target range ends, when he is aiming with a weapon. - parameters: [] + parameters: + - name: targetingPed + type: ped + description: the ped who is targeting whose target end you wish to retrieve examples: - path: examples/getPedTargetEnd-1.lua description: This Example draws a line from where the PedΒ΄s Target Starts to the Point where the Target Ends side: client - incomplete: true + returns: + values: + - type: float float float + name: value + description: Returns three floats, x , y , z , representing the position where + the ped's target ends according to his range, or false if it was unsuccessful. + oop: + element: ped + method: getTargetEnd + static: false + requires_review: true diff --git a/functions/Ped/getPedTargetStart.yaml b/functions/Ped/getPedTargetStart.yaml index b2d78741..12d1aa41 100644 --- a/functions/Ped/getPedTargetStart.yaml +++ b/functions/Ped/getPedTargetStart.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTargetStart -client: +shared: name: getPedTargetStart description: This function allows retrieval of the position a ped's target range begins, when he is aiming with a weapon. - parameters: [] + parameters: + - name: targetingPed + type: ped + description: The ped whose target start you wish to retrieve examples: - path: examples/getPedTargetStart-1.lua description: This Example draws a line from where the PedΒ΄s Target Starts to the Point where the Target Ends side: client - incomplete: true + returns: + values: + - type: float float float + name: value + description: Returns three floats, x,y,z, representing the position where the + ped's target starts, or false if it was unsuccessful. + requires_review: true diff --git a/functions/Ped/getPedTask.yaml b/functions/Ped/getPedTask.yaml index e6885357..d2a11725 100644 --- a/functions/Ped/getPedTask.yaml +++ b/functions/Ped/getPedTask.yaml @@ -1,12 +1,47 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTask -client: +shared: name: getPedTask description: This function is used to get any simple or complex [task](/wiki/Task "Task") of a certain type for a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose task you want to retrieve. + - name: priority + type: string + description: A string determining which set of tasks you want to retrieve it from. + This must be either "primary" or "secondary". + - name: taskType + type: int + description: 'An integer value representing the task type (or slot) you want to + get the task from. Types can be: PRIMARY TASKS 0: TASK_PHYSICAL_RESPONSE 1: + TASK_EVENT_RESPONSE_TEMP 2: TASK_EVENT_RESPONSE_NONTEMP 3: TASK_PRIMARY 4: TASK_DEFAULT + SECONDARY TASKS 0: TASK_SECONDARY_ATTACK 1: TASK_SECONDARY_DUCK 2: TASK_SECONDARY_SAY + 3: TASK_SECONDARY_FACIAL_COMPLEX 4: TASK_SECONDARY_PARTIAL_ANIM 5: TASK_SECONDARY_IK' examples: - path: examples/getPedTask-1.lua description: This example draws the active primary and secondary tasks (including task hierarchy in 1.1) as your local player moves around the world. side: client - incomplete: true + returns: + values: + - type: string + name: value1 + - type: string + name: value2 + - type: string + name: value3 + - type: string + name: value4 + description: Returns the name of the most complex task. See list of player tasks + for valid strings. Returns false if invalid arguments are specified or if there + is no task of the type specified. Returns between 1 and 4 strings. The first + string contains the name of the most complex task, with simpler sub-tasks being + named in the following strings. See list of player tasks for valid strings. + Returns false if invalid arguments are specified or if there is no task of the + type specified. + oop: + element: ped + method: getTask + static: false + requires_review: true diff --git a/functions/Ped/getPedTotalAmmo.yaml b/functions/Ped/getPedTotalAmmo.yaml index 4c4a570d..3676e302 100644 --- a/functions/Ped/getPedTotalAmmo.yaml +++ b/functions/Ped/getPedTotalAmmo.yaml @@ -1,19 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedTotalAmmo -server: +shared: name: getPedTotalAmmo description: This function returns an integer that contains the total ammo in a specified [ped](/wiki/Ped "Ped")'s weapon. See [Weapon Info](/wiki/Weapon "Weapon") - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose ammo you want to check. + - name: weaponSlot + type: int + description: an integer representing the weapon slot (set to the ped's current + slot if not given) + default: current examples: - path: examples/getPedTotalAmmo-1.lua description: This example outputs the total amount of ammo a player calledSomeguyhas for his weapon. side: server + returns: + values: + - type: int + name: value + description: Returns an int containing the total amount of ammo for the specified + ped's weapon, or 0 if the ped specified is invalid. + oop: + element: ped + method: getTotalAmmo + static: false notes: - type: info content: Clientside, this function will not return a correct value for remote player weapons that aren't in hand. issues: - - id: '734' + - id: 734 description: Sometimes wrong count of player ammo, if get it in onPlayerWeaponFire - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedVoice.yaml b/functions/Ped/getPedVoice.yaml index c76fe74d..eb9212b3 100644 --- a/functions/Ped/getPedVoice.yaml +++ b/functions/Ped/getPedVoice.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedVoice -client: +shared: name: getPedVoice description: Gets the current voice of a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped to get the voice of. examples: - path: examples/getPedVoice-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: string + name: value1 + - type: string + name: value2 + description: If successul, returns the current voice type name and the voice name + of the ped (see ped voices for possible names). Returns false in case of failure. + requires_review: true diff --git a/functions/Ped/getPedWalkingStyle.yaml b/functions/Ped/getPedWalkingStyle.yaml index 30231b96..c966934c 100644 --- a/functions/Ped/getPedWalkingStyle.yaml +++ b/functions/Ped/getPedWalkingStyle.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedWalkingStyle -server: +shared: name: getPedWalkingStyle description: Returns the walking style ID of a ped. This ID determines the set of animations that is used for walking, running etc. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose walking style to retrieve. examples: - path: examples/getPedWalkingStyle-1.lua description: '' side: client + returns: + values: + - type: int + name: value + description: 'Returns the walking style ID if successful, false otherwise. The + possible walking styles are as follows:' + oop: + element: ped + method: getWalkingStyle + variable: walkingStyle + static: false pair: setPedWalkingStyle - incomplete: true + requires_review: true diff --git a/functions/Ped/getPedWeapon.yaml b/functions/Ped/getPedWeapon.yaml index 34231b35..852bf681 100644 --- a/functions/Ped/getPedWeapon.yaml +++ b/functions/Ped/getPedWeapon.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedWeapon -server: +shared: name: getPedWeapon description: This function tells you which weapon type is in a certain **[weapon slot](/wiki/Weapon "Weapon")** of a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to get the weapon type from. + - name: weaponSlot + type: int + description: an integer representing the weapon slot (set to the ped's current + slot if not given). + default: current examples: - path: examples/getPedWeapon-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int indicating the type of the weapon the ped has in the + specified slot. If the slot is empty, it returns 0. + oop: + element: ped + method: getWeapon + static: false + requires_review: true diff --git a/functions/Ped/getPedWeaponMuzzlePosition.yaml b/functions/Ped/getPedWeaponMuzzlePosition.yaml index f2deb823..b677a719 100644 --- a/functions/Ped/getPedWeaponMuzzlePosition.yaml +++ b/functions/Ped/getPedWeaponMuzzlePosition.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedWeaponMuzzlePosition -client: +shared: name: getPedWeaponMuzzlePosition description: Returns the world position of the muzzle of the weapon that a ped is currently carrying. The weapon muzzle is the end of the gun barrel where the bullets/rockets/... come out. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose weapon muzzle position to retrieve. examples: - path: examples/getPedWeaponMuzzlePosition-1.lua description: This Example draws a red 3D-Line when a Player shoots,between the Players WeaponMuzzlePosition and the Point where the Bullet hits.[Tested] side: client - incomplete: true + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: If successful, returns the x/y/z coordinates of the weapon muzzle. + Returns false otherwise. + requires_review: true diff --git a/functions/Ped/getPedWeaponSlot.yaml b/functions/Ped/getPedWeaponSlot.yaml index 86b716ef..11497fb9 100644 --- a/functions/Ped/getPedWeaponSlot.yaml +++ b/functions/Ped/getPedWeaponSlot.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedWeaponSlot -server: +shared: name: getPedWeaponSlot description: This function gets a ped's selected weapon slot. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped to get the current weapon slot of. examples: - path: examples/getPedWeaponSlot-1.lua description: '' side: server + returns: + values: + - type: int + name: value + description: Returns the selected weapon slot ID on success, false otherwise. + oop: + element: ped + method: getWeaponSlot + variable: weaponSlot + static: false pair: setPedWeaponSlot - incomplete: true + requires_review: true diff --git a/functions/Ped/getValidPedModels.yaml b/functions/Ped/getValidPedModels.yaml index a641f08f..b6d56728 100644 --- a/functions/Ped/getValidPedModels.yaml +++ b/functions/Ped/getValidPedModels.yaml @@ -1,4 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetValidPedModels +client: + name: getValidPedModels + description: This function returns all valid ped models. The syntax is different + for server and client sides. + parameters: + - name: includeCustom + type: bool + description: MISSING_PARAM_DESC + default: 'true' + examples: [] + returns: + values: + - type: table + name: value + description: Returns a table with all valid ped models that exist on the client, + containing the custom model IDs unless includeCustom is false. + requires_review: true server: name: getValidPedModels description: This function returns all valid ped models. The syntax is different @@ -9,4 +26,9 @@ server: description: This example will check if the specified skin ID is a valid skin via a command. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table with all valid ped models that exist on the server. + requires_review: true diff --git a/functions/Ped/givePedWeapon.yaml b/functions/Ped/givePedWeapon.yaml index c2197ed1..93f2ff1d 100644 --- a/functions/Ped/givePedWeapon.yaml +++ b/functions/Ped/givePedWeapon.yaml @@ -1,19 +1,42 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GivePedWeapon -client: +shared: name: givePedWeapon description: This function gives the specified weapon to the specified ped. This function can't be used on players, use [giveWeapon](/wiki/GiveWeapon "GiveWeapon") for that. - parameters: [] + parameters: + - name: thePed + type: ped + description: A ped element. + - name: weapon + type: int + description: A whole number integer that refers to a Weapon ID. Click here for + a list of possible weapon IDs. + - name: ammo + type: int + description: A whole number integer serving as the ammo amount for the given weapon. + For weapons that do not require ammo, such as melee, this should be at least + 1. + default: '30' + - name: setAsCurrent + type: bool + description: A boolean value determining whether or not the weapon will be set + as the peds currently selected weapon. + default: 'false' examples: - path: examples/givePedWeapon-1.lua description: Example 1:This example creates a client side ped, gives them an M4 and make them shoot once you do the command '/armedped' side: client + returns: + values: + - type: bool + name: value + description: Returns true if weapon was successfully given to the ped, false otherwise. notes: - type: info content: When setting ammo for weapons in slot 0,1,10,11 or 12 the maximum ammo is 1 When setting ammo for weapons in slot 3,4,5 the ammo is added When setting ammo for weapons in slot 2,6,7,8,9 and the slot weapon is changing, the ammo is replaced - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedBleeding.yaml b/functions/Ped/isPedBleeding.yaml index d26289b8..8e60977a 100644 --- a/functions/Ped/isPedBleeding.yaml +++ b/functions/Ped/isPedBleeding.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedBleeding -client: +shared: name: isPedBleeding description: This function gets the state of a [player's](/wiki/Player "Player") or [ped's](/wiki/Ped "Ped") bleeding effect. - parameters: [] + parameters: + - name: thePed + type: ped + description: The player or ped whose bleeding effect state you want to get. examples: - path: examples/isPedBleeding-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the player or ped is bleeding, false otherwise. + oop: + element: ped + method: isBleeding + variable: bleeding + static: false pair: setPedBleeding - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedChoking.yaml b/functions/Ped/isPedChoking.yaml index 2ac4c362..70965ba2 100644 --- a/functions/Ped/isPedChoking.yaml +++ b/functions/Ped/isPedChoking.yaml @@ -1,14 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedChoking -server: +shared: name: isPedChoking description: This function checks if the specified [ped](/wiki/Ped "Ped") is choking (coughing) or not. This happens as a result of weapons that produce smoke \- smoke grenades, fire extinguisher and the spray can. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you wish to check examples: - path: examples/isPedChoking-1.lua description: This example checks if a random player is choking or not, and if so displays a message in the chat box. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the ped is choking, false otherwise. + oop: + element: ped + method: isChoking + variable: choking + static: false pair: setPedChoking - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedDead.yaml b/functions/Ped/isPedDead.yaml index 9efc62f9..5a8d42ad 100644 --- a/functions/Ped/isPedDead.yaml +++ b/functions/Ped/isPedDead.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedDead -server: +shared: name: isPedDead description: This function checks if the specified [ped](/wiki/Ped "Ped") is dead or not. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to check up on. examples: - path: examples/isPedDead-1.lua description: This example allows a player to use the command 'amidead' to see if they are dead or not. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is dead, false otherwise. + oop: + element: ped + method: isDead + variable: dead + static: false + requires_review: true diff --git a/functions/Ped/isPedDoingGangDriveby.yaml b/functions/Ped/isPedDoingGangDriveby.yaml index 6acf2c2b..bc8e4aa1 100644 --- a/functions/Ped/isPedDoingGangDriveby.yaml +++ b/functions/Ped/isPedDoingGangDriveby.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedDoingGangDriveby -server: +shared: name: isPedDoingGangDriveby description: This function checks if the ped is in the driveby state. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped element whose state is to be checked. examples: - path: examples/isPedDoingGangDriveby-1.lua description: This example turns on driveby mode when the local player typesdrivebyin the console. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the driveby state is enabled, false otherwise. + oop: + element: ped + method: isDoingGangDriveby + variable: doingGangDriveby + static: false pair: setPedDoingGangDriveby - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedDoingTask.yaml b/functions/Ped/isPedDoingTask.yaml index 6a78d945..89032a96 100644 --- a/functions/Ped/isPedDoingTask.yaml +++ b/functions/Ped/isPedDoingTask.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedDoingTask -client: +shared: name: isPedDoingTask description: This function checks if the specified ped is carrying out a certain [task](/wiki/List_of_player_tasks "List of player tasks"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you want to check. + - name: taskName + type: string + description: A string containing the name of the task you're checking for. examples: - path: examples/isPedDoingTask-1.lua description: This example checks if the player who entered the 'doingdriveby' command is doing a drive-by (clientside). side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the player is currently doing the task, false otherwise. + requires_review: true diff --git a/functions/Ped/isPedDucked.yaml b/functions/Ped/isPedDucked.yaml index 8be1cb60..42810f20 100644 --- a/functions/Ped/isPedDucked.yaml +++ b/functions/Ped/isPedDucked.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedDucked -server: +shared: name: isPedDucked description: This function checks if the specified [ped](/wiki/Ped "Ped") is ducked (crouched) or not. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped to check. examples: - path: examples/isPedDucked-1.lua description: This example checks if a random player is ducked or not, and if so displays a message in the chat box. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is ducked, false otherwise. + oop: + element: ped + method: isDucked + variable: ducked + static: false + requires_review: true diff --git a/functions/Ped/isPedHeadless.yaml b/functions/Ped/isPedHeadless.yaml index 2a1384a1..f2dbffa0 100644 --- a/functions/Ped/isPedHeadless.yaml +++ b/functions/Ped/isPedHeadless.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedHeadless -server: +shared: name: isPedHeadless description: With this function, you can check if a ped has a head or not. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped to check. examples: - path: examples/isPedHeadless-1.lua description: Add a command to check whether the player is a zombie or not @@ -10,4 +13,9 @@ server: - path: examples/isPedHeadless-2.lua description: Add a command to check whether a player is a zombie or not side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is headless, false otherwise. + requires_review: true diff --git a/functions/Ped/isPedInVehicle.yaml b/functions/Ped/isPedInVehicle.yaml index 7fabef21..2c9282cc 100644 --- a/functions/Ped/isPedInVehicle.yaml +++ b/functions/Ped/isPedInVehicle.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedInVehicle -server: +shared: name: isPedInVehicle description: Checks whether or not a given ped is currently in a vehicle. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to check. examples: - path: examples/isPedInVehicle-1.lua description: This code defines anisinvehiclecommand which tells a player whether another player is in a vehicle or not. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the ped is in a vehicle, false if he is on foot or + an invalid element was passed. + oop: + element: ped + method: isInVehicle + variable: inVehicle + static: false notes: - type: info content: 'Client side IsPedInVehicle only returns true if the ped is physically @@ -16,4 +30,4 @@ server: - type: info content: Server side IsPedInVehicle returns whether the ped is entering, inside or exiting a vehicle. - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedOnGround.yaml b/functions/Ped/isPedOnGround.yaml index 219a0af7..d54ccbac 100644 --- a/functions/Ped/isPedOnGround.yaml +++ b/functions/Ped/isPedOnGround.yaml @@ -1,15 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedOnGround -server: +shared: name: isPedOnGround description: This function is used to determine whether or not a ped is on the ground. This is for on\-foot usage only. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you are checking. examples: - path: examples/isPedOnGround-1.lua description: This example checks if the player who enters the 'amiflying' command is on the ground and outputs a message. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the ped is on foot and on the ground, false otherwise, + even if he is in a car that stands still or on object outside world map. + oop: + element: ped + method: isOnGround + variable: onGround + static: false issues: - - id: '534' + - id: 534 description: isPedOnGround issues - incomplete: true + requires_review: true diff --git a/functions/Ped/isPedReloadingWeapon.yaml b/functions/Ped/isPedReloadingWeapon.yaml index 49178fd5..6878ca33 100644 --- a/functions/Ped/isPedReloadingWeapon.yaml +++ b/functions/Ped/isPedReloadingWeapon.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedReloadingWeapon -server: +shared: name: isPedReloadingWeapon description: This function is used to determine whether or not a ped is currently reloading their weapon. Useful to stop certain quick reload exploits. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you are checking. examples: - path: examples/isPedReloadingWeapon-1.lua description: This example checks if the player who enters the/amireloadingcommand is reloading and outputs a message. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is currently reloading a weapon, false otherwise. + oop: + element: ped + method: isReloadingWeapon + variable: reloadingWeapon + static: false + requires_review: true diff --git a/functions/Ped/isPedTargetingMarkerEnabled.yaml b/functions/Ped/isPedTargetingMarkerEnabled.yaml index df8f3f65..820e478d 100644 --- a/functions/Ped/isPedTargetingMarkerEnabled.yaml +++ b/functions/Ped/isPedTargetingMarkerEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedTargetingMarkerEnabled -client: +shared: name: isPedTargetingMarkerEnabled description: This function checks whether health target markers are drawn as set by [setPedTargetingMarkerEnabled](/wiki/SetPedTargetingMarkerEnabled "SetPedTargetingMarkerEnabled") @@ -9,4 +9,9 @@ client: - path: examples/isPedTargetingMarkerEnabled-1.lua description: This example will toggle the targeting markers with the command /togtargetmarkers. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the health target markers are enabled, false if not. + requires_review: true diff --git a/functions/Ped/isPedWearingJetpack.yaml b/functions/Ped/isPedWearingJetpack.yaml index 1973d92f..a9607bfd 100644 --- a/functions/Ped/isPedWearingJetpack.yaml +++ b/functions/Ped/isPedWearingJetpack.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPedWearingJetpack -server: +shared: name: isPedWearingJetpack description: Checks whether or not a ped is currently wearing a jetpack. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to check examples: - path: examples/isPedWearingJetpack-1.lua description: Example 1:This examples adds a "jetpack" console command, which toggles @@ -12,4 +15,15 @@ server: description: Example 2:This example provides a check to see if players have a jetpack when they enter a particular marker. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped is carrying a jetpack, false if he is not + or an invalid element was passed. + oop: + element: ped + method: isWearingJetpack + variable: jetpack + static: false + requires_review: true diff --git a/functions/Ped/killPed.yaml b/functions/Ped/killPed.yaml index c102cec9..467e4c49 100644 --- a/functions/Ped/killPed.yaml +++ b/functions/Ped/killPed.yaml @@ -1,8 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/KillPed -server: +shared: name: killPed description: This function kills the specified ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped to kill + - name: theKiller + type: ped + description: The ped responsible for the kill + default: nil + - name: weapon + type: int + description: The ID of the weapon or Damage Types that should appear to have killed + the ped (doesn't affect how they die) + default: '255' + - name: bodyPart + type: int + description: 'The ID of the body part that should appear to have been hit by the + weapon (doesn''t affect how they die) 3: Torso 4: Ass 5: Left Arm 6: Right Arm + 7: Left Leg 8: Right Leg 9: Head' + default: '255' + - name: stealth + type: bool + description: Boolean value, representing whether or not this a stealth kill + default: 'false' examples: - path: examples/killPed-1.lua description: Example 1:This simple example adds akillcommand to commit suicide. @@ -11,4 +33,14 @@ server: description: Example 2:This example enables 1 hit kills if a player is shot in the head. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ped was killed, false if the ped specified could + not be killed or is invalid. + oop: + element: ped + method: kill + static: false + requires_review: true diff --git a/functions/Ped/playPedVoiceLine.yaml b/functions/Ped/playPedVoiceLine.yaml index 44bc4be9..d685c7c5 100644 --- a/functions/Ped/playPedVoiceLine.yaml +++ b/functions/Ped/playPedVoiceLine.yaml @@ -1,12 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PlayPedVoiceLine -client: +shared: name: playPedVoiceLine description: This function allows playing specific voice lines of a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped who will speak the lines. + - name: lineId + type: number + description: The ID of the line to be spoken (0-359). See ID List + - name: probability + type: float + description: The probability that the line will be spoken (0 - 1), where 1 means + 100%. + default: '1.0' examples: [] + returns: + values: + - type: nil + name: value + description: The function returns nothing, always nil . + oop: + element: element + method: playPedVoiceLine + static: false notes: - type: info content: Voice lines are assigned to a specific skin ID, so using setPedVoice might be helpful if you want to play any voice lines regardless of the skin. - incomplete: true + requires_review: true diff --git a/functions/Ped/reloadPedWeapon.yaml b/functions/Ped/reloadPedWeapon.yaml index 410944e9..4e7edd00 100644 --- a/functions/Ped/reloadPedWeapon.yaml +++ b/functions/Ped/reloadPedWeapon.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ReloadPedWeapon -server: +shared: name: reloadPedWeapon description: This function makes a pedestrian reload their weapon. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped who will reload their weapon. examples: - path: examples/reloadPedWeapon-1.lua description: This example adds a 'reloadgun' console command that lets players reload their weapon. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the pedestrian was made to reload, or false if invalid + arguments were passed or that pedestrian has a weapon which cannot be reloaded. + oop: + element: ped + method: reloadWeapon + static: false + requires_review: true diff --git a/functions/Ped/removePedClothes.yaml b/functions/Ped/removePedClothes.yaml index 9644b564..3aa9e1ca 100644 --- a/functions/Ped/removePedClothes.yaml +++ b/functions/Ped/removePedClothes.yaml @@ -1,13 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemovePedClothes -server: +shared: name: removePedClothes description: This function is used to remove the current clothes of a certain type on a [ped](/wiki/Ped "Ped"). It will remove them if the clothesTexture and clothesModel aren't specified, or if they match the current clothes on that slot. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you want to remove clothes from. + - name: clothesType + type: int + description: the clothes slot/type to remove. See the clothes catalog . + - name: clothesTexture + type: string + description: (Server only) A string determining the clothes texture that will + be removed. See the clothes catalog . + - name: clothesModel + type: string + description: (Server only) A string determining the clothes model that will be + removed. See the clothes catalog . examples: - path: examples/removePedClothes-1.lua description: This example adds a 'moto' helmet to a player when he gets on a nrg bike, and removes it when he gets off. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns true if the clothes were successfully removed + from the ped, false otherwise. + oop: + element: ped + method: removeClothes + static: false + requires_review: true diff --git a/functions/Ped/removePedFromVehicle.yaml b/functions/Ped/removePedFromVehicle.yaml index 39e11df6..1d40b7dd 100644 --- a/functions/Ped/removePedFromVehicle.yaml +++ b/functions/Ped/removePedFromVehicle.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemovePedFromVehicle -server: +shared: name: removePedFromVehicle description: This function removes a ped from a vehicle immediately. This works for drivers and passengers. Note that this removes the ped from the vehicle and puts him in the exact position where the command was initiated. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you wish to remove from a vehicle examples: - path: examples/removePedFromVehicle-1.lua description: Small example to show how to remove a ped from any vehicle it's in. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the operation was successful, false if the specified + ped is not valid or if it isn't in a vehicle. + oop: + element: ped + note: Set the variable to nil to execute this function + method: removeFromVehicle + variable: vehicle + static: false + requires_review: true diff --git a/functions/Ped/resetPedVoice.yaml b/functions/Ped/resetPedVoice.yaml index 14290c78..d4452aa9 100644 --- a/functions/Ped/resetPedVoice.yaml +++ b/functions/Ped/resetPedVoice.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetPedVoice -client: +shared: name: resetPedVoice description: Resets the voice of a ped to a default one. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose voice to reset. examples: - path: examples/resetPedVoice-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true when the voice was successfully reset, false otherwise. + oop: + element: ped + method: resetVoice + static: false notes: - type: info content: A ped voice is one of the GTA built in voice character types. Not to be confused with a player voice . - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedAimTarget.yaml b/functions/Ped/setPedAimTarget.yaml index 9ef04c9f..8c6908af 100644 --- a/functions/Ped/setPedAimTarget.yaml +++ b/functions/Ped/setPedAimTarget.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedAimTarget -client: +shared: name: setPedAimTarget description: This function allows you to set a ped's aim target to a specific point. If a ped is within a certain range defined by [getPedTargetStart](/wiki/GetPedTargetStart "GetPedTargetStart") and [getPedTargetEnd](/wiki/GetPedTargetEnd "GetPedTargetEnd") he will be targeted and shot. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose target you want to set. Only peds and remote players + will work; this function has no effect on the local player. + - name: x + type: float + description: The x coordinate of the aim target point. + - name: "y" + type: float + description: The y coordinate of the aim target point. + - name: z + type: float + description: The z coordinate of the aim target point. examples: - path: examples/setPedAimTarget-1.lua description: Example 1:This example creates a ped in the middle of the map and @@ -15,4 +28,9 @@ client: description: Example 2:This example creates a ped at grove street that will shoot at anything that enters a certain marker. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Ped/setPedAnalogControlState.yaml b/functions/Ped/setPedAnalogControlState.yaml index 55a717df..fe86702f 100644 --- a/functions/Ped/setPedAnalogControlState.yaml +++ b/functions/Ped/setPedAnalogControlState.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedAnalogControlState -client: +shared: name: setPedAnalogControlState description: Sets an analog state of a specified [ped](/wiki/Ped "Ped")'s control, as if they pressed or released it. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you wish to set the control state of. + - name: control + type: string + description: The control that you want to set the state of. See control names + for a list of possible controls. + - name: state + type: float + description: A float between 0 and 1 indicating the amount the control is pressed. examples: - path: examples/setPedAnalogControlState-1.lua description: This example uses setPedAnalogControlState to very slowly accelerate a ped-controlled NRG-500. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the control state was successfully set, false otherwise. + requires_review: true diff --git a/functions/Ped/setPedAnimation.yaml b/functions/Ped/setPedAnimation.yaml index d00c9afb..43330d57 100644 --- a/functions/Ped/setPedAnimation.yaml +++ b/functions/Ped/setPedAnimation.yaml @@ -1,10 +1,53 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedAnimation -server: +shared: name: setPedAnimation description: Sets the current [animation](/wiki/Animations "Animations") of a [player](/wiki/Player "Player") or [ped](/wiki/Ped "Ped"). Not specifying the type of animation will automatically cancel the current one. - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to apply an animation to. + - name: block + type: string + description: the animation block's name. + default: nil + - name: anim + type: string + description: the name of the animation within the block. + default: nil + - name: time + type: int + description: how long the animation will run for in milliseconds. + default: '-1' + - name: loop + type: bool + description: indicates whether or not the animation will loop. + default: 'true' + - name: updatePosition + type: bool + description: will change the actual coordinates of the ped according to the animation. + Use this for e.g. walking animations. + default: 'true' + - name: interruptable + type: bool + description: if set to false other tasks wont be able to interupt the animation. + Setting this to 'false' also gives this function more power to override other + animations that are running. For example, squatting after a jump can be terminated. + default: 'true' + - name: freezeLastFrame + type: bool + description: if set to true after animation the last frame will be frozen, otherwise + the animation will end and controls will return. + default: 'true' + - name: blendTime + type: int + description: how long the animation will mixed with the previous one in milliseconds. + default: '250' + - name: retainPedState + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setPedAnimation-1.lua description: 'This example creates a ped, rotates him, and makes him walk:' @@ -13,25 +56,34 @@ server: description: This example makes the player sit down and stand up using the command /sit. side: server + returns: + values: + - type: bool + name: value + description: Returns true if succesful, false otherwise. + oop: + element: ped + method: setAnimation + static: false pair: getPedAnimation notes: - type: warning content: It is possible that an animation will be cancelled if you use setElementFrozen on the ped, but this does not happen all the time. issues: - - id: '1110' + - id: 1110 description: retainPedState in setPedAnimation() does not work when latency reduction is set to 1 - - id: '953' + - id: 953 description: setPedAnimation() "interrupt" and "time" has no effect in certain situations - - id: '467' + - id: 467 description: Ped animations don't sync for new players - - id: '463' + - id: 463 description: setPedAnimation() does not work when a ped is attached and floating in air - - id: '1173' + - id: 1173 description: setPedAnimation() removes player jetpack - - id: '884' + - id: 884 description: setPedAnimation() messes up collisions of peds inside vehicles - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedAnimationProgress.yaml b/functions/Ped/setPedAnimationProgress.yaml index f793f38d..c9686d99 100644 --- a/functions/Ped/setPedAnimationProgress.yaml +++ b/functions/Ped/setPedAnimationProgress.yaml @@ -1,11 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress -server: +shared: name: setPedAnimationProgress description: Sets the current animation progress of a player or ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to change animation progress. + - name: anim + type: string + description: the animation name currently applied to ped, if not supplied, the + animation will stop + - name: progress + type: float + description: current animation progress you want to apply, value from 0.0 to 1.0, + if not supplied will default to 0.0 examples: - path: examples/setPedAnimationProgress-1.lua description: This example creates a ped, apply animation to it, and "freeze" the animation at half of overall animation time. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: ped + method: setAnimationProgress + static: false + requires_review: true diff --git a/functions/Ped/setPedAnimationSpeed.yaml b/functions/Ped/setPedAnimationSpeed.yaml index 6592e77d..19a5f879 100644 --- a/functions/Ped/setPedAnimationSpeed.yaml +++ b/functions/Ped/setPedAnimationSpeed.yaml @@ -1,15 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedAnimationSpeed -server: +shared: name: setPedAnimationSpeed description: Sets the speed of a currently running animation for a particular player or ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the player or ped you want to change animation speed of. + - name: anim + type: string + description: the animation name it will affect. + default: '""' + - name: speed + type: float + description: a float containing the speed between 0.0–1.0 you want to apply to + the animation. This limitation may be adjusted in the future, so do not provide + speeds outside this boundary. The limit is now 0.0 to 10.0. + default: '1.0' examples: - path: examples/setPedAnimationSpeed-1.lua description: In this example we give the animation of dancing to the player and after 5 seconds it becomes 0.2s slower. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: ped + method: setAnimationSpeed + static: false notes: - type: important content: 'Warning: Setting speed higher than 1 can cause issues with some animations.' - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedArmor.yaml b/functions/Ped/setPedArmor.yaml index d9138779..915b04e9 100644 --- a/functions/Ped/setPedArmor.yaml +++ b/functions/Ped/setPedArmor.yaml @@ -1,11 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedArmor -server: +shared: name: setPedArmor description: 'This function allows you to set the armor value of a [ped](/wiki/Ped "Ped"). Function also added client\-side.' - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose armor you want to modify. + - name: armor + type: float + description: the amount of armor you want to set on the ped. Valid values are + from 0 to 100. examples: - path: examples/setPedArmor-1.lua description: This example removes the armor of a player. @@ -14,5 +21,17 @@ server: description: In this, adds an amount of armor that the player defined in command 'addarmor'. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the armor was changed succesfully. Returns false + if an invalid ped was specified, or the armor value specified is out of acceptable + range. + oop: + element: ped + method: setArmor + variable: armor + static: false pair: getPedArmor - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedBleeding.yaml b/functions/Ped/setPedBleeding.yaml index 2a7ffbcd..9f018b90 100644 --- a/functions/Ped/setPedBleeding.yaml +++ b/functions/Ped/setPedBleeding.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedBleeding -client: +shared: name: setPedBleeding description: This function allows you to set [player's](/wiki/Player "Player") or [ped's](/wiki/Ped "Ped") bleeding effect. - parameters: [] + parameters: + - name: thePed + type: ped + description: The player or ped whose bleeding effect you want to set of. + - name: bleeding + type: bool + description: Boolean specifying whether the player or ped is bleeding or not. examples: - path: examples/setPedBleeding-1.lua description: This example causes the player to bleed. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the bleeding state was successfully set, false otherwise. + oop: + element: ped + method: setBleeding + variable: bleeding + static: false pair: isPedBleeding - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedCameraRotation.yaml b/functions/Ped/setPedCameraRotation.yaml index 1275d02f..5e26493d 100644 --- a/functions/Ped/setPedCameraRotation.yaml +++ b/functions/Ped/setPedCameraRotation.yaml @@ -1,19 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedCameraRotation -client: +shared: name: setPedCameraRotation description: This function sets the camera rotation of a ped, e.g. where its camera will look at. Don't confuse this with [getCameraMatrix](/wiki/GetCameraMatrix "GetCameraMatrix"), because that function is designed for fixed (scripted) camera moves. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose camera rotation is to be changed. + - name: cameraRotation + type: float + description: The new direction that the ped will walk if you set their forwards + control state. If the ped is the local player, it will also change where his + camera is looking at if it isn't fixed (i.e. camera target is the local player). examples: - path: examples/setPedCameraRotation-1.lua description: The next code snippet adds a command called /rotatecam, which rotates the camera of the player who uses it. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the camera rotation was changed, false otherwise. + oop: + element: ped + method: setCameraRotation + variable: cameraRotation + static: false pair: getPedCameraRotation notes: - type: info content: getPedCameraRotation may not return the value set by this function. Please refer to getPedCameraRotation for details. - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedCanBeKnockedOffBike.yaml b/functions/Ped/setPedCanBeKnockedOffBike.yaml index 90f8f271..d44ac749 100644 --- a/functions/Ped/setPedCanBeKnockedOffBike.yaml +++ b/functions/Ped/setPedCanBeKnockedOffBike.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedCanBeKnockedOffBike -client: +shared: name: setPedCanBeKnockedOffBike description: This function controls if a ped can fall of his bike by accident \- namely by banging into a wall. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose knockoffstatus is being changed + - name: canBeKnockedOffBike + type: bool + description: true or false examples: - path: examples/setPedCanBeKnockedOffBike-1.lua description: This example adds a console command with which the local player can toggle if he can fall off bikes. side: client + returns: + values: + - type: bool + name: value + oop: + element: ped + method: setCanBeKnockedOffBike + static: false pair: canPedBeKnockedOffBike notes: - type: info @@ -18,4 +32,4 @@ client: - type: info content: The ped will not get knocked off a bike that is set damage proof through setVehicleDamageProof . Refer to the note on that method for more information. - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedChoking.yaml b/functions/Ped/setPedChoking.yaml index 1dd62353..7743a118 100644 --- a/functions/Ped/setPedChoking.yaml +++ b/functions/Ped/setPedChoking.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedChoking -server: +shared: name: setPedChoking description: This function can be used to force the ped to do the choking (coughing) animation until he respawns or toggled off using this function. The animation can not be cancelled by a player it's applied to, and he will not loose health. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose choking status to toggle + - name: choking + type: bool + description: true to make the ped choke, false to no longer force his choking + animation examples: - path: examples/setPedChoking-1.lua description: This script will make all players choke on resource start side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise (e.g. player handle is + invalid) + oop: + element: ped + method: setChoking + variable: choking + static: false pair: isPedChoking - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedControlState.yaml b/functions/Ped/setPedControlState.yaml index 04806778..ac460cbd 100644 --- a/functions/Ped/setPedControlState.yaml +++ b/functions/Ped/setPedControlState.yaml @@ -1,13 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedControlState -client: +shared: name: setPedControlState description: This function makes a [ped](/wiki/Ped "Ped") or [player](/wiki/Player "Player") press or release a certain [control](/wiki/Control_names "Control names"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped you want to press or release a control. + - name: control + type: string + description: the name of the control of which to change the state. See control + names for a list of valid names. + - name: state + type: bool + description: the new control state. true means pressed, false is released. examples: - path: examples/setPedControlState-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false if otherwise. + oop: + element: ped + method: setControlState + static: false notes: - type: info content: You can't use enter_exit or enter_passenger on a ped. Please use setPedEnterVehicle @@ -24,4 +43,4 @@ client: client calls setPedControlState on the ped. The other game clients - the ones where setPedControlState was not manually called by scripts - will see the ped teleport around. It will clearly look as if synchronization were broken. - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedDoingGangDriveby.yaml b/functions/Ped/setPedDoingGangDriveby.yaml index 9874b594..d852d3b0 100644 --- a/functions/Ped/setPedDoingGangDriveby.yaml +++ b/functions/Ped/setPedDoingGangDriveby.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedDoingGangDriveby -server: +shared: name: setPedDoingGangDriveby description: This function sets the driveby state of a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped element whose state is to be changed. + - name: state + type: bool + description: A boolean value representing the drive-by state, true meaning enabled + and false disabled. examples: - path: examples/setPedDoingGangDriveby-1.lua description: This example turns on driveby mode when the local player typesdrivebyin the console. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the driveby state could be changed, false otherwise. + requires_review: true diff --git a/functions/Ped/setPedEnterVehicle.yaml b/functions/Ped/setPedEnterVehicle.yaml index bdd32b3f..e9d8a8fc 100644 --- a/functions/Ped/setPedEnterVehicle.yaml +++ b/functions/Ped/setPedEnterVehicle.yaml @@ -1,9 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedEnterVehicle -client: +shared: name: setPedEnterVehicle description: This function makes a [ped](/wiki/Ped "Ped") enter a [vehicle](/wiki/Vehicle "Vehicle"), similar to the enter\_exit control state. - parameters: [] + parameters: + - name: thePed + type: ped + description: 'The player or ped to enter the vehicle. Note: The player must be + the local player. Note: The ped must be synced by the client. Use isElementSyncer + clientside to check if the client is syncing. Use setElementSyncer serverside + to change the syncer manually.' + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + default: nil + - name: passenger + type: bool + description: If set to true , the ped will enter as passenger in the nearest available + seat, otherwise he will enter as driver. + default: 'false' examples: - path: examples/setPedEnterVehicle-1.lua description: '' @@ -11,6 +26,11 @@ client: - path: examples/setPedEnterVehicle-2.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. notes: - type: info content: This function only works on synced peds and vehicles (ie. created serverside). @@ -30,4 +50,4 @@ client: the respective seat while the ped is running toward it. Exception: If the ped is forced to enter as a passenger and is going to use the front door, the ped can wait if someone is using it to go the driver seat.' - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedExitVehicle.yaml b/functions/Ped/setPedExitVehicle.yaml index 9767e31a..140a01d2 100644 --- a/functions/Ped/setPedExitVehicle.yaml +++ b/functions/Ped/setPedExitVehicle.yaml @@ -1,14 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedExitVehicle -client: +shared: name: setPedExitVehicle description: This function makes a [ped](/wiki/Ped "Ped") exit a [vehicle](/wiki/Vehicle "Vehicle"), similar to the enter\_exit control state. - parameters: [] + parameters: + - name: thePed + type: ped + description: The player or ped to exit the vehicle. examples: - path: examples/setPedExitVehicle-1.lua description: This example adds a command to make all synced peds exit their vehicles. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. notes: - type: info content: This function only works on synced peds and vehicles (i.e. created server-side). - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedFightingStyle.yaml b/functions/Ped/setPedFightingStyle.yaml index 4f35ed69..ccb8cbd6 100644 --- a/functions/Ped/setPedFightingStyle.yaml +++ b/functions/Ped/setPedFightingStyle.yaml @@ -1,14 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedFightingStyle -server: +shared: name: setPedFightingStyle description: 'Changes a ped''s fighting style. Most styles only change the ''special attack'' which is done using the Aim and Enter keys. Function also added client\-side.' - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose fighting style to change. + - name: style + type: int + description: The fighting style ID to apply. examples: - path: examples/setPedFightingStyle-1.lua description: This example sets the player's fighting style to the desired style when he types "setstyle" followed by a number from 4 to 16 in console. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true in case of success, false otherwise. + requires_review: true diff --git a/functions/Ped/setPedFootBloodEnabled.yaml b/functions/Ped/setPedFootBloodEnabled.yaml index 3902bb6d..6fdf3601 100644 --- a/functions/Ped/setPedFootBloodEnabled.yaml +++ b/functions/Ped/setPedFootBloodEnabled.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedFootBloodEnabled -client: +shared: name: setPedFootBloodEnabled description: This function makes a [ped's](/wiki/Ped "Ped") footprints bloody. - parameters: [] + parameters: + - name: thePlayer + type: element + description: the ped to give bloody footprints to. + - name: enabled + type: bool + description: boolean specifying whether or not to have bloody feet. examples: - path: examples/setPedFootBloodEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if changing the ped's bloody feet status worked. + requires_review: true diff --git a/functions/Ped/setPedGravity.yaml b/functions/Ped/setPedGravity.yaml index dc7d0661..0d672e08 100644 --- a/functions/Ped/setPedGravity.yaml +++ b/functions/Ped/setPedGravity.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedGravity -server: +shared: name: setPedGravity description: This function sets the gravity level of a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped whose gravity to change. + - name: gravity + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setPedGravity-1.lua description: 'This example allows the user to type a command to change their gravity:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the gravity was successfully set, false otherwise + oop: + element: ped + method: setGravity + variable: gravity + static: false pair: getPedGravity - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedHeadless.yaml b/functions/Ped/setPedHeadless.yaml index 2bb08bf4..ee7ffc7a 100644 --- a/functions/Ped/setPedHeadless.yaml +++ b/functions/Ped/setPedHeadless.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedHeadless -server: +shared: name: setPedHeadless description: With this function, you can set if a ped has a head or not. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped to check. + - name: headState + type: bool + description: head state, use true if you want the ped be headless, use false to + give back the head. examples: - path: examples/setPedHeadless-1.lua description: This example enables a player to behead themselves (or give themselves their head back) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise + oop: + element: ped + method: setHeadless + variable: headless + static: false + requires_review: true diff --git a/functions/Ped/setPedLookAt.yaml b/functions/Ped/setPedLookAt.yaml index 287e3eea..22f7a380 100644 --- a/functions/Ped/setPedLookAt.yaml +++ b/functions/Ped/setPedLookAt.yaml @@ -1,14 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedLookAt -client: +shared: name: setPedLookAt description: Makes a ped turn his head and look at a specific world position or element. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped to change the lookat of. + - name: x + type: float + description: the x coordinate of the world position to look at. + - name: "y" + type: float + description: the y coordinate of the world position to look at. + - name: z + type: float + description: the z coordinate of the world position to look at. + - name: time + type: int + description: the time, in milliseconds, during which the ped will look at the + target. Once this time has elapsed, he will look ahead again like before the + function was applied. A time of 0 will immediately stop any lookat. A negative + time will make the ped look at the target indefinitely. + default: 3000 [, int blend = 1000 ] + - name: target + type: element + description: if this argument is specified, the position arguments will be mean + offsets relative to the target and the ped's gaze will follow the specified + element instead. Can be a player, a vehicle, another ped etc. + default: nil examples: - path: examples/setPedLookAt-1.lua description: This example makes the local player look at where the camera points at. If you want to sync this effect with other players you can usetriggerLatentServerEventandtriggerLatentClientEventfunctions. side: client + returns: + values: + - type: bool + name: value notes: - type: info content: Avoid calling setPedLookAt every frame as this can cause bugs like being @@ -16,8 +45,8 @@ client: - type: important content: For remote players, you have to use setPedAimTarget before setPedLookAt. issues: - - id: '509' + - id: 509 description: setPedLookAt does not work for remote players - - id: '626' + - id: 626 description: setPedLookAt cancels damage done by any sort of fire - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedOxygenLevel.yaml b/functions/Ped/setPedOxygenLevel.yaml index ef5301ea..78ff2046 100644 --- a/functions/Ped/setPedOxygenLevel.yaml +++ b/functions/Ped/setPedOxygenLevel.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedOxygenLevel -client: +shared: name: setPedOxygenLevel description: This function allows you to set the oxygen level of a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose oxygen level you want to modify. + - name: oxygen + type: float + description: the amount of oxygen you want to set on the ped . Native values are + from 0 to 1000. Each of the stamina (22) and underwater stamina (225) stat maximum + adds a bonus of 1500. So the maximum oxygen level is 4000. examples: - path: examples/setPedOxygenLevel-1.lua description: This example fills the local player's oxygen. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the oxygen level was changed succesfully. Returns + false if an invalid ped and/or oxygen level was specified. + oop: + element: ped + method: setOxygenLevel + variable: oxygenLevel + static: false pair: getPedOxygenLevel - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedStat.yaml b/functions/Ped/setPedStat.yaml index d3c688ce..a285c881 100644 --- a/functions/Ped/setPedStat.yaml +++ b/functions/Ped/setPedStat.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedStat -server: +shared: name: setPedStat description: This function allows you to set the value of a specific statistic for a [ped](/wiki/Ped "Ped"). **Visual stats (FAT and BODY\_MUSCLE) can only be used on the CJ skin**, they have no effect on other skins. When this function is used client\-side, it can only be used on client\-side created peds. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose statistic you want to modify. + - name: stat + type: int + description: the stat ID. + - name: value + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setPedStat-1.lua description: This example allows a player to type the command 'beefcake' to change @@ -16,7 +25,14 @@ server: description: This example adds a/upgradeskillscommand to give the player who types it the maximum skill with every weapon and maximum health. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the statistic was changed succesfully. Returns false + if an invalid player is specified, if the stat ID/value is out of acceptable + range or if the FAT or BODY_MUSCLE stats are used on non-CJ players. meta: - needs_checking: Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off. - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedTargetingMarkerEnabled.yaml b/functions/Ped/setPedTargetingMarkerEnabled.yaml index f9d0fdf4..ea920699 100644 --- a/functions/Ped/setPedTargetingMarkerEnabled.yaml +++ b/functions/Ped/setPedTargetingMarkerEnabled.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedTargetingMarkerEnabled -client: +shared: name: setPedTargetingMarkerEnabled description: This function is used to toggle the health target marker on top of all pedestrians. - parameters: [] + parameters: + - name: enabled + type: bool + description: A boolean denoting whether we want to enable ( true ) or disable + ( false ) the markers. examples: - path: examples/setPedTargetingMarkerEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the markers were enabled, false if weren't or if + invalid arguments are passed. + requires_review: true diff --git a/functions/Ped/setPedVoice.yaml b/functions/Ped/setPedVoice.yaml index b173b6aa..b6ba9647 100644 --- a/functions/Ped/setPedVoice.yaml +++ b/functions/Ped/setPedVoice.yaml @@ -1,14 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedVoice -client: +shared: name: setPedVoice description: Changes the voice of a ped. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose voice to change. + - name: voiceType + type: string + description: the voice type. See ped voices for possible types. + - name: voiceName + type: string + description: the voice name within the specified type. See ped voices for possible + voices. examples: - path: examples/setPedVoice-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true when the voice was successfully set, false otherwise. + oop: + element: ped + method: setVoice + static: false notes: - type: info content: A ped voice is one of the GTA built in voice character types. Not to be confused with a player voice . - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedWalkingStyle.yaml b/functions/Ped/setPedWalkingStyle.yaml index 6d8f0eaa..fbe70ef8 100644 --- a/functions/Ped/setPedWalkingStyle.yaml +++ b/functions/Ped/setPedWalkingStyle.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedWalkingStyle -server: +shared: name: setPedWalkingStyle description: Sets the walking style of a ped. A walking style consists of a set of animations that are used for walking, running etc. - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose walking style to change. + - name: style + type: int + description: the walking style to set. examples: - path: examples/setPedWalkingStyle-1.lua description: Changes the walking style of the player to Drunkman when the resource is started side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: ped + method: setWalkingStyle + variable: walkingStyle + static: false pair: getPedWalkingStyle - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedWeaponSlot.yaml b/functions/Ped/setPedWeaponSlot.yaml index 2bdfa2ab..90e421b9 100644 --- a/functions/Ped/setPedWeaponSlot.yaml +++ b/functions/Ped/setPedWeaponSlot.yaml @@ -1,9 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedWeaponSlot -server: +shared: name: setPedWeaponSlot description: This function changes the selected weapon slot of a [ped](/wiki/Ped "Ped"). - parameters: [] + parameters: + - name: thePed + type: ped + description: the ped whose weapon slot you want to set. In a clientside script, + this cannot be used on remote players. + - name: weaponSlot + type: int + description: the weapon slot to set. examples: - path: examples/setPedWeaponSlot-1.lua description: This example allows the player to type the command 'giveweapons', @@ -11,5 +18,16 @@ server: given weapon, the script randomly decides which weapon to equip after all the weapons are given. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful in setting the ped's equipped weapon slot, + false otherwise. + oop: + element: ped + method: setWeaponSlot + variable: weaponSlot + static: false pair: getPedWeaponSlot - incomplete: true + requires_review: true diff --git a/functions/Ped/setPedWearingJetpack.yaml b/functions/Ped/setPedWearingJetpack.yaml index 8d6bd7fe..eeb1ee5b 100644 --- a/functions/Ped/setPedWearingJetpack.yaml +++ b/functions/Ped/setPedWearingJetpack.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedWearingJetpack -server: +shared: name: setPedWearingJetpack description: This function is used to give or take a jetpack from a ped, it won't work if the ped is in a vehicle. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped you want to give a jetpack to. + - name: state + type: bool + description: A boolean representing whether to give or take the jetpack. examples: - path: examples/setPedWearingJetpack-1.lua description: This examples adds a "jetpack" console command, which toggles a jetpack for the player. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if a jetpack was successfully set for the ped, false + if setting it failed. + oop: + element: ped + method: setWearingJetpack + variable: jetpack + static: false + requires_review: true diff --git a/functions/Ped/warpPedIntoVehicle.yaml b/functions/Ped/warpPedIntoVehicle.yaml index a1952c47..1350bf3b 100644 --- a/functions/Ped/warpPedIntoVehicle.yaml +++ b/functions/Ped/warpPedIntoVehicle.yaml @@ -1,19 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle -server: +shared: name: warpPedIntoVehicle description: This function is used to warp or force a ped into a vehicle. There are no animations involved when this happens. - parameters: [] + parameters: + - name: thePed + type: ped + description: The ped which you wish to force inside the vehicle + - name: theVehicle + type: vehicle + description: The vehicle you wish to force the ped into + - name: seat + type: int + description: 'An integer representing the seat ID. 0: Front-left 1: Front-right + 2: Rear-left 3: Rear-right' + default: '0' examples: - path: examples/warpPedIntoVehicle-1.lua description: This example creates a vehicle and warps a ped inside immediately. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the operation is successful, false otherwise. + oop: + element: ped + note: Set the variable to nil to executeremovePedFromVehicle + method: warpIntoVehicle + variable: vehicle + static: false pair: getPedOccupiedVehicle notes: - type: important content: If you used setElementPosition to spawn the ped / player , this function will not work and returns false . issues: - - id: '475' + - id: 475 description: Network trouble when calling warpPedIntoVehicle on resourceStart - incomplete: true + requires_review: true diff --git a/functions/Pickup/createPickup.yaml b/functions/Pickup/createPickup.yaml index 437f2427..f1d84cc4 100644 --- a/functions/Pickup/createPickup.yaml +++ b/functions/Pickup/createPickup.yaml @@ -1,9 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreatePickup -server: +shared: name: createPickup description: This function creates a pickup element, which is placed in the GTA world and can be picked up to retrieve a health, armour or a weapon. - parameters: [] + parameters: + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: theType + type: int + description: 'This is an integer representing the type of pickup, representing + the following types: 0 : Health Pickup 1 : Armour Pickup 2 : Weapon Pickup 3 + : Custom Pickup' + - name: amount/weapon/model + type: int + description: MISSING_PARAM_DESC + - name: respawnTime + type: int + description: How long before the pickup respawns in milliseconds ( This parameter + is ignored on the client! ) + default: '30000' + - name: ammo + type: int + description: An integer representing the amount of ammo a pickup contains. This + is only valid when the pickup type is a weapon pickup. + default: '50' examples: - path: examples/createPickup-1.lua description: This example creates a pickup after a player dies so that he drops @@ -13,4 +40,14 @@ server: description: This example creates a custom pickup(money) after a player dies and sets it's value. side: server - incomplete: true + returns: + values: + - type: pickup + name: value + description: Returns pickup element if the pickup was created succesfully, otherwise + returns false . + oop: + element: Pickup( + method: '' + static: true + requires_review: true diff --git a/functions/Pickup/getPickupAmmo.yaml b/functions/Pickup/getPickupAmmo.yaml index 2c98a09b..8e70f5ae 100644 --- a/functions/Pickup/getPickupAmmo.yaml +++ b/functions/Pickup/getPickupAmmo.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPickupAmmo -server: +shared: name: getPickupAmmo description: This function retrieves the amount of ammo in a weapon pickup. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup in which you wish to retrieve the ammo of examples: - path: examples/getPickupAmmo-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer of the amount of ammo in the pickup, false if + the pickup element is invalid, 0 if it's no weapon pickup. + requires_review: true diff --git a/functions/Pickup/getPickupAmount.yaml b/functions/Pickup/getPickupAmount.yaml index 0adcaf2c..2f2a92ef 100644 --- a/functions/Pickup/getPickupAmount.yaml +++ b/functions/Pickup/getPickupAmount.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPickupAmount -server: +shared: name: getPickupAmount description: This function retrieves the amount of health or armor given from a pickup. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup you wish to retrieve the amount from. examples: - path: examples/getPickupAmount-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer of the amount the pickup is set to, false if it's + invalid, 0 if it's no health or amor pickup. + requires_review: true diff --git a/functions/Pickup/getPickupRespawnInterval.yaml b/functions/Pickup/getPickupRespawnInterval.yaml index 172a7ba7..a2dcb1f9 100644 --- a/functions/Pickup/getPickupRespawnInterval.yaml +++ b/functions/Pickup/getPickupRespawnInterval.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPickupRespawnInterval -server: +shared: name: getPickupRespawnInterval description: Returns the time it takes before a pickup respawns after a player picked it up. The time is specified in milliseconds. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: the pickup you want the respawn time of examples: - path: examples/getPickupRespawnInterval-1.lua description: This example outputs to the player that picked up the pickup, that it's not going to spawn again for another ... secs. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the respawn time of the pickup if successful, false in case + of failure. + requires_review: true diff --git a/functions/Pickup/getPickupType.yaml b/functions/Pickup/getPickupType.yaml index d660bf30..28e8ef82 100644 --- a/functions/Pickup/getPickupType.yaml +++ b/functions/Pickup/getPickupType.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPickupType -server: +shared: name: getPickupType description: This function retrieves the type of a pickup, either a health, armour or weapon pickup. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup you wish to retrieve the type of. examples: - path: examples/getPickupType-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: 'Returns false if the pickup is invalid, or an integer of the type + of the pickup, which include:' + requires_review: true diff --git a/functions/Pickup/getPickupWeapon.yaml b/functions/Pickup/getPickupWeapon.yaml index e970949f..16467178 100644 --- a/functions/Pickup/getPickupWeapon.yaml +++ b/functions/Pickup/getPickupWeapon.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPickupWeapon -server: +shared: name: getPickupWeapon description: This function retrieves the weapon ID of a weapon pickup. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup of which you wish to retrieve the weapon examples: - path: examples/getPickupWeapon-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the Weapon ID of the pickup, or false if the pickup is invalid. + requires_review: true diff --git a/functions/Pickup/isPickupSpawned.yaml b/functions/Pickup/isPickupSpawned.yaml index e8b18efc..78e4d790 100644 --- a/functions/Pickup/isPickupSpawned.yaml +++ b/functions/Pickup/isPickupSpawned.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPickupSpawned -server: +shared: name: isPickupSpawned description: This function checks if a pickup is currently spawned (is visible and can be picked up) or not (a player picked it up recently). - parameters: [] + parameters: + - name: thePickup + type: pickup + description: the pickup you want to check. examples: - path: examples/isPickupSpawned-1.lua description: This example outputs to the player that' using the pick that the pickup is either available/unavailable. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the pickup is spawned, false if it's not spawned + or an invalid pickup was specified. + requires_review: true diff --git a/functions/Pickup/setPickupRespawnInterval.yaml b/functions/Pickup/setPickupRespawnInterval.yaml index 4d458cbe..cacab15b 100644 --- a/functions/Pickup/setPickupRespawnInterval.yaml +++ b/functions/Pickup/setPickupRespawnInterval.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPickupRespawnInterval -server: +shared: name: setPickupRespawnInterval description: Sets the time it takes for a pickup to respawn after a player picked it up. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: the pickup to set the respawn time of + - name: ms + type: int + description: the new respawn time in ms examples: - path: examples/setPickupRespawnInterval-1.lua description: This example adds 3000ms to the current pickup respawn time. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the new respawn time was set successfully, false + otherwise. + requires_review: true diff --git a/functions/Pickup/setPickupType.yaml b/functions/Pickup/setPickupType.yaml index 0a70064c..152a6a42 100644 --- a/functions/Pickup/setPickupType.yaml +++ b/functions/Pickup/setPickupType.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPickupType -server: +shared: name: setPickupType description: This function allows changing the type of a pickup to a Weapon, Armour or Health pickup, and allows you to set the health points **or** the weapon and ammo that the pickup will give. - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup which you wish to change the settings of + - name: theType + type: int + description: 'An integer representing the type of pickup. You can choose from: + 0 : Health Pickup 1 : Armour Pickup 2 : Weapon Pickup 3 : Custom Pickup' + - name: amount/weapon/model + type: int + description: MISSING_PARAM_DESC + - name: ammo + type: int + description: An integer representing the amount of ammo a pickup contains. This + argument is only valid when the pickup type is a Weapon Pickup, and must be + specified in that case. examples: - path: examples/setPickupType-1.lua description: '' @@ -12,4 +27,9 @@ server: - path: examples/setPickupType-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/Pickup/usePickup.yaml b/functions/Pickup/usePickup.yaml index 7b99a23e..dd7c00f4 100644 --- a/functions/Pickup/usePickup.yaml +++ b/functions/Pickup/usePickup.yaml @@ -1,10 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UsePickup -server: +shared: name: usePickup description: This function is used to simulate the player using a pickup - parameters: [] + parameters: + - name: thePickup + type: pickup + description: The pickup element to be picked up/used. + - name: thePlayer + type: player + description: The player to use the pickup. examples: - path: examples/usePickup-1.lua description: This example gives a random player 100% armor by using a pickup. side: server - incomplete: true + returns: + values: + - type: bool + name: value + requires_review: true diff --git a/functions/Player/countPlayersInTeam.yaml b/functions/Player/countPlayersInTeam.yaml index d461f6ac..a0a4c312 100644 --- a/functions/Player/countPlayersInTeam.yaml +++ b/functions/Player/countPlayersInTeam.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CountPlayersInTeam -server: +shared: name: countPlayersInTeam description: This function is for returning the number of players in the specified team. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team you wish to retrieve the player count of. examples: - path: examples/countPlayersInTeam-1.lua description: This example adds a command in the console to find out how many players @@ -19,4 +22,15 @@ server: joins the server, or for all players currently in the server when the gamemode starts. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer containing the number of players in the team, + false if it could not be retrieved. + oop: + element: team + method: countPlayers + variable: playerCount + static: false + requires_review: true diff --git a/functions/Player/forcePlayerMap.yaml b/functions/Player/forcePlayerMap.yaml index 65156cff..53ee0e02 100644 --- a/functions/Player/forcePlayerMap.yaml +++ b/functions/Player/forcePlayerMap.yaml @@ -1,12 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ForcePlayerMap +client: + name: forcePlayerMap + description: This function is used to forcefully show a player's map (F11\). + parameters: + - name: forceOn + type: bool + description: A boolean value representing whether or not the player's map will + be forced on + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the player's map was forced on, false otherwise. + oop: &id001 + element: player + method: forceMap + variable: mapForced + static: false + pair: isPlayerMapForced + requires_review: true server: name: forcePlayerMap description: This function is used to forcefully show a player's map (F11\). - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player + - name: forceOn + type: bool + description: A boolean value representing whether or not the player's map will + be forced on examples: - path: examples/forcePlayerMap-1.lua description: This example forces the map to show for the player named "dave" on for 10 seconds, if it hasn't been already. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player's map was forced on, false otherwise. + oop: *id001 pair: isPlayerMapForced - incomplete: true + requires_review: true diff --git a/functions/Player/getAlivePlayers.yaml b/functions/Player/getAlivePlayers.yaml index 779c131a..c44dcf09 100644 --- a/functions/Player/getAlivePlayers.yaml +++ b/functions/Player/getAlivePlayers.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAlivePlayers -server: +shared: name: getAlivePlayers description: This function returns a table of all the alive players on the server. Opposite function of [getDeadPlayers](/wiki/GetDeadPlayers "GetDeadPlayers"). @@ -9,4 +9,13 @@ server: description: This example prints a list of all alive players in a "name, name2, name3" format. If no players are alive then it outputs "none". side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the alive players. + oop: + element: Player + method: ) + static: true + requires_review: true diff --git a/functions/Player/getControlState.yaml b/functions/Player/getControlState.yaml index cbeff227..53b4bc8d 100644 --- a/functions/Player/getControlState.yaml +++ b/functions/Player/getControlState.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetControlState -server: +shared: name: getControlState description: This function will check if a player is pressing a particular control. Controls are those that affect GTA. If you wish to get the state of another key, use [bindKey](/wiki/BindKey "BindKey") and a command function. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to get the control state of. Do not use this + parameter when scripting for client. + - name: controlName + type: string + description: The control that you want to get the state of. See control names + for a list of possible controls. examples: - path: examples/getControlState-1.lua description: This example starts a repeating check when a player spawns, if a player presses the fire key, they'll be killed. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns the state of the control, false if the control doesn't exist + or if the player is dead. + requires_review: true diff --git a/functions/Player/getDeadPlayers.yaml b/functions/Player/getDeadPlayers.yaml index 0327be84..394ac2fd 100644 --- a/functions/Player/getDeadPlayers.yaml +++ b/functions/Player/getDeadPlayers.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetDeadPlayers -server: +shared: name: getDeadPlayers description: This function returns a table of all currently dead players on the server. @@ -8,4 +8,13 @@ server: - path: examples/getDeadPlayers-1.lua description: This example prints the list of dead players to the chat box. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the dead players. + oop: + element: Player + method: ) + static: true + requires_review: true diff --git a/functions/Player/getLocalPlayer.yaml b/functions/Player/getLocalPlayer.yaml index ff43c06b..e135b3f0 100644 --- a/functions/Player/getLocalPlayer.yaml +++ b/functions/Player/getLocalPlayer.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLocalPlayer -client: +shared: name: getLocalPlayer description: This function gets the player element of the client running the current script. @@ -13,4 +13,9 @@ client: description: Example 2:This client side script makes the local player's camera flash red after being hit. side: client - incomplete: true + returns: + values: + - type: player + name: value + description: Returns the local player element. + requires_review: true diff --git a/functions/Player/getPlayerAnnounceValue.yaml b/functions/Player/getPlayerAnnounceValue.yaml index 4e2d3b4f..dbb19a36 100644 --- a/functions/Player/getPlayerAnnounceValue.yaml +++ b/functions/Player/getPlayerAnnounceValue.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerAnnounceValue -server: +shared: name: getPlayerAnnounceValue description: This function retrieves a players ASE announce value under a certain key. - parameters: [] + parameters: + - name: thePlayer + type: element + description: This is the Player whos value you want to retrieve. + - name: key + type: string + description: The name of the key. examples: - path: examples/getPlayerAnnounceValue-1.lua description: This example adds a command named "getscore" which outputs a players "score" value to his chatbox. side: server + returns: + values: + - type: string + name: value + description: This function returns a string containing the requested value if + a valid key was specified or false otherwise. + oop: + element: player + method: getAnnounceValue + static: false pair: setPlayerAnnounceValue - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerBlurLevel.yaml b/functions/Player/getPlayerBlurLevel.yaml index 28e60f4d..54d97f95 100644 --- a/functions/Player/getPlayerBlurLevel.yaml +++ b/functions/Player/getPlayerBlurLevel.yaml @@ -1,13 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerBlurLevel -server: +client: name: getPlayerBlurLevel description: This function allows you to check the current blur level of a specified [player](/wiki/Player "Player"). parameters: [] + examples: [] + returns: + values: + - type: int + name: value + description: Returns the local blur level. + oop: &id001 + element: player + method: getBlurLevel + static: false + pair: setPlayerBlurLevel + requires_review: true +server: + name: getPlayerBlurLevel + description: This function allows you to check the current blur level of a specified + [player](/wiki/Player "Player"). + parameters: + - name: thePlayer + type: player + description: The player whose blur level you want to check. examples: - path: examples/getPlayerBlurLevel-1.lua description: This example adds a commandblurlevelwith which you can check your current blur level. side: server + returns: + values: + - type: int + name: value + description: Returns the player's blur level if successful, false if an invalid + player was given. + oop: *id001 pair: setPlayerBlurLevel - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerCount.yaml b/functions/Player/getPlayerCount.yaml index 9add13e2..4671d6a6 100644 --- a/functions/Player/getPlayerCount.yaml +++ b/functions/Player/getPlayerCount.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerCount -server: +shared: name: getPlayerCount description: This function returns the number of players currently connected to the server. @@ -9,11 +9,19 @@ server: description: This example displays a chat message with the number of players connected to the server when a player joins or quits. side: server + returns: + values: + - type: int + name: value + description: Returns the number of players connected to the server as an int . + oop: + element: Player + method: ) + static: true notes: - type: info content: '#getElementsByType("player") works the same as this function but also works client side unlike this function.' - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -21,3 +29,4 @@ server: - Missing section: Shared implementation of getPlayerCount ' + requires_review: true diff --git a/functions/Player/getPlayerFromName.yaml b/functions/Player/getPlayerFromName.yaml index dc72bc1e..5c16ebd9 100644 --- a/functions/Player/getPlayerFromName.yaml +++ b/functions/Player/getPlayerFromName.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerFromName -server: +shared: name: getPlayerFromName description: This function returns a [player](/wiki/Player "Player") [element](/wiki/Element "Element") for the player with the name passed to the function. - parameters: [] + parameters: + - name: playerName + type: string + description: A string containing the name of the player you want to reference examples: - path: examples/getPlayerFromName-1.lua description: 'This example finds aplayeras specified in the command and outputs the direction and distance he is from the player who entered the command. For example: ''locate someguy''.' side: server - incomplete: true + returns: + values: + - type: player + name: value + description: Returns a player element for the player with the nickname provided. + If there is no player with that name, false is returned. + oop: + element: player + constructorclass: Player + requires_review: true diff --git a/functions/Player/getPlayerHudComponentProperty.yaml b/functions/Player/getPlayerHudComponentProperty.yaml index 5a00a491..e286b439 100644 --- a/functions/Player/getPlayerHudComponentProperty.yaml +++ b/functions/Player/getPlayerHudComponentProperty.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerHudComponentProperty -client: +shared: name: getPlayerHudComponentProperty description: This function gets the value of the specified HUD property. - parameters: [] + parameters: + - name: component + type: string + description: The component whose property you want to retrieve. See HUD Components + . + - name: property + type: string + description: The name of the property you want to read. See HUD Properties . examples: - path: examples/getPlayerHudComponentProperty-1.lua description: '' side: client + returns: + values: + - type: mixed + name: value + description: Returns different values depending on the type. It can be bool , + string , int , int int , or int int int int . If something goes wrong, it returns + false . + oop: + element: player + method: getHudComponentProperty + static: false pair: setPlayerHudComponentProperty - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerIP.yaml b/functions/Player/getPlayerIP.yaml index 3b1b4227..22dc1797 100644 --- a/functions/Player/getPlayerIP.yaml +++ b/functions/Player/getPlayerIP.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerIP -server: +shared: name: getPlayerIP description: This function returns a [string](/wiki/String "String") containing the IP address of the [player](/wiki/Player "Player"). - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player element you want to get the IP of. examples: - path: examples/getPlayerIP-1.lua description: This example prints a player's IP to the chat. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the requested players's IP, or false + if the player passed to the function is invalid. + oop: + element: player + method: getIP + variable: ip + static: false + requires_review: true diff --git a/functions/Player/getPlayerIdleTime.yaml b/functions/Player/getPlayerIdleTime.yaml index c789ed0f..7d999c45 100644 --- a/functions/Player/getPlayerIdleTime.yaml +++ b/functions/Player/getPlayerIdleTime.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerIdleTime -server: +shared: name: getPlayerIdleTime description: This function gets the amount of time in milliseconds that a players position has not changed. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to get the idle time of. examples: - path: examples/getPlayerIdleTime-1.lua description: This example will kick a player if they don't move for 5 minutes and the resource has access to "function.kickPlayer" side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the amount of time in milliseconds that a player has been + idle, false otherwise. + oop: + element: player + method: getIdleTime + variable: idleTime + static: false + requires_review: true diff --git a/functions/Player/getPlayerMapBoundingBox.yaml b/functions/Player/getPlayerMapBoundingBox.yaml index ea811187..cf0e59d4 100644 --- a/functions/Player/getPlayerMapBoundingBox.yaml +++ b/functions/Player/getPlayerMapBoundingBox.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerMapBoundingBox -client: +shared: name: getPlayerMapBoundingBox description: This function gets the GUI bounding box of the player map (F11\) texture. parameters: [] @@ -13,4 +13,16 @@ client: with the left mouse button in the desired place in the F11 world map, and delete it by clicking with the right mouse button. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: This example draws the text "Center of SA map" in the F11 map screen + where the center of world coordinates is. + requires_review: true diff --git a/functions/Player/getPlayerMapOpacity.yaml b/functions/Player/getPlayerMapOpacity.yaml index 1d0a62bd..f4e774a0 100644 --- a/functions/Player/getPlayerMapOpacity.yaml +++ b/functions/Player/getPlayerMapOpacity.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerMapOpacity -client: +shared: name: getPlayerMapOpacity description: This function allows to get the opacity of the player map (F11\). parameters: [] @@ -8,4 +8,14 @@ client: description: This example implements a command that tells you what your current map opacity is. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer with a value from 0 to 255, where 0 is fully transparent + and 255 is fully opaque. + oop: + element: player + method: ) + static: true + requires_review: true diff --git a/functions/Player/getPlayerMoney.yaml b/functions/Player/getPlayerMoney.yaml index b2ce5e4d..574df391 100644 --- a/functions/Player/getPlayerMoney.yaml +++ b/functions/Player/getPlayerMoney.yaml @@ -1,16 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerMoney -server: +client: name: getPlayerMoney description: Returns the amount of money a player currently has. parameters: [] + examples: [] + returns: + values: + - type: int + name: value + description: Returns an integer with the amount of money the local player has. + oop: &id001 + element: player + method: getMoney + variable: money + static: false + pair: setPlayerMoney + notes: &id002 + - type: info + content: The amount may vary between the server and client, you shouldn't trust + the client side value to always be accurate. + requires_review: true +server: + name: getPlayerMoney + description: Returns the amount of money a player currently has. + parameters: + - name: thePlayer + type: player + description: The player you wish the retrieve the amount of money from. examples: - path: examples/getPlayerMoney-1.lua description: When a player types '/checkMoney' this example retrieves the player's money and outputs a message according to the value. side: server + returns: + values: + - type: int + name: value + description: Returns an integer with the amount of money the specified player + has, false if the player is invalid. + oop: *id001 pair: setPlayerMoney - notes: - - type: info - content: The amount may vary between the server and client, you shouldn't trust - the client side value to always be accurate. - incomplete: true + notes: *id002 + requires_review: true diff --git a/functions/Player/getPlayerName.yaml b/functions/Player/getPlayerName.yaml index 0509ba4c..8c40b21e 100644 --- a/functions/Player/getPlayerName.yaml +++ b/functions/Player/getPlayerName.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerName -server: +shared: name: getPlayerName description: This function returns a string containing the name of the specified player. - parameters: [] + parameters: + - name: thePlayer + type: player + description: the player you want to get the name of examples: - path: examples/getPlayerName-1.lua description: '' @@ -11,8 +14,18 @@ server: - path: examples/getPlayerName-2.lua description: This example outputs the local player name to the chatbox. side: client + returns: + values: + - type: string + name: value + description: Returns a string containing the requested player's name, or false + if the player passed to the function is invalid. + oop: + element: player + method: getName + variable: name + static: false pair: setPlayerName - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -20,3 +33,4 @@ server: - Missing section: Limits ' + requires_review: true diff --git a/functions/Player/getPlayerNametagColor.yaml b/functions/Player/getPlayerNametagColor.yaml index 43c00ce7..2240ba51 100644 --- a/functions/Player/getPlayerNametagColor.yaml +++ b/functions/Player/getPlayerNametagColor.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerNametagColor -server: +shared: name: getPlayerNametagColor description: This function gets the current color of a player's name tag as RGB values. These are in the range 0\-255\. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose name tag RGB color values you wish to retrieve. examples: - path: examples/getPlayerNametagColor-1.lua description: This console command will tell the player what his tag color is. The color is composed of a red, a green and a blue component, each ranging from 0-255. side: server + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: Returns red , green and blue values if an existent player was specified, + false otherwise. + oop: + element: player + method: getNametagColor + static: false pair: setPlayerNametagColor - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerNametagText.yaml b/functions/Player/getPlayerNametagText.yaml index f1b8bb16..82efac2f 100644 --- a/functions/Player/getPlayerNametagText.yaml +++ b/functions/Player/getPlayerNametagText.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerNametagText -server: +shared: name: getPlayerNametagText description: This will allow you to retrieve the name tag a player is currently using. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The person whose name tag you want to retrieve examples: - path: examples/getPlayerNametagText-1.lua description: This will output the nametag text of the player who enters the command 'myNametag'. side: server + returns: + values: + - type: string + name: value + description: Returns a string with the nametag text, false if the player is invalid. + oop: + element: player + method: getNametagText + variable: nametagText + static: false pair: setPlayerNametagText - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerPing.yaml b/functions/Player/getPlayerPing.yaml index 13ba7dd5..3fd7c25c 100644 --- a/functions/Player/getPlayerPing.yaml +++ b/functions/Player/getPlayerPing.yaml @@ -1,11 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerPing -server: +shared: name: getPlayerPing description: This function returns the ping of a specified [player](/wiki/Player "Player"). The ping is the number of milliseconds that data takes to travel from the player's client to the server or vice versa. If a player is using a VPN their ping will still be returned correctly. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose ping you want to determine. examples: - path: examples/getPlayerPing-1.lua description: This example checks every players ping every 5 seconds and if it's @@ -15,4 +18,14 @@ server: description: This example checks the ping of every player entering the 'ping' command and warns him if it's over 100. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the ping as an int , or false if the player is invalid. + oop: + element: player + method: getPing + variable: ping + static: false + requires_review: true diff --git a/functions/Player/getPlayerScriptDebugLevel.yaml b/functions/Player/getPlayerScriptDebugLevel.yaml index 764823a2..a664cd3b 100644 --- a/functions/Player/getPlayerScriptDebugLevel.yaml +++ b/functions/Player/getPlayerScriptDebugLevel.yaml @@ -1,11 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerScriptDebugLevel -server: +client: name: getPlayerScriptDebugLevel description: This will allow you to retrieve the player current debug script level. parameters: [] + examples: [] + returns: + values: + - type: int + name: value + description: Returns an int with the local player's debug script level. + oop: &id001 + element: player + method: getScriptDebugLevel + variable: scriptDebugLevel + static: false + pair: setPlayerScriptDebugLevel + requires_review: true +server: + name: getPlayerScriptDebugLevel + description: This will allow you to retrieve the player current debug script level. + parameters: + - name: thePlayer + type: player + description: The person whose debug script level you want examples: - path: examples/getPlayerScriptDebugLevel-1.lua description: Displays a message in the chat what is the player's debug level. side: server + returns: + values: + - type: int + name: value + description: Returns an int with the player debug script level, false if the player + is invalid. + oop: *id001 pair: setPlayerScriptDebugLevel - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerSerial.yaml b/functions/Player/getPlayerSerial.yaml index 98560bf5..abb09578 100644 --- a/functions/Player/getPlayerSerial.yaml +++ b/functions/Player/getPlayerSerial.yaml @@ -3,12 +3,25 @@ server: name: getPlayerSerial description: This function returns the [serial](/wiki/Serial "Serial") for a specified [player](/wiki/Player "Player"). - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player. examples: - path: examples/getPlayerSerial-1.lua description: This example creates a command with which player can check their own serial. side: server + returns: + values: + - type: string + name: value + description: Returns the serial as a string if it was found, false otherwise. + oop: + element: player + method: getSerial + variable: serial + static: false notes: - type: info content: It's possible for a player to fake the value returned from getPlayerSerial @@ -18,4 +31,4 @@ server: content: 'You should use this function in conjunction with account system (e.g: login & password ) - especially for critical things, because serials could be invalid (as in, non-unique or faked ). See: Script security .' - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerTeam.yaml b/functions/Player/getPlayerTeam.yaml index 704d39a0..8f67aa07 100644 --- a/functions/Player/getPlayerTeam.yaml +++ b/functions/Player/getPlayerTeam.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerTeam -server: +shared: name: getPlayerTeam description: This function gets the current [team](/wiki/Team "Team") a [player](/wiki/Player "Player") is on. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose team you want to find out. examples: - path: examples/getPlayerTeam-1.lua description: This example finds the team a player is on, and then changes its name. side: server + returns: + values: + - type: team + name: value + description: Returns a team element representing the team the player is on, false + if the player is not part of a team. + oop: + element: player + method: getTeam + variable: team + static: false pair: setPlayerTeam - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerVersion.yaml b/functions/Player/getPlayerVersion.yaml index d25f9d6c..83eb4cc1 100644 --- a/functions/Player/getPlayerVersion.yaml +++ b/functions/Player/getPlayerVersion.yaml @@ -1,15 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerVersion -server: +shared: name: getPlayerVersion description: "mta \\-\\> 1\\.6 \n\nnetcode \\-\\> 474 \n\nnumber \\-\\> 352 \n\ \nsortable \\-\\> 1\\.6\\.0\\-9\\.22279\\.0 \n\ntag \\-\\> 1\\.6\\-release\\\ -22279 \n\ntype \\-\\> Release" - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose client version you wish to get. examples: - path: examples/getPlayerVersion-1.lua description: This example adds a command that allows players to see their own client version. side: server + returns: + values: + - type: string + name: value + description: Returns a string containing the client version, or false if the player + is invalid. + oop: + element: player + method: getVersion + variable: version + static: false notes: - type: info content: You can also compare if a version is higher than another using the < @@ -20,4 +34,4 @@ server: - type: info content: Alternatively, you can use getVersion on the server or client to obtain more information. - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayerWantedLevel.yaml b/functions/Player/getPlayerWantedLevel.yaml index 6fde20b1..f6d6e73a 100644 --- a/functions/Player/getPlayerWantedLevel.yaml +++ b/functions/Player/getPlayerWantedLevel.yaml @@ -1,15 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayerWantedLevel -server: +client: name: getPlayerWantedLevel description: This function gets a player's current wanted level. The wanted level is indicated by the amount of stars a player has on the GTA HUD. parameters: [] examples: - - path: examples/getPlayerWantedLevel-1.lua - description: 'This example finds which players in the server have a wanted level:' - side: server - path: examples/getPlayerWantedLevel-2.lua description: This script output your wanted level when you type /wanted. side: client + returns: + values: + - type: int + name: value + description: Returns an int from 0 to 6 representing the player's wanted level, + false if the player does not exist. + oop: &id001 + element: player + method: getWantedLevel + variable: wantedLevel + static: false + pair: setPlayerWantedLevel + requires_review: true +server: + name: getPlayerWantedLevel + description: This function gets a player's current wanted level. The wanted level + is indicated by the amount of stars a player has on the GTA HUD. + parameters: + - name: thePlayer + type: player + description: The player whose wanted level you wish to get + examples: + - path: examples/getPlayerWantedLevel-1.lua + description: 'This example finds which players in the server have a wanted level:' + side: server + returns: + values: + - type: int + name: value + description: Returns an int from 0 to 6 representing the player's wanted level, + false if the player does not exist. + oop: *id001 pair: setPlayerWantedLevel - incomplete: true + requires_review: true diff --git a/functions/Player/getPlayersInTeam.yaml b/functions/Player/getPlayersInTeam.yaml index 37136f94..b162b45e 100644 --- a/functions/Player/getPlayersInTeam.yaml +++ b/functions/Player/getPlayersInTeam.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPlayersInTeam -server: +shared: name: getPlayersInTeam description: This function retrieves all the players of the specified team. - parameters: [] + parameters: + - name: theTeam + type: team + description: MISSING_PARAM_DESC examples: - path: examples/getPlayersInTeam-1.lua description: Find and kill all the players in the specified team (for example @@ -12,4 +15,15 @@ server: description: This example will show all players in a team when a player types the 'showTeam TeamName' command. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the players in the team, or an empty one if + there are none else false if invalid arguments are passed. + oop: + element: team + method: getPlayers + variable: players + static: false + requires_review: true diff --git a/functions/Player/getRandomPlayer.yaml b/functions/Player/getRandomPlayer.yaml index 67230673..eea0ad61 100644 --- a/functions/Player/getRandomPlayer.yaml +++ b/functions/Player/getRandomPlayer.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRandomPlayer -server: +shared: name: getRandomPlayer description: This function returns a random [player](/wiki/Player "Player"). parameters: [] @@ -7,4 +7,13 @@ server: - path: examples/getRandomPlayer-1.lua description: This code outputs a random player's name. side: server - incomplete: true + returns: + values: + - type: player + name: value + description: Returns a random player , false if the server is empty. + oop: + element: Player + method: ) + static: true + requires_review: true diff --git a/functions/Player/givePlayerMoney.yaml b/functions/Player/givePlayerMoney.yaml index ae4a6652..e96bc1c0 100644 --- a/functions/Player/givePlayerMoney.yaml +++ b/functions/Player/givePlayerMoney.yaml @@ -1,10 +1,49 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GivePlayerMoney +client: + name: givePlayerMoney + description: This function adds money to a [player](/wiki/Player "Player")'s current + money amount. To set absolute values, [setPlayerMoney](/wiki/SetPlayerMoney "SetPlayerMoney") + can be used. + parameters: + - name: amount + type: int + description: a positive integer number specifying the amount of money to give + to the player. + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the money was added, or false if invalid parameters + were passed. + oop: &id001 + element: player + method: giveMoney + variable: money + static: false + notes: &id002 + - type: info + content: Using this function client side (not recommended) will not change a players + money server side. + - type: info + content: As of MTA SA version 1.5.9, despite the documentation claiming that amount + should be a positive integer, this function does work with negative values or + zero. In that case the function does still add the number to the game money + value, in the negative case resulting in a decreased value. + requires_review: true server: name: givePlayerMoney description: This function adds money to a [player](/wiki/Player "Player")'s current money amount. To set absolute values, [setPlayerMoney](/wiki/SetPlayerMoney "SetPlayerMoney") can be used. - parameters: [] + parameters: + - name: thePlayer + type: player + description: the player you are giving the money to. + - name: amount + type: int + description: a positive integer number specifying the amount of money to give + to the player. examples: - path: examples/givePlayerMoney-1.lua description: This example gives a player money when using "givecash" command. @@ -17,13 +56,12 @@ server: description: This example Creates money Money (dollar symbol) pickup and gives 30,000 dollars on Pick up hit. side: server - notes: - - type: info - content: Using this function client side (not recommended) will not change a players - money server side. - - type: info - content: As of MTA SA version 1.5.9, despite the documentation claiming that amount - should be a positive integer, this function does work with negative values or - zero. In that case the function does still add the number to the game money - value, in the negative case resulting in a decreased value. - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the money was added, or false if invalid parameters + were passed. + oop: *id001 + notes: *id002 + requires_review: true diff --git a/functions/Player/isPlayerCrosshairVisible.yaml b/functions/Player/isPlayerCrosshairVisible.yaml index 682b8a9b..ab020efe 100644 --- a/functions/Player/isPlayerCrosshairVisible.yaml +++ b/functions/Player/isPlayerCrosshairVisible.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerCrosshairVisible -client: +shared: name: isPlayerCrosshairVisible description: This function checks if the local player has showing crosshair. parameters: [] @@ -7,10 +7,15 @@ client: - path: examples/isPlayerCrosshairVisible-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the player has the crosshair visible, false otherwise. notes: - type: info content: This function checks if the crosshair is rendered by GTA. Please note that hud components are not associated with this function, so the function may return true even if the "crosshair" component is hidden with setPlayerHudComponentVisible . If you need checking use isPlayerHudComponentVisible . - incomplete: true + requires_review: true diff --git a/functions/Player/isPlayerHudComponentVisible.yaml b/functions/Player/isPlayerHudComponentVisible.yaml index 0ca6adba..33f93202 100644 --- a/functions/Player/isPlayerHudComponentVisible.yaml +++ b/functions/Player/isPlayerHudComponentVisible.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerHudComponentVisible -client: +shared: name: isPlayerHudComponentVisible description: This function can be used to check whether an hud component is visable or not. - parameters: [] + parameters: + - name: component + type: string + description: 'The component you wish to check. Valid values are:' examples: - path: examples/isPlayerHudComponentVisible-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the component is visable, false if not. + requires_review: true diff --git a/functions/Player/isPlayerMapForced.yaml b/functions/Player/isPlayerMapForced.yaml index adc18592..d1733c9c 100644 --- a/functions/Player/isPlayerMapForced.yaml +++ b/functions/Player/isPlayerMapForced.yaml @@ -1,13 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerMapForced -server: +client: name: isPlayerMapForced description: This function checks if the specified player's map (F11\) has been forced on or not. parameters: [] + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the local player's map is forced on, false otherwise. + oop: &id001 + element: player + method: isMapForced + variable: mapForced + static: false + pair: forcePlayerMap + requires_review: true +server: + name: isPlayerMapForced + description: This function checks if the specified player's map (F11\) has been + forced on or not. + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player examples: - path: examples/isPlayerMapForced-1.lua description: This example forces a player's map on for 10 seconds if it hasn't been already. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player's map is forced on, false otherwise. + oop: *id001 pair: forcePlayerMap - incomplete: true + requires_review: true diff --git a/functions/Player/isPlayerMapVisible.yaml b/functions/Player/isPlayerMapVisible.yaml index f8140256..b07f5126 100644 --- a/functions/Player/isPlayerMapVisible.yaml +++ b/functions/Player/isPlayerMapVisible.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerMapVisible -client: +shared: name: isPlayerMapVisible description: This function checks if the local player has their map showing (F11\). parameters: [] @@ -10,4 +10,9 @@ client: - path: examples/isPlayerMapVisible-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the player has the map visible, false otherwise. + requires_review: true diff --git a/functions/Player/isPlayerMuted.yaml b/functions/Player/isPlayerMuted.yaml index cc096a66..dd622893 100644 --- a/functions/Player/isPlayerMuted.yaml +++ b/functions/Player/isPlayerMuted.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerMuted -server: +shared: name: isPlayerMuted description: Use this function to check if a player has been muted. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you are checking. examples: - path: examples/isPlayerMuted-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player is muted and false otherwise. + oop: + element: player + method: isMuted + variable: muted + static: false pair: setPlayerMuted - incomplete: true + requires_review: true diff --git a/functions/Player/isPlayerNametagShowing.yaml b/functions/Player/isPlayerNametagShowing.yaml index 5559ba60..bccf9b0d 100644 --- a/functions/Player/isPlayerNametagShowing.yaml +++ b/functions/Player/isPlayerNametagShowing.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsPlayerNametagShowing -server: +shared: name: isPlayerNametagShowing description: This function will allow you to determine if a player's name tag is currently showing. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose current name tag condition you want to check examples: - path: examples/isPlayerNametagShowing-1.lua description: This example toggles a player's nametag. If no playername is given, it toggles the nametag of the player who entered the command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player's name tag is being shown, false otherwise. + oop: + element: player + method: isNametagShowing + variable: nametagShowing + static: false pair: setPlayerNametagShowing - incomplete: true + requires_review: true diff --git a/functions/Player/isVoiceEnabled.yaml b/functions/Player/isVoiceEnabled.yaml index 57025cd7..e4990e87 100644 --- a/functions/Player/isVoiceEnabled.yaml +++ b/functions/Player/isVoiceEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVoiceEnabled -server: +shared: name: isVoiceEnabled description: 'Added to client side. @@ -10,4 +10,13 @@ server: - path: examples/isVoiceEnabled-1.lua description: This example shows how to forbid use voice for muted (in chat) players side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the voice is enabled on the server, false otherwise. + oop: + element: Player + method: ) + static: true + requires_review: true diff --git a/functions/Player/redirectPlayer.yaml b/functions/Player/redirectPlayer.yaml index ab8fb2f8..6f47b9e6 100644 --- a/functions/Player/redirectPlayer.yaml +++ b/functions/Player/redirectPlayer.yaml @@ -1,8 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RedirectPlayer -server: +shared: name: redirectPlayer description: This function redirects the player to a specified server. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you want to redirect + - name: serverIP + type: string + description: The IP address (or domain name that resolves to the IP address) of + the server you want to redirect the player to. Use an empty string to reconnect + to the same server. + default: '""' + - name: serverPort + type: int + description: The game port of the server you want to redirect the player to, this + is usually 22003. Set to zero to use the same port as the current server. + default: '0' + - name: serverPassword + type: string + description: The password for the server if it's protected + default: '""' examples: - path: examples/redirectPlayer-1.lua description: This example auto-redirects all connecting players to another given @@ -15,7 +33,17 @@ server: - path: examples/redirectPlayer-3.lua description: This example adds a "rejoin" command like the inbuilt reconnect command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was redirected successfully, false if + bad arguments were passed. + oop: + element: player + method: redirect + static: false notes: - type: info content: A resource using this function needs ACL rights in order to work (function.redirectPlayer) - incomplete: true + requires_review: true diff --git a/functions/Player/resendPlayerACInfo.yaml b/functions/Player/resendPlayerACInfo.yaml index ed1010c6..c30831e4 100644 --- a/functions/Player/resendPlayerACInfo.yaml +++ b/functions/Player/resendPlayerACInfo.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResendPlayerACInfo -server: +shared: name: resendPlayerACInfo description: This function will force the specified player to resend their AC info, triggering the [onPlayerACInfo](/wiki/OnPlayerACInfo "OnPlayerACInfo") event again. - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player examples: - path: examples/resendPlayerACInfo-1.lua description: This example shows how to resend each players AC info duringonResourceStart side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the AC info will be resent, false otherwise. + requires_review: true diff --git a/functions/Player/resendPlayerModInfo.yaml b/functions/Player/resendPlayerModInfo.yaml index 2a7c5932..583ee3db 100644 --- a/functions/Player/resendPlayerModInfo.yaml +++ b/functions/Player/resendPlayerModInfo.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResendPlayerModInfo -server: +shared: name: resendPlayerModInfo description: This function will force the specified player to resend their mod info, triggering the [onPlayerModInfo](/wiki/OnPlayerModInfo "OnPlayerModInfo") event again. - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player examples: - path: examples/resendPlayerModInfo-1.lua description: This example shows how to resend each players mod info duringonResourceStart side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the mod info will be resent, false otherwise. + oop: + element: player + method: resendModInfo + static: false + requires_review: true diff --git a/functions/Player/resetPlayerHudComponentProperty.yaml b/functions/Player/resetPlayerHudComponentProperty.yaml index 11a8abfc..40b9d849 100644 --- a/functions/Player/resetPlayerHudComponentProperty.yaml +++ b/functions/Player/resetPlayerHudComponentProperty.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetPlayerHudComponentProperty -client: +shared: name: resetPlayerHudComponentProperty description: This function resets the specified property to its default value. - parameters: [] + parameters: + - name: component + type: string + description: The component whose property you want to reset. See HUD Components + . + - name: property + type: string + description: The name of the property you want to reset. See HUD Properties . examples: - path: examples/resetPlayerHudComponentProperty-1.lua description: '' @@ -11,5 +18,14 @@ client: description: It’s also possible to use all to reset all properties of a specific component or all properties of all components (the entire HUD). side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: player + method: getHudComponentProperty + static: false pair: setPlayerHudComponentProperty - incomplete: true + requires_review: true diff --git a/functions/Player/setControlState.yaml b/functions/Player/setControlState.yaml index d30235c6..69f2b028 100644 --- a/functions/Player/setControlState.yaml +++ b/functions/Player/setControlState.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetControlState -server: +shared: name: setControlState description: Sets a state of a specified player's control, as if they pressed or released it. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to set the control state of. + - name: control + type: string + description: The control that you want to set the state of. See control names + for a list of possible controls. + - name: state + type: bool + description: A boolean value representing whether or not the key will be set to + pressed or not. examples: - path: examples/setControlState-1.lua description: This example will disable the use of the accelerate, brake/reverse and handbrake keys, then force the accelerate on for any player who enters a vehicle. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the control state was successfully set, false otherwise. + requires_review: true diff --git a/functions/Player/setPlayerAnnounceValue.yaml b/functions/Player/setPlayerAnnounceValue.yaml index 768dee96..f146f655 100644 --- a/functions/Player/setPlayerAnnounceValue.yaml +++ b/functions/Player/setPlayerAnnounceValue.yaml @@ -1,16 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerAnnounceValue -server: +shared: name: setPlayerAnnounceValue description: 'This function allows you to change ASE announce values for any player using a specified key. As an example this can be used to change the "score" value which will be shown at [game\-state.com](https://www.game-state.com/)''s server list.' - parameters: [] + parameters: + - name: thePlayer + type: element + description: The player whos announce value you wish to change. + - name: key + type: string + description: The key which the value will be stored at. + - name: value + type: string + description: The value you wish to store. examples: - path: examples/setPlayerAnnounceValue-1.lua description: This small example adds a command that allows you to set your own "score" value. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the value was set succesfully, false otherwise. + oop: + element: player + method: setAnnounceValue + static: false pair: getPlayerAnnounceValue - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerBlurLevel.yaml b/functions/Player/setPlayerBlurLevel.yaml index b2d843c8..32b6b43a 100644 --- a/functions/Player/setPlayerBlurLevel.yaml +++ b/functions/Player/setPlayerBlurLevel.yaml @@ -1,12 +1,43 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerBlurLevel +client: + name: setPlayerBlurLevel + description: Sets the motion blur level on the clients screen. Accepts a value between + 0 and 255\. + parameters: + - name: level + type: int + description: 'The level to set the blur to (default: 36)' + examples: [] + returns: + values: + - type: bool + name: value + oop: &id001 + element: player + method: setBlurLevel + variable: blurLevel + static: false + pair: getPlayerBlurLevel + requires_review: true server: name: setPlayerBlurLevel description: Sets the motion blur level on the clients screen. Accepts a value between 0 and 255\. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose blur level will be changed. + - name: level + type: int + description: 'The level to set the blur to (default: 36)' examples: - path: examples/setPlayerBlurLevel-1.lua description: This example allows the player to set their blur level via a command side: server + returns: + values: + - type: bool + name: value + oop: *id001 pair: getPlayerBlurLevel - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerHudComponentProperty.yaml b/functions/Player/setPlayerHudComponentProperty.yaml index 4a1a9a82..ac4c8bf7 100644 --- a/functions/Player/setPlayerHudComponentProperty.yaml +++ b/functions/Player/setPlayerHudComponentProperty.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerHudComponentProperty -client: +shared: name: setPlayerHudComponentProperty description: This function allows for modifying HUD properties, such as text or bar color, position, size, and more. - parameters: [] + parameters: + - name: component + type: string + description: The component you wish to modify. See HUD Components . + - name: property + type: string + description: The name of the property you want to modify. See HUD Properties . + - name: value + type: mixed + description: The value you want to set. examples: - path: examples/setPlayerHudComponentProperty-1.lua description: This example makes the HUD look like it does in the picture on the side. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the property was successfully modified, false otherwise. + oop: + element: player + method: setHudComponentProperty + static: false pair: getPlayerHudComponentProperty notes: - type: info @@ -23,4 +41,4 @@ client: its width, its position on the X-axis will also change. If you want to maintain the bar's position, you also need to calculate its position based on its width. Additionally, the width is calculated depending on the MAX_HEALTH stat. - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerHudComponentVisible.yaml b/functions/Player/setPlayerHudComponentVisible.yaml index 675ca1ad..eb76e5ee 100644 --- a/functions/Player/setPlayerHudComponentVisible.yaml +++ b/functions/Player/setPlayerHudComponentVisible.yaml @@ -1,13 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerHudComponentVisible -server: +client: name: setPlayerHudComponentVisible description: This function will show or hide a part of the player's HUD. - parameters: [] + parameters: + - name: component + type: string + description: 'The component you wish to show or hide. Valid values are:' + - name: show + type: bool + description: MISSING_PARAM_DESC examples: - - path: examples/setPlayerHudComponentVisible-1.lua - description: This example hides the ammo and weapon displays for players when - they join. - side: server - path: examples/setPlayerHudComponentVisible-2.lua description: This example lets players hide or bring up their bottom-left radar with a command @@ -17,4 +19,40 @@ server: money, breath bar, armor bar & wanted level stars displays for players when they join. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the component was shown or hidden succesfully, false + if an invalid argument was specified. + oop: &id001 + element: player + method: setHudComponentVisible + static: false + requires_review: true +server: + name: setPlayerHudComponentVisible + description: This function will show or hide a part of the player's HUD. + parameters: + - name: thePlayer + type: player + description: The player element for which you wish to show/hide a HUD component + - name: component + type: string + description: 'The component you wish to show or hide. Valid values are:' + - name: show + type: bool + description: MISSING_PARAM_DESC + examples: + - path: examples/setPlayerHudComponentVisible-1.lua + description: This example hides the ammo and weapon displays for players when + they join. + side: server + returns: + values: + - type: bool + name: value + description: Returns true if the component was shown or hidden succesfully, false + if an invalid argument was specified. + oop: *id001 + requires_review: true diff --git a/functions/Player/setPlayerMoney.yaml b/functions/Player/setPlayerMoney.yaml index 1eaf504d..8deccaa2 100644 --- a/functions/Player/setPlayerMoney.yaml +++ b/functions/Player/setPlayerMoney.yaml @@ -1,10 +1,55 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerMoney +client: + name: setPlayerMoney + description: Sets a player's money to a certain value, regardless of current player + money. It should be noted that setting negative values does not work and in fact + gives the player large amounts of money. + parameters: + - name: amount + type: int + description: A whole integer specifying the new amount of money the local player + will have. + - name: instant + type: bool + description: If set to true money will be set instantly without counting up/down + like in singleplayer. + default: 'false' + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the money was added, or false if invalid parameters + were passed. + oop: &id001 + element: player + method: setMoney + variable: money + static: false + pair: getPlayerMoney + notes: &id002 + - type: info + content: Using this function client side (not recommended) will not change a players + money server side. + requires_review: true server: name: setPlayerMoney description: Sets a player's money to a certain value, regardless of current player money. It should be noted that setting negative values does not work and in fact gives the player large amounts of money. - parameters: [] + parameters: + - name: thePlayer + type: player + description: Which player to set the money of. + - name: amount + type: int + description: A whole integer specifying the new amount of money the player will + have. + - name: instant + type: bool + description: If set to true money will be set instantly without counting up/down + like in singleplayer. + default: 'false' examples: - path: examples/setPlayerMoney-1.lua description: Example 1:This example sets the player's money to the desired amount @@ -14,9 +59,13 @@ server: description: Example 2:This sets all players the amount of 1337 money when "leet" is typed in console. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the money was added, or false if invalid parameters + were passed. + oop: *id001 pair: getPlayerMoney - notes: - - type: info - content: Using this function client side (not recommended) will not change a players - money server side. - incomplete: true + notes: *id002 + requires_review: true diff --git a/functions/Player/setPlayerMuted.yaml b/functions/Player/setPlayerMuted.yaml index 76b6d983..02d37683 100644 --- a/functions/Player/setPlayerMuted.yaml +++ b/functions/Player/setPlayerMuted.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerMuted -server: +shared: name: setPlayerMuted description: Use this function to mute or unmute the player. Muted player won't be able to say anything in chat. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you are muting or unmuting. + - name: state + type: bool + description: Use true to mute and false to unmute the player. examples: - path: examples/setPlayerMuted-1.lua description: This adds a /mute command that can be used to mute a player. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was successfully muted or unmuted, false + otherwise. + oop: + element: player + method: setMuted + variable: muted + static: false pair: isPlayerMuted - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerName.yaml b/functions/Player/setPlayerName.yaml index dcce7803..aa02ea23 100644 --- a/functions/Player/setPlayerName.yaml +++ b/functions/Player/setPlayerName.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerName -server: +shared: name: setPlayerName description: This function changes the specified [player](/wiki/Player "Player")'s name. Note that any change made to a players name with this function is not saved in their settings so the name change only lasts till they disconnect. - parameters: [] + parameters: + - name: thePlayer + type: player + description: the player that will have its name set. + - name: newName + type: string + description: the new name to set for the player. examples: - path: examples/setPlayerName-1.lua description: This example adds a tag before a player's nickname via a /changetag @@ -13,8 +19,18 @@ server: - path: examples/setPlayerName-2.lua description: This example allows you to check if string is valid mta nickname side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player name was changed succesfully, false if + invalid arguments are specified. + oop: + element: player + method: setName + variable: name + static: false pair: getPlayerName - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -22,3 +38,4 @@ server: - Missing section: Limits ' + requires_review: true diff --git a/functions/Player/setPlayerNametagColor.yaml b/functions/Player/setPlayerNametagColor.yaml index 162c32af..360eed02 100644 --- a/functions/Player/setPlayerNametagColor.yaml +++ b/functions/Player/setPlayerNametagColor.yaml @@ -1,16 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerNametagColor -server: +shared: name: setPlayerNametagColor description: This allows you to change the RGB color mixture in the name tags of players. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose name tag text you wish to change the color of + - name: r + type: int + description: The amount of red you want in the mixture of RGB (0-255 is valid) + - name: g + type: int + description: The amount of green you want in the mixture of RGB (0-255 is valid) + - name: b + type: int + description: The amount of blue you want in the mixture of RGB (0-255 is valid) examples: - path: examples/setPlayerNametagColor-1.lua description: This will allow a player to change the RGB color mixture of their nickname. Valid RGB is between 0-255. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the function was successful, false otherwise. + oop: + element: player + method: setNametagColor + static: false notes: - type: info content: If the player is using a hexcode in front of their name, it will override this function. You must first strip the name of the hexcode using removeHex - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerNametagShowing.yaml b/functions/Player/setPlayerNametagShowing.yaml index eb9e1991..c58004b5 100644 --- a/functions/Player/setPlayerNametagShowing.yaml +++ b/functions/Player/setPlayerNametagShowing.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerNametagShowing -server: +shared: name: setPlayerNametagShowing description: This function allows you to set whether a player's nametag visibility both clientside and serverside - parameters: [] + parameters: + - name: thePlayer + type: player + description: Define the player whos tag visiblity status you want to change + - name: showing + type: bool + description: Use true or false to show/hide the tag examples: - path: examples/setPlayerNametagShowing-1.lua description: This script will turn off player tags for everyone side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise + oop: + element: player + method: setNametagShowing + variable: nametagShowing + static: false pair: isPlayerNametagShowing - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerNametagText.yaml b/functions/Player/setPlayerNametagText.yaml index c7f4b33a..edb7e3dc 100644 --- a/functions/Player/setPlayerNametagText.yaml +++ b/functions/Player/setPlayerNametagText.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerNametagText -server: +shared: name: setPlayerNametagText description: This will change the text of a player's nickname in the world to something besides the nickname he chose. This will not change the player's actual nickname, it only changes the visible aspect inside the world (you will see his original nickname in the scoreboard and will refer to his original name in scripts). - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose nickname text you wish to change + - name: text + type: string + description: The new nickname text that will be displayed examples: - path: examples/setPlayerNametagText-1.lua description: This console command lets you change the name tag of lamers. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: player + method: setNametagText + variable: nametagText + static: false pair: getPlayerNametagText - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerScriptDebugLevel.yaml b/functions/Player/setPlayerScriptDebugLevel.yaml index 3d37cc92..16ebb90b 100644 --- a/functions/Player/setPlayerScriptDebugLevel.yaml +++ b/functions/Player/setPlayerScriptDebugLevel.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerScriptDebugLevel -server: +shared: name: setPlayerScriptDebugLevel description: This will set player's debug level, equivalent to [debugscript \](/wiki/Debugging "Debugging"). - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose debug level you wish to change + - name: level + type: int + description: '0: close debug console, 1: only errors, 2: errors and warnings, + 3: errors, warnings and info messages' examples: - path: examples/setPlayerScriptDebugLevel-1.lua description: This code will set joining players debug level to (3), (It is no recommended to use it in production, specially if you have sensitive data in your logs). side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: player + method: setScriptDebugLevel + variable: scriptDebugLevel + static: false pair: getPlayerScriptDebugLevel - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerTeam.yaml b/functions/Player/setPlayerTeam.yaml index bb24615b..dbcb455f 100644 --- a/functions/Player/setPlayerTeam.yaml +++ b/functions/Player/setPlayerTeam.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerTeam -server: +shared: name: setPlayerTeam description: This function adds a [player](/wiki/Player "Player") to an existing [team](/wiki/Team "Team"). The player will automatically be removed from his current team if he's on one. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you wish to add to a team. + - name: theTeam + type: team + description: The team you want to add the player to, or nil if you wish to unassign + a player from his team. examples: - path: examples/setPlayerTeam-1.lua description: This example adds a command to create a new team for a player, then add him to it. It also adds a command to remove him from his team. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was successfully added to the specified + team or removed from his previous one, false otherwise. + oop: + element: player + method: setTeam + variable: team + static: false pair: getPlayerTeam - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerVoiceBroadcastTo.yaml b/functions/Player/setPlayerVoiceBroadcastTo.yaml index 24bf5c1b..6eb9a100 100644 --- a/functions/Player/setPlayerVoiceBroadcastTo.yaml +++ b/functions/Player/setPlayerVoiceBroadcastTo.yaml @@ -1,14 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerVoiceBroadcastTo -server: +shared: name: setPlayerVoiceBroadcastTo description: This function allows you to change who can hear the voice of a player. - parameters: [] + parameters: + - name: thePlayer + type: element + description: The player you wish to change + - name: broadcastTo + type: mixed + description: MISSING_PARAM_DESC examples: - path: examples/setPlayerVoiceBroadcastTo-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the value was set successfully, false otherwise. + oop: + element: player + method: setVoiceBroadcastTo + variable: voiceBroadcastTo + static: false notes: - type: important content: This function should only be used as a low-level function for advanced users. For typical Voice scripting, please see the Voice Resource - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerVoiceIgnoreFrom.yaml b/functions/Player/setPlayerVoiceIgnoreFrom.yaml index dae4c54b..4bbf7774 100644 --- a/functions/Player/setPlayerVoiceIgnoreFrom.yaml +++ b/functions/Player/setPlayerVoiceIgnoreFrom.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerVoiceIgnoreFrom -server: +shared: name: setPlayerVoiceIgnoreFrom description: This function allows you to mute voices for a player. - parameters: [] + parameters: + - name: thePlayer + type: element + description: The player you wish to change + - name: ignoreFrom + type: mixed + description: Element or table of elements which the player should not hear voices + from. Use nil if no one should be ignored. examples: - path: examples/setPlayerVoiceIgnoreFrom-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the value was set successfully, false otherwise. + oop: + element: player + method: setVoiceIgnoreFrom + variable: voiceIgnoreFrom + static: false notes: - type: important content: This function should only be used as a low-level function for advanced users. For typical Voice scripting, please see the Voice Resource - incomplete: true + requires_review: true diff --git a/functions/Player/setPlayerWantedLevel.yaml b/functions/Player/setPlayerWantedLevel.yaml index e8285ce3..bfe598fe 100644 --- a/functions/Player/setPlayerWantedLevel.yaml +++ b/functions/Player/setPlayerWantedLevel.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPlayerWantedLevel -server: +shared: name: setPlayerWantedLevel description: This function is used to set a player's wanted level. The wanted level is indicated by the amount of stars a player has on the GTA HUD. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player whose wanted level is to be set + - name: stars + type: int + description: An integer from 0 to 6 representing the wanted level examples: - path: examples/setPlayerWantedLevel-1.lua description: 'This example sets a player''s wanted level to six stars if they enter a certain colshape:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the wanted level was set successfully, false if any + of the arguments were invalid. + oop: + element: player + method: setWantedLevel + variable: wantedLevel + static: false pair: getPlayerWantedLevel - incomplete: true + requires_review: true diff --git a/functions/Player/spawnPlayer.yaml b/functions/Player/spawnPlayer.yaml index 330b5d6e..694eedb9 100644 --- a/functions/Player/spawnPlayer.yaml +++ b/functions/Player/spawnPlayer.yaml @@ -1,8 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SpawnPlayer -server: +shared: name: spawnPlayer description: This function spawns the player at an arbitrary point on the map. - parameters: [] + parameters: + - name: thePlayer + type: player + description: The player you want to spawn. + - name: x + type: float + description: The x co-ordinate to spawn the player at. + - name: "y" + type: float + description: The y co-ordinate to spawn the player at. + - name: z + type: float + description: The z co-ordinate to spawn the player at. + - name: int rotation + type: '[' + description: MISSING_PARAM_DESC + default: 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam + = getPlayerTeam(thePlayer examples: - path: examples/spawnPlayer-1.lua description: This example spawns all the players in the middle of the game map. @@ -10,9 +27,18 @@ server: - path: examples/spawnPlayer-2.lua description: This example spawns a playerwhen he logs in. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the player was spawned successfully, false otherwise. + oop: + element: player + method: spawn + static: false notes: - type: info content: setCameraTarget must be used to focus on the player. Also, all players have their camera initially faded out after connect. To ensure that the camera is faded in, please do a fadeCamera after. - incomplete: true + requires_review: true diff --git a/functions/Player/takePlayerMoney.yaml b/functions/Player/takePlayerMoney.yaml index 2b155b6a..b88c5b8a 100644 --- a/functions/Player/takePlayerMoney.yaml +++ b/functions/Player/takePlayerMoney.yaml @@ -1,16 +1,51 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TakePlayerMoney +client: + name: takePlayerMoney + description: This function subtracts money from a [player](/wiki/Player "Player")'s + current money amount. + parameters: + - name: amount + type: int + description: MISSING_PARAM_DESC + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the money was taken, or false if invalid parameters + were passed. + oop: &id001 + element: player + method: takeMoney + variable: money + static: false + notes: &id002 + - type: info + content: Using this function client side (not recommended) will not change a players + money server side. + requires_review: true server: name: takePlayerMoney description: This function subtracts money from a [player](/wiki/Player "Player")'s current money amount. - parameters: [] + parameters: + - name: thePlayer + type: player + description: MISSING_PARAM_DESC + - name: amount + type: int + description: MISSING_PARAM_DESC examples: - path: examples/takePlayerMoney-1.lua description: This example takes money from a player when he types "takecashnumber" in the console. side: server - notes: - - type: info - content: Using this function client side (not recommended) will not change a players - money server side. - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the money was taken, or false if invalid parameters + were passed. + oop: *id001 + notes: *id002 + requires_review: true diff --git a/functions/Player/takePlayerScreenShot.yaml b/functions/Player/takePlayerScreenShot.yaml index 1adcab6f..de855c85 100644 --- a/functions/Player/takePlayerScreenShot.yaml +++ b/functions/Player/takePlayerScreenShot.yaml @@ -1,12 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TakePlayerScreenShot -server: +shared: name: takePlayerScreenShot description: This function forces a client to capture the current screen output and send it back to the server. The image will contain the GTA HUD and the output of any dxDraw functions that are not flagged as 'post GUI'. The image specifically excludes the chat box and all GUI (including the client console). The result is received with the event [onPlayerScreenShot](/wiki/OnPlayerScreenShot "OnPlayerScreenShot"). - parameters: [] + parameters: + - name: thePlayer + type: player + description: the player to get the screen capture from. + - name: width + type: int + description: the width of the capture image. + - name: height + type: int + description: the height of the capture image. + - name: tag + type: string + description: A string to help identify the screen capture. The string is passed + to the matching onPlayerScreenShot event for your personal convenience. + default: '""' + - name: quality + type: int + description: Quality of the final JPEG image from 0 to 100. A lower value can + reduce the memory used by the image considerably which will result in faster + and less intrusive uploads. + default: '30' + - name: maxBandwidth + type: int + description: The amount of client upload bandwidth to use (in bytes per second) + when sending the image. + default: '5000' + - name: maxPacketSize + type: int + description: The maximum size of one packet. + default: '500' examples: - path: examples/takePlayerScreenShot-1.lua description: '' @@ -14,4 +43,14 @@ server: - path: examples/takePlayerScreenShot-2.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function was successfully, false if invalid arguments + are specified. + oop: + element: player + method: takeScreenShot + static: false + requires_review: true diff --git a/functions/Projectile/createProjectile.yaml b/functions/Projectile/createProjectile.yaml index 09ea721b..d2704a9f 100644 --- a/functions/Projectile/createProjectile.yaml +++ b/functions/Projectile/createProjectile.yaml @@ -1,9 +1,58 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateProjectile -client: +shared: name: createProjectile description: This function creates a projectile of the specified type on the specified coordinates. - parameters: [] + parameters: + - name: creator + type: element + description: The element representing creator of the projectile. In case you want + the projectile to be synced for everybody creator must be the local player or + his vehicle. + - name: weaponType + type: int + description: 'int representing the projectile weaponType (characteristics). Valid + IDs are:' + - name: posX + type: float + description: float starting coordinates for the projectile. They are coordinates + of creator by default. + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: force + type: float + description: float representing the starting force for throwable projectiles. + default: '1.0' + - name: target + type: element + description: element target used for heat seeking rockets. + default: nil + - name: rotX + type: float + description: float starting rotation for the projectile. + - name: rotY + type: float + description: MISSING_PARAM_DESC + - name: rotZ + type: float + description: MISSING_PARAM_DESC + - name: velX + type: float + description: float starting velocity for the projectile. + - name: velY + type: float + description: MISSING_PARAM_DESC + - name: velZ + type: float + description: MISSING_PARAM_DESC + - name: model + type: int + description: Integer representing the projectile's model, uses default model for + weaponType if not specified. examples: - path: examples/createProjectile-1.lua description: This example makes a rocket minigun (minigun shooting with rockets). @@ -13,14 +62,24 @@ client: that travels in the direction your vehicle is facing when you press vehicle_fire (left mouse button with default controls) side: client + returns: + values: + - type: projectile + name: value + description: Returns a projectile element if projectile creation was successful. + Returns false if unable to create a projectile (wrong weapon ID or projectiles + limit was reached). + oop: + element: projectile + constructorclass: Projectile notes: - type: info content: 'Model argument is not synchronized between clients. Clients differs from local player see always standard projectile model. Target argument valid elements are: player , ped , vehicle and object .' issues: - - id: '584' + - id: 584 description: createProjectile creates one projectile for every person in the vehicle - - id: '616' + - id: 616 description: Projectile rotation is set exactly opposite for creator - incomplete: true + requires_review: true diff --git a/functions/Projectile/detonateSatchels.yaml b/functions/Projectile/detonateSatchels.yaml index 354de01c..050c39ee 100644 --- a/functions/Projectile/detonateSatchels.yaml +++ b/functions/Projectile/detonateSatchels.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DetonateSatchels -server: +client: name: detonateSatchels description: This function can be used to detonate a players satchels. parameters: [] @@ -7,7 +7,26 @@ server: - path: examples/detonateSatchels-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true +server: + name: detonateSatchels + description: This function can be used to detonate a players satchels. + parameters: + - name: Player + type: player + description: MISSING_PARAM_DESC + examples: - path: examples/detonateSatchels-2.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/Projectile/getProjectileCounter.yaml b/functions/Projectile/getProjectileCounter.yaml index 8e01f540..87666097 100644 --- a/functions/Projectile/getProjectileCounter.yaml +++ b/functions/Projectile/getProjectileCounter.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProjectileCounter -client: +shared: name: getProjectileCounter description: Get the time left before a projectile detonates. - parameters: [] + parameters: + - name: projectile + type: projectile + description: the projectile to get the timer of. examples: - path: examples/getProjectileCounter-1.lua description: With this example you can find out how long does it take for a projectile to explode/end side: client + returns: + values: + - type: int + name: value + description: 'Returns the the time in milliseconds to detonation which depending + on the projectile type will do different things:' + oop: + element: projectile + method: getCounter + variable: counter + static: false pair: setProjectileCounter - incomplete: true + requires_review: true diff --git a/functions/Projectile/getProjectileCreator.yaml b/functions/Projectile/getProjectileCreator.yaml index 67059da1..667802c1 100644 --- a/functions/Projectile/getProjectileCreator.yaml +++ b/functions/Projectile/getProjectileCreator.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProjectileCreator -client: +shared: name: getProjectileCreator description: This function returns the creator of the specified projectile. - parameters: [] + parameters: + - name: theProjectile + type: projectile + description: The projectile element which creator you want to retrieve. examples: - path: examples/getProjectileCreator-1.lua description: 'This example will output a message in the chatbox saying who created the projectile.' side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the element which created the projectile if successful, false + otherwise. + oop: + element: projectile + method: getCreator + variable: creator + static: false + requires_review: true diff --git a/functions/Projectile/getProjectileForce.yaml b/functions/Projectile/getProjectileForce.yaml index ada37f59..6df7552a 100644 --- a/functions/Projectile/getProjectileForce.yaml +++ b/functions/Projectile/getProjectileForce.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProjectileForce -client: +shared: name: getProjectileForce description: This function returns the force of the specified projectile. - parameters: [] + parameters: + - name: theProjectile + type: projectile + description: The projectile element which force you want to retrieve. examples: - path: examples/getProjectileForce-1.lua description: Example 1:This example would outputs the force of the projectile on 1-100 scale. This function just works with projectiles which you throw so just grenades, satchel charge etc side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float if successful, false otherwise. + oop: + element: projectile + method: getForce + variable: force + static: false + requires_review: true diff --git a/functions/Projectile/getProjectileTarget.yaml b/functions/Projectile/getProjectileTarget.yaml index 39e377bd..962ed06b 100644 --- a/functions/Projectile/getProjectileTarget.yaml +++ b/functions/Projectile/getProjectileTarget.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProjectileTarget -client: +shared: name: getProjectileTarget description: This function returns the target of the specified projectile. - parameters: [] + parameters: + - name: theProjectile + type: projectile + description: The projectile element which target you want to retrieve. examples: - path: examples/getProjectileTarget-1.lua description: This example allows a player to send projectiles at other players. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the element which is the projectile's target if the projectile + is valid and can have a target (like a heat-seeking rocket), false otherwise. + oop: + element: projectile + method: getTarget + variable: target + static: false + requires_review: true diff --git a/functions/Projectile/getProjectileType.yaml b/functions/Projectile/getProjectileType.yaml index 1231ff45..fbcf1220 100644 --- a/functions/Projectile/getProjectileType.yaml +++ b/functions/Projectile/getProjectileType.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProjectileType -client: +shared: name: getProjectileType description: This function returns the type of the specified projectile. - parameters: [] + parameters: + - name: theProjectile + type: projectile + description: The projectile element which type you want to retrieve. examples: - path: examples/getProjectileType-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer over the type of the projectile or false if invalid + arguments were passed. + oop: + element: projectile + method: getType + variable: type + static: false + requires_review: true diff --git a/functions/Projectile/setProjectileCounter.yaml b/functions/Projectile/setProjectileCounter.yaml index 9a3e9291..c55dbac7 100644 --- a/functions/Projectile/setProjectileCounter.yaml +++ b/functions/Projectile/setProjectileCounter.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetProjectileCounter -client: +shared: name: setProjectileCounter description: 'Will change the projectile counter timer which depending on the projectile type will do different things:' - parameters: [] + parameters: + - name: projectile + type: projectile + description: The projectile to edit the timer of. + - name: timeToDetonate + type: int + description: The time in milliseconds to detonation. examples: - path: examples/setProjectileCounter-1.lua description: With this example you can use /setbombtime to set a delay duration of a projectile explosion. side: client + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: projectile + method: setCounter + variable: counter + static: false pair: getProjectileCounter - incomplete: true + requires_review: true diff --git a/functions/Radar_area/createRadarArea.yaml b/functions/Radar_area/createRadarArea.yaml index 5a5388e9..da45b87b 100644 --- a/functions/Radar_area/createRadarArea.yaml +++ b/functions/Radar_area/createRadarArea.yaml @@ -1,12 +1,90 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateRadarArea +client: + name: createRadarArea + description: This function can be used to create custom radar areas on the radar. + parameters: + - name: startPosX + type: float + description: MISSING_PARAM_DESC + - name: startPosY + type: float + description: MISSING_PARAM_DESC + - name: sizeX + type: float + description: MISSING_PARAM_DESC + - name: sizeY + type: float + description: MISSING_PARAM_DESC + - name: r + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: g + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: b + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: a + type: int + description: MISSING_PARAM_DESC + default: '255' + examples: [] + returns: + values: + - type: radararea + name: value + oop: &id001 + element: radararea + constructorclass: RadarArea + requires_review: true server: name: createRadarArea description: This function can be used to create custom radar areas on the radar. - parameters: [] + parameters: + - name: startPosX + type: float + description: MISSING_PARAM_DESC + - name: startPosY + type: float + description: MISSING_PARAM_DESC + - name: sizeX + type: float + description: MISSING_PARAM_DESC + - name: sizeY + type: float + description: MISSING_PARAM_DESC + - name: r + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: g + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: b + type: int + description: MISSING_PARAM_DESC + default: '0' + - name: a + type: int + description: MISSING_PARAM_DESC + default: '255' + - name: visibleTo + type: element + description: MISSING_PARAM_DESC + default: root examples: - path: examples/createRadarArea-1.lua description: This example creates a radar area for the King of the hill script, and a colsquare. When the player enters the radar area it flashes, and stops flashing when a player leaves it. side: server - incomplete: true + returns: + values: + - type: radararea + name: value + oop: *id001 + requires_review: true diff --git a/functions/Radar_area/getRadarAreaColor.yaml b/functions/Radar_area/getRadarAreaColor.yaml index 40c86c53..11a659a2 100644 --- a/functions/Radar_area/getRadarAreaColor.yaml +++ b/functions/Radar_area/getRadarAreaColor.yaml @@ -1,12 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRadarAreaColor -server: +shared: name: getRadarAreaColor description: This function can be used to retrieve the current color of a [radar area](/wiki/Radararea "Radararea"). - parameters: [] + parameters: + - name: theRadararea + type: radararea + description: The radar area you wish to retrieve the colour of. examples: - path: examples/getRadarAreaColor-1.lua description: This example checks the color of a radararea defined as 'area' and announces if it is Ballas or Grove Street territory. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: Returns four integers in RGBA format ( red , green , blue , alpha + ), with a maximum value of 255 for each. Alpha decides transparency where 255 + is opaque and 0 is transparent. Returns false if the radararea is invalid. + oop: + element: radararea + method: getColor + static: false + requires_review: true diff --git a/functions/Radar_area/getRadarAreaSize.yaml b/functions/Radar_area/getRadarAreaSize.yaml index 2023f00a..d62f55cf 100644 --- a/functions/Radar_area/getRadarAreaSize.yaml +++ b/functions/Radar_area/getRadarAreaSize.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRadarAreaSize -server: +shared: name: getRadarAreaSize description: This function is used for getting the X and Y size of an existing [radar area](/wiki/Radararea "Radararea"). - parameters: [] + parameters: + - name: theRadararea + type: radararea + description: The radar area element whose size you wish to get. examples: - path: examples/getRadarAreaSize-1.lua description: 'The following example looks for radar areas whose size is smaller than 100 by 100:' side: server - incomplete: true + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns two floats indicating the X and Y length of the radar area + respectively, false if the radar area is invalid. + oop: + element: radararea + method: getSize + static: false + requires_review: true diff --git a/functions/Radar_area/isInsideRadarArea.yaml b/functions/Radar_area/isInsideRadarArea.yaml index a4508067..636d5812 100644 --- a/functions/Radar_area/isInsideRadarArea.yaml +++ b/functions/Radar_area/isInsideRadarArea.yaml @@ -1,11 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsInsideRadarArea -server: +shared: name: isInsideRadarArea description: This function checks if a 2D position is inside a [radar area](/wiki/Radararea "Radararea") or not. - parameters: [] + parameters: + - name: theArea + type: radararea + description: The radar area you're checking the position against. + - name: posX + type: float + description: The X coordinate of the position you're checking. + - name: posY + type: float + description: The Y coordinate of the position you're checking. examples: - path: examples/isInsideRadarArea-1.lua description: This function checks if an element is within a radar area. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position is inside the radar area, false if it + isn't or if any parameters are invalid. + oop: + element: radararea + method: isInside + static: false + requires_review: true diff --git a/functions/Radar_area/isRadarAreaFlashing.yaml b/functions/Radar_area/isRadarAreaFlashing.yaml index d0b87c92..e8bdff46 100644 --- a/functions/Radar_area/isRadarAreaFlashing.yaml +++ b/functions/Radar_area/isRadarAreaFlashing.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsRadarAreaFlashing -server: +shared: name: isRadarAreaFlashing description: This function allows detection of whether a radar area is flashing or not. - parameters: [] + parameters: + - name: theRadararea + type: radararea + description: The radar area you wish to check the state of flashing examples: - path: examples/isRadarAreaFlashing-1.lua description: This example checks whether the radar area in the variableglenparkis flashing, and announces it if it is. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the radar area is flashing, false if it is not or + if it doesn't exist. + oop: + element: radararea + method: isFlashing + variable: flashing + static: false pair: setRadarAreaFlashing - incomplete: true + requires_review: true diff --git a/functions/Radar_area/setRadarAreaColor.yaml b/functions/Radar_area/setRadarAreaColor.yaml index 04ab9835..b06c1ee8 100644 --- a/functions/Radar_area/setRadarAreaColor.yaml +++ b/functions/Radar_area/setRadarAreaColor.yaml @@ -1,10 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetRadarAreaColor -server: +shared: name: setRadarAreaColor description: Sets the color of an existing radar area. - parameters: [] + parameters: + - name: theRadarArea + type: radararea + description: the radararea element whose color you wish to set. + - name: r + type: int + description: an integer representing the amount of red in the color (0 for no + red, 255 for solid red) + - name: g + type: int + description: an integer representing the amount of green in the color (0 for no + green, 255 for solid green) + - name: b + type: int + description: an integer representing the amount of blue in the color (0 for no + blue, 255 for solid blue) + - name: a + type: int + description: an integer representing the color's alpha (0 for transparent, 255 + for opaque) examples: - path: examples/setRadarAreaColor-1.lua description: 'This example creates a radar area and changes its color right away:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the color was set successfully, false if the radar + area doesn't exist or the color arguments are improper. + oop: + element: radararea + method: setColor + static: false + requires_review: true diff --git a/functions/Radar_area/setRadarAreaFlashing.yaml b/functions/Radar_area/setRadarAreaFlashing.yaml index ee665db4..42cbfd24 100644 --- a/functions/Radar_area/setRadarAreaFlashing.yaml +++ b/functions/Radar_area/setRadarAreaFlashing.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetRadarAreaFlashing -server: +shared: name: setRadarAreaFlashing description: This function makes an existing radar area flash in transparency. - parameters: [] + parameters: + - name: theRadarArea + type: radararea + description: the radararea element we want to change flashing state of. + - name: flash + type: bool + description: a bool indicating whether the radar area should flash ( true to flash, + false to not flash). examples: - path: examples/setRadarAreaFlashing-1.lua description: 'Example 1:This example checks to see whether an existing radar area @@ -13,5 +20,16 @@ server: and a colsquare. When the player enters the radar area flashes, it stops flashing when a player leaves. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the new flash state was successfully set, false if + the radar area doesn't exist or invalid arguments were passed. + oop: + element: radararea + method: setFlashing + variable: flashing + static: false pair: isRadarAreaFlashing - incomplete: true + requires_review: true diff --git a/functions/Radar_area/setRadarAreaSize.yaml b/functions/Radar_area/setRadarAreaSize.yaml index 609d3b3d..3d64f933 100644 --- a/functions/Radar_area/setRadarAreaSize.yaml +++ b/functions/Radar_area/setRadarAreaSize.yaml @@ -1,9 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetRadarAreaSize -server: +shared: name: setRadarAreaSize description: This function changes the size of an existing [radar area](/wiki/Radararea "Radararea"). - parameters: [] + parameters: + - name: theRadararea + type: radararea + description: the radararea element whose size is to be changed. + - name: x + type: float + description: the x length of the radar area. + - name: "y" + type: float + description: the y length of the radar area. examples: - path: examples/setRadarAreaSize-1.lua description: 'Example 1:This example decreases the size of a team''s radar area @@ -13,4 +22,14 @@ server: description: 'Example 2:This example creates a radar area and resets its size right away:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the size was set successfully, false if invalid arguments + are passed. + oop: + element: radararea + method: setSize + static: false + requires_review: true diff --git a/functions/Resource/abortRemoteRequest.yaml b/functions/Resource/abortRemoteRequest.yaml index a0c5ccdb..83d8f8da 100644 --- a/functions/Resource/abortRemoteRequest.yaml +++ b/functions/Resource/abortRemoteRequest.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AbortRemoteRequest -server: +shared: name: abortRemoteRequest description: Aborts a [fetchRemote](/wiki/FetchRemote "FetchRemote") or [callRemote](/wiki/CallRemote "CallRemote") request. - parameters: [] + parameters: + - name: theRequest + type: request + description: returned from fetchRemote , callRemote or getRemoteRequests examples: - path: examples/abortRemoteRequest-1.lua description: This example aborts all requests. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false when invalid request was provided + requires_review: true diff --git a/functions/Resource/addResourceConfig.yaml b/functions/Resource/addResourceConfig.yaml index e0786824..303647ba 100644 --- a/functions/Resource/addResourceConfig.yaml +++ b/functions/Resource/addResourceConfig.yaml @@ -1,10 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddResourceConfig -server: +shared: name: addResourceConfig description: This function adds a new empty config file to an existing resource. - parameters: [] + parameters: + - name: filePath + type: string + description: 'The filepath of the file to be created in the following format: + ":resourceName/path" . ''resourceName'' is the name of the resource the file + is in, and ''path'' is the path from the root directory of the resource to the + file.' + - name: filetype + type: string + description: a string indicating whether the file is serverside ("server") or + clientside ("client"). + default: '"server"' examples: - path: examples/addResourceConfig-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: xmlnode + name: value + description: Returns the new config's root xmlnode if the config was added successfully, + false otherwise. + requires_review: true diff --git a/functions/Resource/addResourceMap.yaml b/functions/Resource/addResourceMap.yaml index f0fffb44..d01070f0 100644 --- a/functions/Resource/addResourceMap.yaml +++ b/functions/Resource/addResourceMap.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddResourceMap -server: +shared: name: addResourceMap description: This function adds a new empty mapfile to an existing resource. - parameters: [] + parameters: + - name: filePath + type: string + description: 'The filepath of the resource map in the following format: ":resourceName/path" + . ''resourceName'' is the name of the resource the map file will be in, and + ''path'' is the path from the root directory of the resource to the file.' + - name: dimension + type: int + description: the dimension in which the map's objects will be placed. + default: '0' examples: - path: examples/addResourceMap-1.lua description: This example just adds a map to a gamemode resource called "cdm". side: server + returns: + values: + - type: xmlnode + name: value + description: Returns the new map's root xmlnode if the map was added successfully, + false otherwise. notes: - type: info content: You can't add a map to a running resource. - incomplete: true + requires_review: true diff --git a/functions/Resource/call.yaml b/functions/Resource/call.yaml index 27929cd4..715fadac 100644 --- a/functions/Resource/call.yaml +++ b/functions/Resource/call.yaml @@ -1,9 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Call -server: +shared: name: call description: This function is used to call a function from another resource (which must be running). - parameters: [] + parameters: + - name: theResource + type: resource + description: This is a resource pointer which refers to the resource you are calling + a function from. + - name: theFunction + type: string + description: This is a string with the name of the function which you want to + call. + - name: arguments... + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/call-1.lua description: This extract shows adding of a "kills" column to the scoreboard resource. @@ -15,6 +26,17 @@ server: This then sets thegameShowKillsvariable to true(or false), telling the rest of the script to start outputting kills. side: server + returns: + values: + - type: var... + name: value + description: Returns anything that the designated function has returned, if the + function has no return, nil is returned. If the function does not exist, is + not exported, or the call was not successful it will return false. + oop: + element: resource + method: call + static: false notes: - type: important content: Calls (exports) may incur a performance overhead - they are not equivalent @@ -24,4 +46,4 @@ server: variables are available even if you use exports.*:* Using this function straight away on resource start might cause elements to not be passed properly, use setTimer in order to delay function execution and to avoid this issue. - incomplete: true + requires_review: true diff --git a/functions/Resource/callRemote.yaml b/functions/Resource/callRemote.yaml index 97bee438..bba1e475 100644 --- a/functions/Resource/callRemote.yaml +++ b/functions/Resource/callRemote.yaml @@ -1,11 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CallRemote -server: +shared: name: callRemote description: This function allows you to call functions that have been exported with HTTP access by other MTA servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the call returns. - parameters: [] + parameters: + - name: host + type: string + description: This is a host name - including the HTTP port - of the server you + wish to connect to. + - name: queueName + type: string + description: MISSING_PARAM_DESC + default: '"default"' + - name: connectionAttempts + type: int + description: Number of times to retry if the remote host does not respond. In + the case of a non-responding remote server, each connection attempt will timeout + after 6 seconds. Therefore, the default setting of 10 connection attempts means + it will be 60 seconds before your script gets a callback about the error. Reducing + this value to 2 for example, will decrease that period to 12 seconds + default: '10' + - name: connectTimeout + type: int + description: Number of milliseconds each connection attempt will take before timing + out + default: '10000' + - name: resourceName + type: string + description: This is a name of the resource that contains the exported function + you want to call. + - name: functionName + type: string + description: This is a string with the name of the function which you want to + call. + - name: callbackFunction + type: callback + description: This is the function that should receive the data returned from the + remote function call. The argument list should match the format of the data + returned. The callback function will be passed a string containing "ERROR" followed + by an integer indicating the error code when an error occurs calling the function. + A list of error codes can be found here . + - name: arguments... + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/callRemote-1.lua description: PHP:(for the page that Lua expects to be athttp://www.example.com/page.php) @@ -28,4 +67,9 @@ server: description: 'ACL #2:Finally, modify the ACL on each receiving server to allow guest http communication with your resource:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the function has been called, false otherwise. + requires_review: true diff --git a/functions/Resource/copyResource.yaml b/functions/Resource/copyResource.yaml index e767d387..c010694f 100644 --- a/functions/Resource/copyResource.yaml +++ b/functions/Resource/copyResource.yaml @@ -1,11 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CopyResource -server: +shared: name: copyResource description: This function copies a specified [resource](/wiki/Resource "Resource") with a new name. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource which is going to be copied + - name: newResourceName + type: string + description: the name that the copied resource will receive + - name: organizationalDir + type: string + description: A string containing the path where the resource should be copied + to (e.g. "[gamemodes]/[amx]"). examples: - path: examples/copyResource-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: resource + name: value + description: Returns the resource element of the copy. Returns false if the arguments + are incorrect. + oop: + element: resource + method: copy + static: false + requires_review: true diff --git a/functions/Resource/createResource.yaml b/functions/Resource/createResource.yaml index 95209a03..b69852f4 100644 --- a/functions/Resource/createResource.yaml +++ b/functions/Resource/createResource.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateResource -server: +shared: name: createResource description: This function creates an new, empty resource. This creates a directory matching the name you specify on disk, then creates an empty meta.xml file with a \ element in it. - parameters: [] + parameters: + - name: resourceName + type: string + description: The name of the new resource. This should be a valid file name. It's + recommended that you do not have spaces or non-ASCII characters in resource + names. + - name: organizationalDir + type: string + description: A string containing the path where the resource should be created + (e.g. "[gamemodes]/[amx]"). examples: - path: examples/createResource-1.lua description: This example creates a new resource named what the player specified. The command is "/new-resource ". side: server - incomplete: true + returns: + values: + - type: resource + name: value + description: Returns the resource element of the new resource if successful, false + otherwise. This could fail if the resource name already is in use, if a directory + already exists with the name you've specified (but this isn't a valid resource) + or if the name you specify isn't valid. It could also fail if the disk was full + or for other similar reasons. + oop: + element: resource + constructorclass: Resource + requires_review: true diff --git a/functions/Resource/deleteResource.yaml b/functions/Resource/deleteResource.yaml index 74b22fbd..76f869cd 100644 --- a/functions/Resource/deleteResource.yaml +++ b/functions/Resource/deleteResource.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DeleteResource -server: +shared: name: deleteResource description: This function deletes a resource from the MTA memory and moves it to the **/resources\-cache/trash/** directory. - parameters: [] + parameters: + - name: resourceName + type: string + description: The name of resource to delete. examples: - path: examples/deleteResource-1.lua description: This example adds a command to delete a certain resource (admins only, no spaces in resource name allowed). side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the resource has been deleted successfully, false + otherwise. + oop: + element: Resource + note: This function is a static function underneath the Resource class. + method: ) + static: true + requires_review: true diff --git a/functions/Resource/fetchRemote.yaml b/functions/Resource/fetchRemote.yaml index 5a00df5a..8ed9acbb 100644 --- a/functions/Resource/fetchRemote.yaml +++ b/functions/Resource/fetchRemote.yaml @@ -1,10 +1,42 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FetchRemote -server: +shared: name: fetchRemote description: This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes. - parameters: [] + parameters: + - name: URL + type: string + description: A full URL in the format http://hostname/path/file.ext . A port can + be specified with a colon followed by a port number appended to the hostname. + - name: options + type: table + description: 'A table containing any request options: queueName: Name of the queue + to use. Any name can be used. If not set, the queue name is "default". Requests + in the same queue are processed in order, one at a time. connectionAttempts: + Number of times to retry if the remote host does not respond. (Defaults to 10) + connectTimeout: Number of milliseconds each connection attempt will take before + timing out. (Defaults to 10000) postData: A string specifying any data you want + to send to the remote HTTP server. postIsBinaryΒ : A boolean specifying if the + data is text, or binary. (Defaults to false) method: A string specifying the + request method. (Defaults to GET or POST) headers: A table containing HTTP request + headers. e.g.{ Pragma="no-cache" } maxRedirects: An integer limiting the number + of HTTP redirections to automatically follow. (Defaults to 8) username: A string + specifying the username for protected pages. password: A string specifying the + password for protected pages. formFields: A table containing form items to submit. + (for POST method only) e.g.{ name="bob", email=" [emailΒ protected] " }' + - name: callbackFunction + type: callback + description: 'This is the function that should receive the data returned from + the remote server. The callback argument list should be: responseData - A string + containing the remote response responseInfo - A table containing: success - + A boolean indicating if the request was successful. statusCode - An integer + status/error code. See the list of possible error values below. headers - A + table containing the HTTP response headers arguments... - The arguments that + were passed into fetchRemote' + - name: callbackArguments + type: table + description: A table containing arguments you may want to pass to the callback. examples: - path: examples/fetchRemote-1.lua description: Sending email via a web service (adopted from examples onhttps://documentation.mailgun.com/en/latest/user_manual.html) @@ -12,6 +44,12 @@ server: - path: examples/fetchRemote-2.lua description: Changing post content of an IPS forum thread via its API. side: server + returns: + values: + - type: bool + name: value + description: Returns a request value which can be used with getRemoteRequestInfo + or abortRemoteRequest notes: - type: info content: Client side function only works with the server the player is connected @@ -22,7 +60,6 @@ server: content: When using toJSON for submitting data, make sure to use string.sub(data, 2, -2) to remove the initial and final brackets, as many APIs will not understand the request - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -30,3 +67,4 @@ server: - Missing section: CallbackstatusCodeerror values ' + requires_review: true diff --git a/functions/Resource/getRemoteRequestInfo.yaml b/functions/Resource/getRemoteRequestInfo.yaml index 578ac3ca..244f79da 100644 --- a/functions/Resource/getRemoteRequestInfo.yaml +++ b/functions/Resource/getRemoteRequestInfo.yaml @@ -1,9 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRemoteRequestInfo -server: +shared: name: getRemoteRequestInfo description: Gets informations of an [fetchRemote](/wiki/FetchRemote "FetchRemote") or [callRemote](/wiki/CallRemote "CallRemote") request info. - parameters: [] + parameters: + - name: theRequest + type: request + description: returned from fetchRemote , callRemote or getRemoteRequests + - name: postDataLength + type: int + description: MISSING_PARAM_DESC + default: 0 [, bool includeHeaders = false ] examples: - path: examples/getRemoteRequestInfo-1.lua description: This example gets infos about all pending requests and prints them @@ -13,4 +20,11 @@ server: description: This example gets infos about all pending requests and prints them in debugscript side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table when valid, false otherwise + + The table contains:' + requires_review: true diff --git a/functions/Resource/getRemoteRequests.yaml b/functions/Resource/getRemoteRequests.yaml index bebbdc23..c16c0a03 100644 --- a/functions/Resource/getRemoteRequests.yaml +++ b/functions/Resource/getRemoteRequests.yaml @@ -1,9 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRemoteRequests -server: +shared: name: getRemoteRequests description: Gets all [fetchRemote](/wiki/FetchRemote "FetchRemote") and [callRemote](/wiki/CallRemote "CallRemote") requests currently running. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource to get all requests from + default: nil examples: - path: examples/getRemoteRequests-1.lua description: This example prints how many request are currently pending. @@ -11,4 +15,10 @@ server: - path: examples/getRemoteRequests-2.lua description: This example prints how many request are currently pending. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table with all requests, false if an invalid resource was + provided + requires_review: true diff --git a/functions/Resource/getResourceACLRequests.yaml b/functions/Resource/getResourceACLRequests.yaml index 54e556c4..21e39190 100644 --- a/functions/Resource/getResourceACLRequests.yaml +++ b/functions/Resource/getResourceACLRequests.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceACLRequests -server: +shared: name: getResourceACLRequests description: This function retrieves the ACL request section from the meta.xml file of the given resource. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource to get the ACL requests for. examples: - path: examples/getResourceACLRequests-1.lua description: This function lists ACL requests from all resources in the client console. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table with the ACL requests for the given resource, or + false if the resource is not valid. A valid resource with no ACL requests will + return an empty table. + oop: + element: resource + method: getACLRequests + variable: aclRequests + static: false + requires_review: true diff --git a/functions/Resource/getResourceConfig.yaml b/functions/Resource/getResourceConfig.yaml index 679b5d2e..3398e23c 100644 --- a/functions/Resource/getResourceConfig.yaml +++ b/functions/Resource/getResourceConfig.yaml @@ -1,14 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceConfig -server: +shared: name: getResourceConfig description: This function is used to return the root node of a configuration file. Config files must be predefined in a resource's [meta file](/wiki/Meta.xml "Meta.xml"). An alternative way to load XML files is to use [xmlLoadFile](/wiki/XmlLoadFile "XmlLoadFile"). - parameters: [] + parameters: + - name: filePath + type: string + description: 'The filepath of the file in the following format: ":resourceName/path" + . ''resourceName'' is the name of the resource the file is in, and ''path'' + is the path from the root directory of the resource to the file.' examples: - path: examples/getResourceConfig-1.lua description: This example opens a configuration file and prints the value of the 'attr' attribute of the first 'group' node. side: server - incomplete: true + returns: + values: + - type: xmlnode + name: value + description: Returns the root node of the specified configuration file. If the + file is corrupted, not defined in the meta file or doesn't exist, returns false. + requires_review: true diff --git a/functions/Resource/getResourceDynamicElementRoot.yaml b/functions/Resource/getResourceDynamicElementRoot.yaml index 1a8d4b6f..6b252556 100644 --- a/functions/Resource/getResourceDynamicElementRoot.yaml +++ b/functions/Resource/getResourceDynamicElementRoot.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceDynamicElementRoot -server: +shared: name: getResourceDynamicElementRoot description: This function retrieves the *dynamic element root* of a specified [resource](/wiki/Resource "Resource"). The *dynamic element root* is the parent of elements that are created by scripts (e.g. with [createObject](/wiki/CreateObject "CreateObject")) unless they specify a different parent. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource of which dynamic element root we want. examples: - path: examples/getResourceDynamicElementRoot-1.lua description: This example shows how to get all elements by specific type, created only by resource scripts (not maps). side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element of the resource's dynamic element root if the + resource specified was valid and active (currently running), false otherwise. + oop: + element: resource + method: getDynamicElementRoot + variable: dynamicElementRoot + static: false + requires_review: true diff --git a/functions/Resource/getResourceExportedFunctions.yaml b/functions/Resource/getResourceExportedFunctions.yaml index 7dcb213b..88e36c1c 100644 --- a/functions/Resource/getResourceExportedFunctions.yaml +++ b/functions/Resource/getResourceExportedFunctions.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceExportedFunctions -server: +shared: name: getResourceExportedFunctions description: Returns a table containing the names of the functions that a resource exports. It will return the exports of the current resource if there is no argument passed in. - parameters: [] + parameters: + - name: resource theResource + type: '[' + description: MISSING_PARAM_DESC + default: getThisResource( examples: - path: examples/getResourceExportedFunctions-1.lua description: This simple example will output the names of the functions that the "scoreboard" resource exports. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of function names if successful, false otherwise. + oop: + element: resource + method: getExportedFunctions + variable: exportedFunctions + static: false + requires_review: true diff --git a/functions/Resource/getResourceFromName.yaml b/functions/Resource/getResourceFromName.yaml index 9b54b1c6..a7a11a2a 100644 --- a/functions/Resource/getResourceFromName.yaml +++ b/functions/Resource/getResourceFromName.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceFromName -server: +shared: name: getResourceFromName description: This function is used to retrieve a resource from its name. A resource's name is the same as its folder or file archive name on the server (without the extension). - parameters: [] + parameters: + - name: resourceName + type: string + description: the name of the resource you wish to get. examples: - path: examples/getResourceFromName-1.lua description: This example prints out a message to the chatbox when a resource namedplayerblipsis started. side: server - incomplete: true + returns: + values: + - type: resource + name: value + description: Returns the resource with the specified name, or false if no resource + of that name exists. Note that clientside this will also return false for resources + that are in the loaded state, since the client is unaware of resources that + have not been started. + oop: + element: Resource + note: This function is a static function underneath the Resource class. OOP function + available client side + method: ) + static: true + requires_review: true diff --git a/functions/Resource/getResourceGUIElement.yaml b/functions/Resource/getResourceGUIElement.yaml index 9a56cb18..e12795b1 100644 --- a/functions/Resource/getResourceGUIElement.yaml +++ b/functions/Resource/getResourceGUIElement.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceGUIElement -client: +shared: name: getResourceGUIElement description: This function retrieves a resource's GUI element. The resource's GUI element is the element in the element tree which is the default parent of all @@ -7,10 +7,19 @@ client: called **guiRoot**, and each resource has one of these. You can attach event handlers to this element to easily capture events that originate from your resource (and global events that originate from the root element). - parameters: [] + parameters: + - name: resource theResource + type: '[' + description: MISSING_PARAM_DESC + default: getThisResource( examples: - path: examples/getResourceGUIElement-1.lua description: This example provides a function for destroying all the GUI elements of a resource. side: client - incomplete: true + returns: + values: + - type: element + name: value + description: Returns the root GUI element that contains all the other GUI elements. + requires_review: true diff --git a/functions/Resource/getResourceInfo.yaml b/functions/Resource/getResourceInfo.yaml index 77ce0414..d38939fc 100644 --- a/functions/Resource/getResourceInfo.yaml +++ b/functions/Resource/getResourceInfo.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceInfo -server: +shared: name: getResourceInfo description: This function retrieves the value of any attribute in a resource info tag. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource we are getting the info from. + - name: attribute + type: string + description: the name of the attribute we want info about. examples: - path: examples/getResourceInfo-1.lua description: This function tells the server who's the author who made the currently running resource. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string with the attribute value if it exists, false otherwise. + oop: + element: resource + method: getInfo + static: false + requires_review: true diff --git a/functions/Resource/getResourceLastStartTime.yaml b/functions/Resource/getResourceLastStartTime.yaml index 16473f19..fb564f3f 100644 --- a/functions/Resource/getResourceLastStartTime.yaml +++ b/functions/Resource/getResourceLastStartTime.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceLastStartTime -server: +shared: name: getResourceLastStartTime description: Used to check the last starting time and date of a resource - parameters: [] + parameters: + - name: theResource + type: resource + description: The resource of which you'd like to check the last starting time. examples: - path: examples/getResourceLastStartTime-1.lua description: This function outputs to chatbox when the current resource was started. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: If successful, returns the UNIX timestamp when the resource was last + started, or the string "never" if the resource has not been started yet, otherwise + false. Use in conjunction with getRealTime in order to retrieve detailed information. + oop: + element: resource + method: getLastStartTime + variable: lastStartTime + static: false + requires_review: true diff --git a/functions/Resource/getResourceLoadFailureReason.yaml b/functions/Resource/getResourceLoadFailureReason.yaml index 4a7ff5bc..5c8821eb 100644 --- a/functions/Resource/getResourceLoadFailureReason.yaml +++ b/functions/Resource/getResourceLoadFailureReason.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceLoadFailureReason -server: +shared: name: getResourceLoadFailureReason description: This function retrieves the reason why a resource failed to start. - parameters: [] + parameters: + - name: theResource + type: resource + description: The resource you wish to check. examples: - path: examples/getResourceLoadFailureReason-1.lua description: 'This example checks if there''s a resource that failed to load, then outputs "Resource: ''resourceName'' failed to load because ''reason''." .' side: server - incomplete: true + returns: + values: + - type: string + name: value + description: If the resource failed to load, returns a string with the failure + reason in it. If it loaded successfully, returns an empty string. Returns false + if the resource doesn't exist. + oop: + element: resource + method: getLoadFailureReason + variable: loadFailureReason + static: false + requires_review: true diff --git a/functions/Resource/getResourceLoadTime.yaml b/functions/Resource/getResourceLoadTime.yaml index 476dd649..52fcaf99 100644 --- a/functions/Resource/getResourceLoadTime.yaml +++ b/functions/Resource/getResourceLoadTime.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceLoadTime -server: +shared: name: getResourceLoadTime description: Gets the date and time at which a resource was last loaded in the server. - parameters: [] + parameters: + - name: res + type: resource + description: the resource you want to know the load time of. examples: - path: examples/getResourceLoadTime-1.lua description: This code outputs the date and time at which the scoreboard resource @@ -12,4 +15,16 @@ server: description: This code outputs the date and time at which the specified resource started. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: If successful, returns the UNIX timestamp when the resource was loaded, + otherwise false. Use in conjunction with getRealTime in order to retrieve detailed + information. + oop: + element: resource + method: getLoadTime + variable: loadTime + static: false + requires_review: true diff --git a/functions/Resource/getResourceMapRootElement.yaml b/functions/Resource/getResourceMapRootElement.yaml index d53c0c74..e94cb8f3 100644 --- a/functions/Resource/getResourceMapRootElement.yaml +++ b/functions/Resource/getResourceMapRootElement.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceMapRootElement -server: +shared: name: getResourceMapRootElement description: This function retrieves the root element of a certain [map](/wiki/Map?action=edit&redlink=1 "Map (page does not exist)") in a specified [resource](/wiki/Resource "Resource"). - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource where the map is located + - name: mapName + type: string + description: name of the maps which root element we want to retrieve, file extension + is required examples: - path: examples/getResourceMapRootElement-1.lua description: This example shows how to get all elements of specific type only from one map. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an the resource's map root element if the map exists and + resource specified was valid and active (currently running), false otherwise. + oop: + element: resource + method: getMapRootElement + static: false + requires_review: true diff --git a/functions/Resource/getResourceName.yaml b/functions/Resource/getResourceName.yaml index 100e84a0..85cd9da6 100644 --- a/functions/Resource/getResourceName.yaml +++ b/functions/Resource/getResourceName.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceName -server: +shared: name: getResourceName description: This function gets the name of the specified resource. - parameters: [] + parameters: + - name: resource res + type: '[' + description: MISSING_PARAM_DESC + default: getThisResource( examples: - path: examples/getResourceName-1.lua description: This simple example outputs a message in the console whenever a resource starts, stating the name of the resource. side: server + returns: + values: + - type: string + name: value + description: Returns a string with the resource name in it, or false if the resource + does not exist. + oop: + element: resource + method: getName + variable: name + static: false pair: renameResource notes: - type: info @@ -16,4 +31,4 @@ server: - type: info content: If you want to access the name of any resource-data you should use getElementID . - incomplete: true + requires_review: true diff --git a/functions/Resource/getResourceOrganizationalPath.yaml b/functions/Resource/getResourceOrganizationalPath.yaml index 49ec6512..997de354 100644 --- a/functions/Resource/getResourceOrganizationalPath.yaml +++ b/functions/Resource/getResourceOrganizationalPath.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceOrganizationalPath -server: +shared: name: getResourceOrganizationalPath description: This function returns the organizational file path (e.g. *\[admin]*) of a resource. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource of which you want to know the organizational path examples: - path: examples/getResourceOrganizationalPath-1.lua description: This example outputs the path of the current resource when it is started. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the organizational folder name of the resource . It returns + empty string if the resource is on root resources folder. It returns false if + the resource could not be found. + oop: + element: resource + method: getOrganizationalPath + variable: organizationalPath + static: false + requires_review: true diff --git a/functions/Resource/getResourceRootElement.yaml b/functions/Resource/getResourceRootElement.yaml index f32e251a..d0c80453 100644 --- a/functions/Resource/getResourceRootElement.yaml +++ b/functions/Resource/getResourceRootElement.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceRootElement -server: +shared: name: getResourceRootElement description: This function retrieves a resource's root element. The resource's root element is the element in the element tree which is the parent of all elements @@ -7,7 +7,12 @@ server: elsewhere). You can attach event handlers to this element to easily capture events that originate from your resource (and global events that originate from the root element). - parameters: [] + parameters: + - name: theResource + type: '[resource' + description: the resource whose root element we are getting. If not specified, + assumes the current resource. (the resource returned from getThisResource ) + default: getThisResource( examples: - path: examples/getResourceRootElement-1.lua description: This example retrieves the current resource's root element and attaches @@ -15,4 +20,15 @@ server: called only when thecurrentresource is started rather than whenanyresource is started, thereby reducing unnecessary overhead. side: server - incomplete: true + returns: + values: + - type: element + name: value + description: Returns an element representing the resource's root, false if the + specified resource doesn't exist. + oop: + element: resource + method: getRootElement + variable: rootElement + static: false + requires_review: true diff --git a/functions/Resource/getResourceState.yaml b/functions/Resource/getResourceState.yaml index 2bf3ba51..f901c44c 100644 --- a/functions/Resource/getResourceState.yaml +++ b/functions/Resource/getResourceState.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResourceState -server: +shared: name: getResourceState description: This function returns the state of a given resource - parameters: [] + parameters: + - name: theResource + type: resource + description: The resource you wish to get the state of. examples: - path: examples/getResourceState-1.lua description: This example returns the state of a given resource. Syntax:/state side: server - incomplete: true + returns: + values: + - type: string + name: value + description: 'If successful returns a string with the resource state in it, false + otherwise. + + The state can be one of:' + oop: + element: resource + method: getState + variable: state + static: false + requires_review: true diff --git a/functions/Resource/getResources.yaml b/functions/Resource/getResources.yaml index 8744f1c3..a0079b2a 100644 --- a/functions/Resource/getResources.yaml +++ b/functions/Resource/getResources.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetResources -server: +shared: name: getResources description: This function retrieves a table of all the resources that exist on the server. @@ -8,4 +8,13 @@ server: - path: examples/getResources-1.lua description: This function lists all loaded resources in the console. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of resources. + oop: + element: Resource + method: ) + static: true + requires_review: true diff --git a/functions/Resource/getThisResource.yaml b/functions/Resource/getThisResource.yaml index 49318fde..0f565f2f 100644 --- a/functions/Resource/getThisResource.yaml +++ b/functions/Resource/getThisResource.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetThisResource -server: +shared: name: getThisResource description: This function retrieves the resource from which the function call was made. @@ -11,9 +11,19 @@ server: called only when thecurrentresource is started rather than whenanyresource is started, thereby reducing unnecessary overhead. side: server + returns: + values: + - type: resource + name: value + description: Returns the resource in which the current script is. + oop: + element: Resource + note: This function is a static function underneath the Resource class. + method: ) + static: true notes: - type: info content: Every resource has a predefined global variable called resource that contains the resource pointer for that resource, in other words, the value that this function returns. - incomplete: true + requires_review: true diff --git a/functions/Resource/isResourceArchived.yaml b/functions/Resource/isResourceArchived.yaml index b8798ada..2c538849 100644 --- a/functions/Resource/isResourceArchived.yaml +++ b/functions/Resource/isResourceArchived.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsResourceArchived -server: +shared: name: isResourceArchived description: Checks whether the specified resource is archived. (Currently running from a ZIP file) - parameters: [] + parameters: + - name: resourceElement + type: resource + description: The resource to check. examples: - path: examples/isResourceArchived-1.lua description: This example stops the resource if it's archived. @@ -18,4 +21,15 @@ server: oriented variable.(It's important to note that you need to enable OOP in meta.xml to use this) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the selected resource is archived, false if it is + not archived, and nil if some kind of problem occurred. + oop: + element: resource + method: isArchived + variable: archived + static: false + requires_review: true diff --git a/functions/Resource/isResourceProtected.yaml b/functions/Resource/isResourceProtected.yaml index 0b50c959..ae35de52 100644 --- a/functions/Resource/isResourceProtected.yaml +++ b/functions/Resource/isResourceProtected.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsResourceProtected -server: +shared: name: isResourceProtected description: This will check if a resource is currently protected, as defined in [mtaserver.conf](/wiki/Server_mtaserver.conf#resource "Server mtaserver.conf"). - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource to check examples: - path: examples/isResourceProtected-1.lua description: This example creates a command which allows you to check if the given resource with the name provided is protected. The command is "/isprotected [Resource Name]". side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the resource is 'protected', false otherwise. + oop: + element: resource + method: isProtected + variable: protected + static: false + requires_review: true diff --git a/functions/Resource/refreshResources.yaml b/functions/Resource/refreshResources.yaml index 6ab72448..32086533 100644 --- a/functions/Resource/refreshResources.yaml +++ b/functions/Resource/refreshResources.yaml @@ -1,18 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RefreshResources -server: +shared: name: refreshResources description: This function finds new resources and checks for changes to the current ones. - parameters: [] + parameters: + - name: refreshAll + type: bool + description: If true MTA will check for changes in all resources. If false , MTA + will only check for new resources and try to reload resources with errors + default: 'false' + - name: targetResource + type: resource + description: MISSING_PARAM_DESC + default: nil examples: - path: examples/refreshResources-1.lua description: This example will refresh resources when a player uses the /refreshresources command just like the hardcoded /refreshall. side: server + returns: + values: + - type: bool + name: value + description: Returns true if refresh was successful, false otherwise. notes: - type: info content: The resource using this function needs access to function.refreshResources in order for this function to work. You can give it the access by including an aclrequest command in its meta.xml file or by adding it to the admin ACL group. - incomplete: true + requires_review: true diff --git a/functions/Resource/removeResourceFile.yaml b/functions/Resource/removeResourceFile.yaml index 292cf545..4e4769e7 100644 --- a/functions/Resource/removeResourceFile.yaml +++ b/functions/Resource/removeResourceFile.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveResourceFile -server: +shared: name: removeResourceFile description: This function removes a file from the resource. - parameters: [] + parameters: + - name: theResource + type: resource + description: The resource element. + - name: fileName + type: string + description: The filename what you wan't to delete. examples: - path: examples/removeResourceFile-1.lua description: This example removes a .txt file from the resource sx_remanager (in-game script editor) when started. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if file was deleted, otherwise false if the resource + is in use or the file doesn't exist. + oop: + element: resource + method: removeFile + static: false + requires_review: true diff --git a/functions/Resource/renameResource.yaml b/functions/Resource/renameResource.yaml index be17b0a5..6e2a2492 100644 --- a/functions/Resource/renameResource.yaml +++ b/functions/Resource/renameResource.yaml @@ -1,11 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RenameResource -server: +shared: name: renameResource description: This function renames a resource. - parameters: [] + parameters: + - name: theResource + type: string/resource + description: The name of resource or the resource you want to rename. + - name: newResourceName + type: string + description: The name of what the resource should be renamed to. + - name: organizationalPath + type: string + description: If you want to store the new resource inside a category. examples: - path: examples/renameResource-1.lua description: 'This example renames the resource "reload" to "reload2":' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the resource has been renamed successfully, false + otherwise. This could fail if the resource name already is in use, if a directory + already exists with the name you've specified (but this isn't a valid resource) + or if the name you specify isn't valid. It could also fail if the disk was full + or for other similar reasons. Won't work on a started resource or if the resource + is not loaded (not known by MTA (use /refresh)) + oop: + element: resource + method: rename + variable: name + static: false pair: getResourceName - incomplete: true + requires_review: true diff --git a/functions/Resource/restartResource.yaml b/functions/Resource/restartResource.yaml index b91457e0..0889b3ef 100644 --- a/functions/Resource/restartResource.yaml +++ b/functions/Resource/restartResource.yaml @@ -1,9 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RestartResource -server: +shared: name: restartResource description: This function restarts a running resource. Restarting will destroy all the elements that the resource has created (as stopping the resource does). - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource you want to restart. + - name: persistent + type: bool + description: Unused + default: 'false' + - name: configs + type: bool + description: Reload configs? + default: 'true' + - name: maps + type: bool + description: Reload maps? + default: 'true' + - name: scripts + type: bool + description: Reload (server) scripts? + default: 'true' + - name: html + type: bool + description: Reload html files (for resource web access)? + default: 'true' + - name: clientConfigs + type: bool + description: Reload client configs? + default: 'true' + - name: clientScripts + type: bool + description: Reload client scripts? + default: 'true' + - name: clientFiles + type: bool + description: Reload files? + default: 'true' examples: - path: examples/restartResource-1.lua description: 'Example 1: This function restarts all running resources.' @@ -12,6 +47,16 @@ server: description: 'Example 2: This example will restart the specify resource every 3600000 milliseconds (hour).' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the resource was restarted, false if the resource + wasn't running, or an invalid resource was passed. + oop: + element: resource + method: restart + static: false notes: - type: info content: Don't forget to give admin rights to the resource, in which you are using @@ -22,4 +67,4 @@ server: event triggered and the restarted instance will receive an onResourceStart event. Remember that the element and resource variables will be invalidated during the restart, though of course, the resource's name will not. - incomplete: true + requires_review: true diff --git a/functions/Resource/setResourceInfo.yaml b/functions/Resource/setResourceInfo.yaml index f087c4a9..4490c8a3 100644 --- a/functions/Resource/setResourceInfo.yaml +++ b/functions/Resource/setResourceInfo.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetResourceInfo -server: +shared: name: setResourceInfo description: This function sets the value of any attribute in a resource info tag. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource we are setting info to. + - name: attribute + type: string + description: the name of the attribute that is to be set. + - name: value + type: string + description: the value of this attribute examples: - path: examples/setResourceInfo-1.lua description: This function sets the author of the current resource. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the info was successfully set, false otherwise + oop: + element: resource + method: setInfo + static: false notes: - type: info content: This function requires the resource to have 'ModifyOtherObjects' ACL right. - incomplete: true + requires_review: true diff --git a/functions/Resource/startResource.yaml b/functions/Resource/startResource.yaml index de76f354..7c315afb 100644 --- a/functions/Resource/startResource.yaml +++ b/functions/Resource/startResource.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/StartResource -server: +shared: name: startResource description: This function starts a resource either persistently or as a dependency of the current resource. If you start the resource persistently, the resource @@ -7,9 +7,69 @@ server: or by the server admin. A resource started as a dependency will stop when your resource stops, if no other resources have it as a depdendency. This is the same effect as using an *include* in your [meta.xml](/wiki/Meta.xml "Meta.xml") file. - parameters: [] + parameters: + - name: resourceToStart + type: resource + description: The resource that should be started. + - name: persistent + type: bool + description: A boolean specifying if the resource should continue to run even + after the current resource has been stopped or not. If this is true then the + resource will run until another resource or user terminates it or the server + shuts down. If this is false then resourceToStart will stop when thisResource + stops. + default: 'false' + - name: startIncludedResources + type: bool + description: A boolean specifying if the resource's included/dependant resources + will be started. + default: 'true' + - name: loadServerConfigs + type: bool + description: A boolean specifying if server side config (XML) files should be + loaded with the resource. + default: 'true' + - name: loadMaps + type: bool + description: A boolean specifying if any .map files will be started with the resource. + default: 'true' + - name: loadServerScripts + type: bool + description: A boolean specifying if server side script files should be started + alongside the resource. + default: 'true' + - name: loadHTML + type: bool + description: A boolean specifying if HTML files should be started alongside the + resource. + default: 'true' + - name: loadClientConfigs + type: bool + description: A boolean specifying if client configs should be loaded alongside + the resource. + default: 'true' + - name: loadClientScripts + type: bool + description: A boolean specifying if client scripts should be loaded and started + alongside the resource. + default: 'true' + - name: loadFiles + type: bool + description: A boolean specifying if client-side files should be loaded alongside + the resource. + default: 'true' examples: - path: examples/startResource-1.lua description: This example starts a specified resource with the command; "/resource-start". side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the resource has been started successfully, false + otherwise. + oop: + element: resource + method: start + static: false + requires_review: true diff --git a/functions/Resource/stopResource.yaml b/functions/Resource/stopResource.yaml index a117e079..e1d21208 100644 --- a/functions/Resource/stopResource.yaml +++ b/functions/Resource/stopResource.yaml @@ -1,16 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/StopResource -server: +shared: name: stopResource description: This function stops a running resource. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource that should be stopped. examples: - path: examples/stopResource-1.lua description: This function stops all running resources except the current one. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the resource was stopped, false if the stopping failed, + or an invalid resource was passed. + oop: + element: resource + method: stop + static: false notes: - type: info content: This function does not stop the resource immediately, so don't expect that it starts stopping until the onResourceStop event for that resource is triggered. This happens after the scripts are done executing for this server frame. - incomplete: true + requires_review: true diff --git a/functions/Resource/updateResourceACLRequest.yaml b/functions/Resource/updateResourceACLRequest.yaml index 4aef0dd6..e003448d 100644 --- a/functions/Resource/updateResourceACLRequest.yaml +++ b/functions/Resource/updateResourceACLRequest.yaml @@ -1,14 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UpdateResourceACLRequest -server: +shared: name: updateResourceACLRequest description: This function changes the access for one ACL request of the given resource. - parameters: [] + parameters: + - name: theResource + type: resource + description: the resource to set the ACL request for. + - name: rightName + type: string + description: a string with the name of the right to set the access for. This has + to match an existing ACL request. + - name: access + type: bool + description: a boolean value setting the access. True is for allow, and false + for deny. + - name: byWho + type: string + description: a string value to identity who is changing the setting. + default: '""' examples: - path: examples/updateResourceACLRequest-1.lua description: This function will allow all ACL requests from 'theResource' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the setting was changed, or false if no change was + required or there was a problem with the arguments. notes: - type: info content: This function is protected by default and must be explicitly allowed in the server ACL. - incomplete: true + requires_review: true diff --git a/functions/SVG/svgCreate.yaml b/functions/SVG/svgCreate.yaml index 7ce0c715..56e9cd69 100644 --- a/functions/SVG/svgCreate.yaml +++ b/functions/SVG/svgCreate.yaml @@ -1,9 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgCreate -client: +shared: name: svgCreate description: Creates an [svg](/wiki/Svg "Svg") from size (blank document), filepath or raw data. - parameters: [] + parameters: + - name: width + type: int + description: Desired width, preferably power of two (16, 32, 64 etc.), maximum + is 4096 + - name: height + type: int + description: MISSING_PARAM_DESC + - name: string pathOrRawData, function callback ( element svg + type: '[,' + description: MISSING_PARAM_DESC examples: - path: examples/svgCreate-1.lua description: This is a basic example of how you can create an SVG from raw data @@ -14,6 +24,12 @@ client: argument. You can use the F2 key to set the SVG to a random size and see the update callback output a message to debugscript. side: client + returns: + values: + - type: svg + name: value + description: This is a basic example of how you can create an SVG from raw data + (or path) and draw it with dxDrawImage via onClientRender . notes: - type: info content: SVG in MTA is handled by the lunasvg rendering engine - Some features @@ -26,4 +42,4 @@ client: the function had performed its task. This is no longer the case - each SVG can now store a single callback function (optional) which is fired every time the SVG texture has been changed/updated. - incomplete: true + requires_review: true diff --git a/functions/SVG/svgGetDocumentXML.yaml b/functions/SVG/svgGetDocumentXML.yaml index bc868c79..a1803934 100644 --- a/functions/SVG/svgGetDocumentXML.yaml +++ b/functions/SVG/svgGetDocumentXML.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgGetDocumentXML -client: +shared: name: svgGetDocumentXML description: Gets the underlying XML document from an SVG element. - parameters: [] + parameters: + - name: svgElement + type: svg + description: The svg element you want to get the XML document of. examples: [] - incomplete: true + returns: + values: + - type: xmlnode + name: value + description: See the example for svgSetDocumentXML meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +19,4 @@ client: - Missing section: Contents ' + requires_review: true diff --git a/functions/SVG/svgGetSize.yaml b/functions/SVG/svgGetSize.yaml index 31bdfb3e..5ce34934 100644 --- a/functions/SVG/svgGetSize.yaml +++ b/functions/SVG/svgGetSize.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgGetSize -client: +shared: name: svgGetSize description: Gets the underlying XML document from an SVG element. - parameters: [] + parameters: + - name: svgElement + type: svg + description: The svg you want to get the size of. examples: [] - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: See the example for svgSetSize . meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +21,4 @@ client: - Missing section: Contents ' + requires_review: true diff --git a/functions/SVG/svgSetDocumentXML.yaml b/functions/SVG/svgSetDocumentXML.yaml index 39a10661..220aefea 100644 --- a/functions/SVG/svgSetDocumentXML.yaml +++ b/functions/SVG/svgSetDocumentXML.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgSetDocumentXML -client: +shared: name: svgSetDocumentXML description: Sets the underlying XML document of an SVG element. - parameters: [] + parameters: + - name: svgElement + type: svg + description: The svg element you want to set the XML document of + - name: xmlDocument + type: xmlnode + description: An xmlnode containing the data to be set on the SVG document + - name: function callback ( element svg + type: '[,' + description: MISSING_PARAM_DESC examples: - path: examples/svgSetDocumentXML-1.lua description: This example creates ansvgelement including a keybind (F2) to add a child rect node, with the use of callbacks to notify in debugscript when the SVG was updated. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: This example creates an svg element including a keybind (F2) to add + a child rect node, with the use of callbacks to notify in debugscript when the + SVG was updated. + requires_review: true diff --git a/functions/SVG/svgSetSize.yaml b/functions/SVG/svgSetSize.yaml index 19cd26e9..3358405a 100644 --- a/functions/SVG/svgSetSize.yaml +++ b/functions/SVG/svgSetSize.yaml @@ -1,21 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgSetSize -client: +shared: name: svgSetSize description: Sets the underlying XML document from an SVG element. - parameters: [] + parameters: + - name: svgElement + type: svg + description: The svg element you want to set the size of. + - name: width + type: int + description: Desired width, preferably power of two (16, 32, 64 etc.), maximum + is 4096 + - name: height + type: int + description: MISSING_PARAM_DESC + - name: function callback ( element svg + type: '[,' + description: MISSING_PARAM_DESC examples: - path: examples/svgSetSize-1.lua description: This example creates ansvgelement including a keybind (F2) to resize the SVG randomly, with the use of callbacks to notify in debugscript when the SVG was updated. side: client + returns: + values: + - type: bool + name: value + description: This example creates an svg element including a keybind (F2) to resize + the SVG randomly, with the use of callbacks to notify in debugscript when the + SVG was updated. notes: - type: important content: Before r21155 ( 3157905 ) the provided callback wasn't stored on the SVG and was only fired once after the function had performed its task. This is no longer the case - each SVG can now store a single callback function (optional) which is fired every time the SVG texture has been changed/updated. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -23,3 +42,4 @@ client: - Missing section: Contents ' + requires_review: true diff --git a/functions/SVG/svgSetUpdateCallback.yaml b/functions/SVG/svgSetUpdateCallback.yaml index 5ab89714..b562ccdd 100644 --- a/functions/SVG/svgSetUpdateCallback.yaml +++ b/functions/SVG/svgSetUpdateCallback.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SvgSetUpdateCallback -client: +shared: name: svgSetUpdateCallback description: Sets the update callback of an [svg](/wiki/Svg "Svg") element - parameters: [] + parameters: + - name: svgElement + type: svg + description: The svg you want to set the callback function of. + - name: / bool callback + type: function + description: MISSING_PARAM_DESC examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: For example of callback usage, see svgSetSize or svgSetDocumentXML + . meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -12,3 +23,4 @@ client: - Missing section: Contents ' + requires_review: true diff --git a/functions/Searchlight/createSearchLight.yaml b/functions/Searchlight/createSearchLight.yaml index ea0ad48e..62e17d4a 100644 --- a/functions/Searchlight/createSearchLight.yaml +++ b/functions/Searchlight/createSearchLight.yaml @@ -1,19 +1,60 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateSearchLight -client: +shared: name: createSearchLight description: This function creates a [searchlight](/wiki/Element/Searchlight "Element/Searchlight"). A [searchlight](/wiki/Element/Searchlight "Element/Searchlight") is a spotlight which looks like the one available in the Police Maverick. - parameters: [] + parameters: + - name: startX + type: float + description: the X coordinate where the searchlight light cone will start. + - name: startY + type: float + description: the Y coordinate where the searchlight light cone will start. + - name: startZ + type: float + description: the Z coordinate where the searchlight light cone will start. + - name: endX + type: float + description: the X coordinate of the direction where the searchlight will point + to. + - name: endY + type: float + description: the Y coordinate of the direction where the searchlight will point + to. + - name: endZ + type: float + description: the Z coordinate of the direction where the searchlight will point + to. + - name: startRadius + type: float + description: the radius of the searchlight's light cone in its beginning. + - name: endRadius + type: float + description: the radius of the searchlight's light cone in its end. + - name: renderSpot + type: bool + description: if true , the searchlight will lighten the surface where it ends. + default: 'true' examples: - path: examples/createSearchLight-1.lua description: This example allows players to wear a helmet lantern, which can be toggled on or off by pressing O or using/togglelantern. It uses createSearchLight to create the illumination effect. side: client + returns: + values: + - type: searchlight + name: value + description: If every argument is correct and the limit of 1000 searchlights has + not been reached, this function returns a searchlight element . Otherwise, it + returns false . + oop: + element: element + constructorclass: SearchLight notes: - type: tip content: You should only use this function when you are sure that the searchlight will point upwards or downwards . Using them horizontally or almost horizontally will generate visual artifacts in the searchlight. - incomplete: true + requires_review: true diff --git a/functions/Searchlight/getSearchLightEndPosition.yaml b/functions/Searchlight/getSearchLightEndPosition.yaml index 9a1c5f51..473e1120 100644 --- a/functions/Searchlight/getSearchLightEndPosition.yaml +++ b/functions/Searchlight/getSearchLightEndPosition.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSearchLightEndPosition -client: +shared: name: getSearchLightEndPosition description: This function gets the end position of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to get the position where the searchlight's light + cone ends. examples: - path: examples/getSearchLightEndPosition-1.lua description: '' side: client + returns: + values: + - type: float float float + name: value + description: If the specified searchlight element is valid, this function will + return three float , which are the three coordinates of searchlight's end position. + If not, it will return false plus an error message. + oop: + element: searchlight + method: getEndPosition + variable: endPosition + static: false pair: setSearchLightEndPosition - incomplete: true + requires_review: true diff --git a/functions/Searchlight/getSearchLightEndRadius.yaml b/functions/Searchlight/getSearchLightEndRadius.yaml index e7d32877..d3887fff 100644 --- a/functions/Searchlight/getSearchLightEndRadius.yaml +++ b/functions/Searchlight/getSearchLightEndRadius.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSearchLightEndRadius -client: +shared: name: getSearchLightEndRadius description: This function gets the end radius of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to get the radius of the searchlight's light cone + in its end. examples: - path: examples/getSearchLightEndRadius-1.lua description: '' side: client + returns: + values: + - type: float + name: value + description: If the specified searchlight element is valid, this function will + return one float , which is the searchlight's end radius. If not, it will return + false plus an error message. + oop: + element: searchlight + method: getEndRadius + variable: endRadius + static: false pair: setSearchLightEndRadius - incomplete: true + requires_review: true diff --git a/functions/Searchlight/getSearchLightStartPosition.yaml b/functions/Searchlight/getSearchLightStartPosition.yaml index 73d7fd41..f6c71c54 100644 --- a/functions/Searchlight/getSearchLightStartPosition.yaml +++ b/functions/Searchlight/getSearchLightStartPosition.yaml @@ -1,12 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSearchLightStartPosition -client: +shared: name: getSearchLightStartPosition description: This function gets the start position of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to get the position where the searchlight's light + cone starts. examples: - path: examples/getSearchLightStartPosition-1.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: If the specified searchlight element is valid, this function will + return three float , which are the three coordinates of searchlight's start + position. If not, it will return false plus an error message. + oop: + element: searchlight + method: getStartPosition + variable: startPosition + static: false pair: setSearchLightStartPosition - incomplete: true + requires_review: true diff --git a/functions/Searchlight/getSearchLightStartRadius.yaml b/functions/Searchlight/getSearchLightStartRadius.yaml index 4e893d4e..6e62b860 100644 --- a/functions/Searchlight/getSearchLightStartRadius.yaml +++ b/functions/Searchlight/getSearchLightStartRadius.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSearchLightStartRadius -client: +shared: name: getSearchLightStartRadius description: This function gets the start radius of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to get the radius of the searchlight's light cone + in its beginning. examples: - path: examples/getSearchLightStartRadius-1.lua description: '' side: client + returns: + values: + - type: float + name: value + description: If the specified searchlight element is valid, this function will + return one float , which is the searchlight's start radius. If not, it will + return false plus an error message. + oop: + element: searchlight + method: getStartRadius + variable: startRadius + static: false pair: setSearchLightStartRadius - incomplete: true + requires_review: true diff --git a/functions/Searchlight/setSearchLightEndPosition.yaml b/functions/Searchlight/setSearchLightEndPosition.yaml index 16567607..b37309e2 100644 --- a/functions/Searchlight/setSearchLightEndPosition.yaml +++ b/functions/Searchlight/setSearchLightEndPosition.yaml @@ -1,13 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSearchLightEndPosition -client: +shared: name: setSearchLightEndPosition description: This function sets the end position of a [searchlight](/wiki/Searchlight "Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to modify the property of. + - name: endX + type: float + description: the X coordinate where the searchlight light cone will end. + - name: endY + type: float + description: the Y coordinate where the searchlight light cone will end. + - name: endZ + type: float + description: the Z coordinate where the searchlight light cone will end. examples: - path: examples/setSearchLightEndPosition-1.lua description: This example creates a searchlight that originates in the camera position and targets to the front of it. side: client + returns: + values: + - type: bool + name: value + description: If every argument is correct, this function returns true . If not, + it will return false plus an error message. + oop: + element: searchlight + method: setEndPosition + variable: endPosition + static: false pair: getSearchLightEndPosition - incomplete: true + requires_review: true diff --git a/functions/Searchlight/setSearchLightEndRadius.yaml b/functions/Searchlight/setSearchLightEndRadius.yaml index 73c2235b..5c4df07c 100644 --- a/functions/Searchlight/setSearchLightEndRadius.yaml +++ b/functions/Searchlight/setSearchLightEndRadius.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSearchLightEndRadius -client: +shared: name: setSearchLightEndRadius description: This function sets the end radius of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchlight + type: searchlight + description: MISSING_PARAM_DESC + - name: endRadius + type: float + description: the radius of the searchlight's light cone in its end. examples: - path: examples/setSearchLightEndRadius-1.lua description: This example creates a skywalker light on top of Los Santos' skyscraper and turns it on/off every second by setting it's ending radius and starting radius to 0. side: client + returns: + values: + - type: bool + name: value + description: If every argument is correct, this function returns true . If not, + it will return false plus an error message. + oop: + element: searchlight + method: setEndRadius + variable: endRadius + static: false pair: getSearchLightEndRadius - incomplete: true + requires_review: true diff --git a/functions/Searchlight/setSearchLightStartPosition.yaml b/functions/Searchlight/setSearchLightStartPosition.yaml index 770322b0..94dc830a 100644 --- a/functions/Searchlight/setSearchLightStartPosition.yaml +++ b/functions/Searchlight/setSearchLightStartPosition.yaml @@ -1,13 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSearchLightStartPosition -client: +shared: name: setSearchLightStartPosition description: This function sets the start position of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchLight + type: searchlight + description: the searchlight to modify the property of. + - name: startX + type: float + description: the X coordinate where the searchlight light cone will start. + - name: startY + type: float + description: the Y coordinate where the searchlight light cone will start. + - name: startZ + type: float + description: the Z coordinate where the searchlight light cone will start. examples: - path: examples/setSearchLightStartPosition-1.lua description: This example creates a searchlight that originates in the camera position and targets the center of the map. side: client + returns: + values: + - type: bool + name: value + description: If every argument is correct, this function returns true . If not, + it will return false plus an error message. + oop: + element: searchlight + method: setStartPosition + variable: startPosition + static: false pair: getSearchLightStartPosition - incomplete: true + requires_review: true diff --git a/functions/Searchlight/setSearchLightStartRadius.yaml b/functions/Searchlight/setSearchLightStartRadius.yaml index 71c09693..c4734b3a 100644 --- a/functions/Searchlight/setSearchLightStartRadius.yaml +++ b/functions/Searchlight/setSearchLightStartRadius.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSearchLightStartRadius -client: +shared: name: setSearchLightStartRadius description: This function sets the start radius of a [searchlight](/wiki/Element/Searchlight "Element/Searchlight") element. - parameters: [] + parameters: + - name: theSearchlight + type: searchlight + description: MISSING_PARAM_DESC + - name: startRadius + type: float + description: the radius of the searchlight's light cone in its beginning. examples: - path: examples/setSearchLightStartRadius-1.lua description: This example creates a skywalker light on top of Los Santos' skyscraper and turns it on/off every second by setting it's ending radius and starting radius to 0. side: client + returns: + values: + - type: bool + name: value + description: If every argument is correct, this function returns true . If not, + it will return false plus an error message. + oop: + element: searchlight + method: setStartRadius + variable: startRadius + static: false pair: getSearchLightStartRadius - incomplete: true + requires_review: true diff --git a/functions/Server/getMaxPlayers.yaml b/functions/Server/getMaxPlayers.yaml index 2f965982..2446f28c 100644 --- a/functions/Server/getMaxPlayers.yaml +++ b/functions/Server/getMaxPlayers.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMaxPlayers -server: +shared: name: getMaxPlayers description: This function returns the maximum number of player slots on the server. parameters: [] @@ -8,4 +8,9 @@ server: description: This example outputs the current number of players together with the maximum number of players when a player joins. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the maximum number of players allowed on the server. + requires_review: true diff --git a/functions/Server/getServerConfigSetting.yaml b/functions/Server/getServerConfigSetting.yaml index 5fccadac..1dd8160e 100644 --- a/functions/Server/getServerConfigSetting.yaml +++ b/functions/Server/getServerConfigSetting.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerConfigSetting -server: +shared: name: getServerConfigSetting description: This function retrieves server settings which are usually stored in the **mtaserver.conf** file. - parameters: [] + parameters: + - name: name + type: string + description: MISSING_PARAM_DESC examples: - path: examples/getServerConfigSetting-1.lua description: This example prints the server minimum allowed client version to @@ -12,4 +15,11 @@ server: - path: examples/getServerConfigSetting-2.lua description: 'This example creates agetServerIPhelper function:' side: server - incomplete: true + returns: + values: + - type: mixed + name: value + description: Returns a string containing the current value for the named setting, + table if name is module or false if the setting does not exist. If the setting + name is serverip , may return the string "auto" on local servers. + requires_review: true diff --git a/functions/Server/getServerHttpPort.yaml b/functions/Server/getServerHttpPort.yaml index eb66457c..0baccaf7 100644 --- a/functions/Server/getServerHttpPort.yaml +++ b/functions/Server/getServerHttpPort.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerHttpPort -server: +shared: name: getServerHttpPort description: This function retrieves the server's HTTP port. parameters: [] @@ -8,4 +8,9 @@ server: description: This example outputs server's HTTP port to the chat box when player uses commandgetHttpPort side: server - incomplete: true + returns: + values: + - type: int + name: value + description: An integer corresponding to the server's HTTP port. + requires_review: true diff --git a/functions/Server/getServerIpFromMasterServer.yaml b/functions/Server/getServerIpFromMasterServer.yaml index 47f34ea8..5a573ea6 100644 --- a/functions/Server/getServerIpFromMasterServer.yaml +++ b/functions/Server/getServerIpFromMasterServer.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerIpFromMasterServer -server: +shared: name: getServerIpFromMasterServer description: This function returns the remote address as reported by the first master server that provides this value. @@ -9,6 +9,12 @@ server: description: This example creates a console command that outputs the server's IP to the chatbox. side: server + returns: + values: + - type: string + name: value + description: A string containing the remote address of the server as reported, + once it's available. notes: - type: info content: It might take a while until the master server responds to the query sent @@ -21,4 +27,4 @@ server: content: If you want to retrieve the server IP address from the server configuration, then you should use getServerConfigSetting("serverip") , but this might yield only "auto" if the default value was used. - incomplete: true + requires_review: true diff --git a/functions/Server/getServerName.yaml b/functions/Server/getServerName.yaml index 822bce01..23382d2d 100644 --- a/functions/Server/getServerName.yaml +++ b/functions/Server/getServerName.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerName -server: +shared: name: getServerName description: This function retrieves the server's name. parameters: [] @@ -8,4 +8,9 @@ server: description: This example creates a console command that outputs the server's name to the chatbox. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: A string containing the server's name. + requires_review: true diff --git a/functions/Server/getServerPassword.yaml b/functions/Server/getServerPassword.yaml index 45333ef7..4bcc8ff2 100644 --- a/functions/Server/getServerPassword.yaml +++ b/functions/Server/getServerPassword.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerPassword -server: +shared: name: getServerPassword description: This function returns the current password required to join the server. parameters: [] @@ -7,4 +7,10 @@ server: - path: examples/getServerPassword-1.lua description: This example prints the serverpassword to the player side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the current server password as a string if it has a password, + if not it returns nil . + requires_review: true diff --git a/functions/Server/getServerPort.yaml b/functions/Server/getServerPort.yaml index 4138dea0..de4e5934 100644 --- a/functions/Server/getServerPort.yaml +++ b/functions/Server/getServerPort.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerPort -server: +shared: name: getServerPort description: This function retrieves the server's port. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/getServerPort-1.lua description: 'This example Sends out the serverPort when you type: /serverport' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: An integer corresponding to the server's port. + requires_review: true diff --git a/functions/Server/isGlitchEnabled.yaml b/functions/Server/isGlitchEnabled.yaml index 307649fc..40774901 100644 --- a/functions/Server/isGlitchEnabled.yaml +++ b/functions/Server/isGlitchEnabled.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsGlitchEnabled -server: +shared: name: isGlitchEnabled description: This function retrieves whether San Andreas game glitches are enabled or not, set by using [setGlitchEnabled](/wiki/SetGlitchEnabled "SetGlitchEnabled") - parameters: [] + parameters: + - name: glitchName + type: string + description: 'the name of the property to set. Possible values are:' examples: - path: examples/isGlitchEnabled-1.lua description: This example outputs weather the "fastmove" glitch is enabled or not. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if if the glitch was enabled, or false if it is disabled. + requires_review: true diff --git a/functions/Server/setGlitchEnabled.yaml b/functions/Server/setGlitchEnabled.yaml index 57450596..83e4797c 100644 --- a/functions/Server/setGlitchEnabled.yaml +++ b/functions/Server/setGlitchEnabled.yaml @@ -1,15 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGlitchEnabled -server: +shared: name: setGlitchEnabled description: This function enables or disables glitches that are found in the original Single Player game that can be used to gain an advantage in multiplayer. - parameters: [] + parameters: + - name: glitchName + type: string + description: 'the name of the property to set. Possible values are:' + - name: enable + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setGlitchEnabled-1.lua description: This example allows you to toggle specific glitch usingtrueorfalse. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: info content: By default all these glitches are disabled - use this function to enable them. - incomplete: true + requires_review: true diff --git a/functions/Server/setMaxPlayers.yaml b/functions/Server/setMaxPlayers.yaml index dc497b03..2410d331 100644 --- a/functions/Server/setMaxPlayers.yaml +++ b/functions/Server/setMaxPlayers.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMaxPlayers -server: +shared: name: setMaxPlayers description: This function sets the maximum number of player slots on the server. - parameters: [] + parameters: + - name: slots + type: int + description: Maximum number of player slots on the server. examples: - path: examples/setMaxPlayers-1.lua description: This example set server slots count to half value from current value. @@ -10,8 +13,14 @@ server: - path: examples/setMaxPlayers-2.lua description: This example resets the server slots count to the value from mtaserver.conf side: server + returns: + values: + - type: bool + name: value + description: Returns true if number of player slots was successfully changed, + false or nil otherwise. notes: - type: info content: This function cannot set more than as defined in mtaserver.conf . (To find out the value, use getServerConfigSetting("maxplayers")) - incomplete: true + requires_review: true diff --git a/functions/Server/setServerConfigSetting.yaml b/functions/Server/setServerConfigSetting.yaml index 3125c4a6..05670b74 100644 --- a/functions/Server/setServerConfigSetting.yaml +++ b/functions/Server/setServerConfigSetting.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetServerConfigSetting -server: +shared: name: setServerConfigSetting description: This function sets server settings which are stored in the [mtaserver.conf](/wiki/Server_mtaserver.conf "Server mtaserver.conf") file. - parameters: [] + parameters: + - name: name + type: string + description: MISSING_PARAM_DESC + - name: value + type: string + description: The value of the setting + - name: bSave + type: bool + description: Set to true to make the setting permanent, or false for use only + until the next server restart. + default: 'false' examples: - path: examples/setServerConfigSetting-1.lua description: This example enables network encryption side: server + returns: + values: + - type: bool + name: value + description: Returns true if the setting was successfully set, or false otherwise. notes: - type: info content: This function is protected by default and must be explicitly allowed @@ -15,4 +31,4 @@ server: - type: warning content: '"bandwidth_reduction" set to ''maximum'' will cause player movement synchronization issues, on locations built outside 3000m radius from world center.' - incomplete: true + requires_review: true diff --git a/functions/Server/setServerPassword.yaml b/functions/Server/setServerPassword.yaml index 65a1569a..99364f9c 100644 --- a/functions/Server/setServerPassword.yaml +++ b/functions/Server/setServerPassword.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetServerPassword -server: +shared: name: setServerPassword description: This function changes the password required to join the server to the given string. - parameters: [] + parameters: + - name: thePassword + type: string + description: The new server password you want. Pass nil or an empty string to + remove the password. examples: - path: examples/setServerPassword-1.lua description: 'This example adds two commands for you to use: setpassword and removepassword.' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the password was successfully changed or removed, + false or nil otherwise. + requires_review: true diff --git a/functions/Server/shutdown.yaml b/functions/Server/shutdown.yaml index 3025e4a8..32345458 100644 --- a/functions/Server/shutdown.yaml +++ b/functions/Server/shutdown.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Shutdown -server: +shared: name: shutdown description: This function shuts down the server. - parameters: [] + parameters: + - name: reason + type: string + description: the reason why the server has been shutdown. + default: '"No reason specified"' + - name: exitCode + type: number + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/shutdown-1.lua description: This command shuts down the server on request side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns false if it was not possible to shut down the server. + requires_review: true diff --git a/functions/Settings_registry/get.yaml b/functions/Settings_registry/get.yaml index 7cd02712..98607f1c 100644 --- a/functions/Settings_registry/get.yaml +++ b/functions/Settings_registry/get.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Get -server: +shared: name: get description: This function gets a setting's value, or a group of settings' values, from the [settings registry](/wiki/Settings_system "Settings system"). - parameters: [] + parameters: + - name: settingName + type: string + description: MISSING_PARAM_DESC examples: - path: examples/get-1.lua description: Example returns a value from the settings registry with the name @@ -12,8 +15,14 @@ server: - path: examples/get-2.lua description: 'Or easier:' side: server + returns: + values: + - type: var + name: value + description: 'Returns the value of the setting if a single setting was specified + and found, or a table (in associative-array form) containing:' notes: - type: info content: Your settings cannot have a period (.) in them. This character is reserved. Read below for more details. - incomplete: true + requires_review: true diff --git a/functions/Settings_registry/set.yaml b/functions/Settings_registry/set.yaml index 66af5a67..ca3cace0 100644 --- a/functions/Settings_registry/set.yaml +++ b/functions/Settings_registry/set.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Set -server: +shared: name: set description: This function is used to save arbitrary data under a certain name on the [settings registry](/wiki/Settings_system "Settings system"). - parameters: [] + parameters: + - name: settingName + type: string + description: The name of the setting you want to set. See setting names for information + on settings names. + - name: value + type: var + description: The value to set the setting to. This can be any Lua data type, except + for functions, most userdata (only resources can't be stored) and threads. examples: - path: examples/set-1.lua description: This example sets a specified setting with a Value. This is alocalsetting belonging to the resource that the code is run in. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the setting has been set, false if you do not have + access to the setting or invalid arguments were passed. + requires_review: true diff --git a/functions/Team/createTeam.yaml b/functions/Team/createTeam.yaml index b14d571e..1c01a36a 100644 --- a/functions/Team/createTeam.yaml +++ b/functions/Team/createTeam.yaml @@ -1,9 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateTeam -server: +shared: name: createTeam description: This function is for creating a new [team](/wiki/Team "Team"), which can be used to group players. Players will not join the team until they are respawned. - parameters: [] + parameters: + - name: teamName + type: string + description: A string representing the teams name. + - name: colorR + type: int + description: An integer representing the red color value. + default: '235' + - name: colorG + type: int + description: An integer representing the green color value. + default: '221' + - name: colorB + type: int + description: An integer representing the blue color value. + default: '178' examples: - path: examples/createTeam-1.lua description: Example 1:This example creates a new team for a player, then adds @@ -17,4 +32,14 @@ server: description: Example 3:This example creates a team for Admin and when an admin logs in, he will be set in the Admin team. side: server - incomplete: true + returns: + values: + - type: team + name: value + description: Returns a team element if it was successfully created, false if invalid + arguments are passed or a team with that name already exists. + oop: + element: Team + method: create + static: true + requires_review: true diff --git a/functions/Team/getTeamColor.yaml b/functions/Team/getTeamColor.yaml index efd46125..44880faa 100644 --- a/functions/Team/getTeamColor.yaml +++ b/functions/Team/getTeamColor.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTeamColor -server: +shared: name: getTeamColor description: This function retrieves the color of a team. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team you want to get the color of. examples: - path: examples/getTeamColor-1.lua description: This example defines a console command that outputs the player's team name and colors if he is on a team. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: Returns 3 integers representing the red, green, and blue color components + of the team if it's valid, false otherwise. + oop: + element: team + method: getColor + static: false + requires_review: true diff --git a/functions/Team/getTeamFriendlyFire.yaml b/functions/Team/getTeamFriendlyFire.yaml index cbf1e1c0..07f7c8bd 100644 --- a/functions/Team/getTeamFriendlyFire.yaml +++ b/functions/Team/getTeamFriendlyFire.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTeamFriendlyFire -server: +shared: name: getTeamFriendlyFire description: This function tells you if friendly fire is turned on for the specified team. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team object that will be checked examples: - path: examples/getTeamFriendlyFire-1.lua description: This example makes a command that checks if friendly fire is on for each team, and toggles it on if it isn't. side: server + returns: + values: + - type: bool + name: value + description: Returns true if friendly fire is on for the specified team, false + if it is turned off or if invalid arguments are specified. + oop: + element: team + method: getFriendlyFire + variable: friendlyFire + static: false pair: setTeamFriendlyFire - incomplete: true + requires_review: true diff --git a/functions/Team/getTeamFromName.yaml b/functions/Team/getTeamFromName.yaml index d72ab38e..cdae2fe5 100644 --- a/functions/Team/getTeamFromName.yaml +++ b/functions/Team/getTeamFromName.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTeamFromName -server: +shared: name: getTeamFromName description: This function finds a [team](/wiki/Team "Team") element using the provided team name. - parameters: [] + parameters: + - name: teamName + type: string + description: A string determining the name of the team you wish to find. examples: - path: examples/getTeamFromName-1.lua description: 'This example creates a team, and sets the player''s team to it''s partial name:' side: server - incomplete: true + returns: + values: + - type: team + name: value + description: Returns the team element if it was found, false otherwise. + oop: + element: Team + method: getFromName + static: true + requires_review: true diff --git a/functions/Team/getTeamName.yaml b/functions/Team/getTeamName.yaml index efbdb153..a6e6ef09 100644 --- a/functions/Team/getTeamName.yaml +++ b/functions/Team/getTeamName.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTeamName -server: +shared: name: getTeamName description: This function gets the team name of a team object. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team you want to retrieve the name of. examples: - path: examples/getTeamName-1.lua description: This example gets the current team of a player, then prints its name to the chatbox. side: server + returns: + values: + - type: string + name: value + description: Returns a string representing the team's name if the team object + was valid, false otherwise. + oop: + element: team + method: getName + variable: name + static: false pair: setTeamName - incomplete: true + requires_review: true diff --git a/functions/Team/setTeamColor.yaml b/functions/Team/setTeamColor.yaml index 55b43d4c..90b1ba63 100644 --- a/functions/Team/setTeamColor.yaml +++ b/functions/Team/setTeamColor.yaml @@ -1,11 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTeamColor -server: +shared: name: setTeamColor description: This function is for setting the color of a specified team. This color is shown, for example, in the team players' nametags. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team you want to change the color of. + - name: colorR + type: int + description: An integer representing the red color value, from 0 to 255. + - name: colorG + type: int + description: An integer representing the green color value, from 0 to 255. + - name: colorB + type: int + description: An integer representing the blue color value, from 0 to 255. examples: - path: examples/setTeamColor-1.lua description: This example creates a new team then changes its name and color. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the team is valid and the color is different, otherwise + false . + oop: + element: team + method: setColor + static: false + requires_review: true diff --git a/functions/Team/setTeamFriendlyFire.yaml b/functions/Team/setTeamFriendlyFire.yaml index 0e2d819e..2680a7e1 100644 --- a/functions/Team/setTeamFriendlyFire.yaml +++ b/functions/Team/setTeamFriendlyFire.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTeamFriendlyFire -server: +shared: name: setTeamFriendlyFire description: This function sets the friendly fire value for the specified team. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team that will have friendly fire set + - name: friendlyFire + type: bool + description: A boolean denoting whether the players from the same team can kill + each other ( true ) or whether the players can't kill each other ( false ). examples: - path: examples/setTeamFriendlyFire-1.lua description: This example checks if friendly fire is on for every team, and toggles it on if it isn't. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the friendly fire value is set for the specified + team, false if the friendly fire value can't be set for the specified team or + if invalid arguments are specified. + oop: + element: team + method: setFriendlyFire + variable: friendlyFire + static: false pair: getTeamFriendlyFire - incomplete: true + requires_review: true diff --git a/functions/Team/setTeamName.yaml b/functions/Team/setTeamName.yaml index 705611b0..954090d8 100644 --- a/functions/Team/setTeamName.yaml +++ b/functions/Team/setTeamName.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTeamName -server: +shared: name: setTeamName description: This function is used to set a team's name. - parameters: [] + parameters: + - name: theTeam + type: team + description: The team you want to change the name of. + - name: newName + type: string + description: A string representing the name you want the team to be called. examples: - path: examples/setTeamName-1.lua description: This example gets the current team of a player, then changes its name. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the team was valid and the name was changed, false + otherwise. + oop: + element: team + method: setName + variable: name + static: false pair: getTeamName - incomplete: true + requires_review: true diff --git a/functions/Text/textCreateDisplay.yaml b/functions/Text/textCreateDisplay.yaml index 105ee434..341197e2 100644 --- a/functions/Text/textCreateDisplay.yaml +++ b/functions/Text/textCreateDisplay.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextCreateDisplay -server: +shared: name: textCreateDisplay description: A [text display](/wiki/Textdisplay "Textdisplay") is like a canvas that can contain many [items of text](/wiki/Textitem "Textitem"). Each display @@ -9,4 +9,8 @@ server: - path: examples/textCreateDisplay-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: textdisplay + name: value + requires_review: true diff --git a/functions/Text/textCreateTextItem.yaml b/functions/Text/textCreateTextItem.yaml index 53583b59..1e5f3f07 100644 --- a/functions/Text/textCreateTextItem.yaml +++ b/functions/Text/textCreateTextItem.yaml @@ -1,14 +1,74 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextCreateTextItem -server: +shared: name: textCreateTextItem description: This function creates a text item. A text item represents a single area of text, much like a label does in standard GUI programming. A text item can only be seen by players if it is added to a [textdisplay](/wiki/Textdisplay "Textdisplay") using [textDisplayAddText](/wiki/TextDisplayAddText "TextDisplayAddText"). Each text item can be added to multiple displays, if need be. - parameters: [] + parameters: + - name: text + type: string + description: A string of text you want to display + - name: x + type: float + description: A floating point number between 0.0 and 1.0 indicating how far across + the screen the text should be shown, as a percentage of the width, from the + left hand side. + - name: "y" + type: float + description: A floating point number between 0.0 and 1.0 indicating how far down + the screen the text should be shown, as a percentage of the height, from the + top. + - name: priority + type: string + description: 'How important it is that this text should be up to date on client''s + screens. Valid values are: "low", "medium", "high" which are aliases for 0, + 1 and 2 respectively.' + - name: red + type: int + description: A value between 0 and 255 indicating how red the text should be. + default: '255' + - name: green + type: int + description: A value between 0 and 255 indicating how green the text should be. + default: '255' + - name: blue + type: int + description: A value between 0 and 255 indicating how blue the text should be. + default: '255' + - name: alpha + type: int + description: A value between 0 and 255 indicating how transparent the text should + be, with 0 being fully transparent, and 255 being opaque. + default: '255' + - name: scale + type: float + description: A floating point value indicating the scale of the text. The default + is 1.0, which is around 12pt. + default: '1' + - name: alignX + type: string + description: A string representing the X-alignment of the text. ("left", "center", + "right") + default: '"left"' + - name: alignY + type: string + description: A string representing the Y-alignment of the text. ("top", "center", + "bottom") + default: '"top"' + - name: shadowAlpha + type: int + description: A value between 0 and 255 indicating how dark the drop shadow should + be. + default: '0' examples: - path: examples/textCreateTextItem-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: textitem + name: value + description: Returns a textitem object. + requires_review: true diff --git a/functions/Text/textDestroyDisplay.yaml b/functions/Text/textDestroyDisplay.yaml index 8cf85f56..7f65956a 100644 --- a/functions/Text/textDestroyDisplay.yaml +++ b/functions/Text/textDestroyDisplay.yaml @@ -1,12 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDestroyDisplay -server: +shared: name: textDestroyDisplay description: This function destroys a text display and will unlink all the [textitems](/wiki/Textitem "Textitem") on it. This does not stop the textitems existing, but anyone who was observing the textitems through this display will stop seeing them. - parameters: [] + parameters: + - name: display + type: textdisplay + description: This is the textdisplay that you wish to have destroyed. examples: - path: examples/textDestroyDisplay-1.lua description: This example creates a display then destroys it again straight away. side: server - incomplete: true + returns: + values: + - type: bool + name: value + requires_review: true diff --git a/functions/Text/textDestroyTextItem.yaml b/functions/Text/textDestroyTextItem.yaml index 44bf36d4..886019be 100644 --- a/functions/Text/textDestroyTextItem.yaml +++ b/functions/Text/textDestroyTextItem.yaml @@ -1,10 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDestroyTextItem -server: +shared: name: textDestroyTextItem description: This function destroys a [textitem](/wiki/Textitem "Textitem") object. - parameters: [] + parameters: + - name: theTextitem + type: textitem + description: The text item you wish to destroy. examples: - path: examples/textDestroyTextItem-1.lua description: This example creates then destroys atextitem. side: server - incomplete: true + requires_review: true diff --git a/functions/Text/textDisplayAddObserver.yaml b/functions/Text/textDisplayAddObserver.yaml index 388aaccc..f6bc428b 100644 --- a/functions/Text/textDisplayAddObserver.yaml +++ b/functions/Text/textDisplayAddObserver.yaml @@ -1,13 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayAddObserver -server: +shared: name: textDisplayAddObserver description: This function adds a [player](/wiki/Player "Player") as an observer of a [textdisplay](/wiki/Textdisplay "Textdisplay"). This allows the [player](/wiki/Player "Player") to see any [textitems](/wiki/Textitem "Textitem") that the [textdisplay](/wiki/Textdisplay "Textdisplay") contains. - parameters: [] + parameters: + - name: display + type: textdisplay + description: The textdisplay to add the player to as an observer. + - name: playerToAdd + type: player + description: The player that should observe the textdisplay . examples: - path: examples/textDisplayAddObserver-1.lua description: '' side: server - incomplete: true + requires_review: true diff --git a/functions/Text/textDisplayAddText.yaml b/functions/Text/textDisplayAddText.yaml index 38a36895..a5222b67 100644 --- a/functions/Text/textDisplayAddText.yaml +++ b/functions/Text/textDisplayAddText.yaml @@ -1,12 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayAddText -server: +shared: name: textDisplayAddText description: This function adds a [textitem](/wiki/Textitem "Textitem") to a [textdisplay](/wiki/Textdisplay "Textdisplay"). This allows any observers of the [textdisplay](/wiki/Textdisplay "Textdisplay") to see the [textitem](/wiki/Textitem "Textitem"). - parameters: [] + parameters: + - name: displayToAddTo + type: textdisplay + description: The textdisplay to add the textitem to. + - name: itemToAdd + type: textitem + description: The textitem to add to the display. examples: - path: examples/textDisplayAddText-1.lua description: '' side: server - incomplete: true + requires_review: true diff --git a/functions/Text/textDisplayGetObservers.yaml b/functions/Text/textDisplayGetObservers.yaml index 606b6033..10336b4c 100644 --- a/functions/Text/textDisplayGetObservers.yaml +++ b/functions/Text/textDisplayGetObservers.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayGetObservers -server: +shared: name: textDisplayGetObservers description: This function can be used to retrieve all the [players](/wiki/Player "Player") currently observing a specified [textdisplay](/wiki/Textdisplay "Textdisplay"). - parameters: [] + parameters: + - name: theDisplay + type: textdisplay + description: The textdisplay of which observers you want to get. examples: - path: examples/textDisplayGetObservers-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of players that are observers of the display or false + if invalid textdisplay is passed. + requires_review: true diff --git a/functions/Text/textDisplayIsObserver.yaml b/functions/Text/textDisplayIsObserver.yaml index a30186ba..e9a35492 100644 --- a/functions/Text/textDisplayIsObserver.yaml +++ b/functions/Text/textDisplayIsObserver.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayIsObserver -server: +shared: name: textDisplayIsObserver description: This function checks if a player can see the specified [textdisplay](/wiki/Textdisplay "Textdisplay"). - parameters: [] + parameters: + - name: display + type: textdisplay + description: The textdisplay . + - name: thePlayer + type: player + description: The player . examples: - path: examples/textDisplayIsObserver-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Return true if textdisplay is showing, or false if not. + requires_review: true diff --git a/functions/Text/textDisplayRemoveObserver.yaml b/functions/Text/textDisplayRemoveObserver.yaml index fa5855a1..265d7cfa 100644 --- a/functions/Text/textDisplayRemoveObserver.yaml +++ b/functions/Text/textDisplayRemoveObserver.yaml @@ -1,14 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayRemoveObserver -server: +shared: name: textDisplayRemoveObserver description: This function removes a [player](/wiki/Player "Player") observer of a [textdisplay](/wiki/Textdisplay "Textdisplay"). This stops the [player](/wiki/Player "Player") from being able to see [textitems](/wiki/Textitem "Textitem") that the [textdisplay](/wiki/Textdisplay "Textdisplay") contains. - parameters: [] + parameters: + - name: display + type: textdisplay + description: The textdisplay to remove the player from as an observer. + - name: playerToRemove + type: player + description: The player that should be removed from the textdisplay . examples: - path: examples/textDisplayRemoveObserver-1.lua description: This example creates a new display and a "Hello World" text item for a player. It then removes it from his screen 5 seconds later side: server - incomplete: true + returns: + values: + - type: bool + name: value + requires_review: true diff --git a/functions/Text/textDisplayRemoveText.yaml b/functions/Text/textDisplayRemoveText.yaml index 4f1b5aff..fd2f7041 100644 --- a/functions/Text/textDisplayRemoveText.yaml +++ b/functions/Text/textDisplayRemoveText.yaml @@ -1,14 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextDisplayRemoveText -server: +shared: name: textDisplayRemoveText description: This function removes a [textitem](/wiki/Textitem "Textitem") from a [textdisplay](/wiki/Textdisplay "Textdisplay"). This stops any observers of the [textdisplay](/wiki/Textdisplay "Textdisplay") from being able to see the [textitem](/wiki/Textitem "Textitem"). - parameters: [] + parameters: + - name: displayToRemoveFrom + type: textdisplay + description: The textdisplay to remove the textitem from. + - name: itemToRemove + type: textitem + description: The textitem to remove from the display. examples: - path: examples/textDisplayRemoveText-1.lua description: This example creates a text display and adds a "Hello World" text item to it. It then removes that text item 5 seconds later. side: server - incomplete: true + requires_review: true diff --git a/functions/Text/textItemGetColor.yaml b/functions/Text/textItemGetColor.yaml index 9952242f..ce88488a 100644 --- a/functions/Text/textItemGetColor.yaml +++ b/functions/Text/textItemGetColor.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemGetColor -server: +shared: name: textItemGetColor description: This function allows you to retrieve the color of a text item. - parameters: [] + parameters: + - name: theTextItem + type: textitem + description: The text item you wish to retrieve the color of. examples: - path: examples/textItemGetColor-1.lua description: This example gets the color of a text item named 'theTextItem' and if it is green, changes it to blue. side: server - incomplete: true + returns: + values: + - type: int int int int + name: value + description: Returns four integers in RGBA format, with a maximum value of 255 + for each. The values are, in order, red , green , blue , and alpha . Alpha decides + transparency where 255 is opaque and 0 is transparent. false is returned if + the text item is invalid. + requires_review: true diff --git a/functions/Text/textItemGetPosition.yaml b/functions/Text/textItemGetPosition.yaml index 92eea54b..c461d4b8 100644 --- a/functions/Text/textItemGetPosition.yaml +++ b/functions/Text/textItemGetPosition.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemGetPosition -server: +shared: name: textItemGetPosition description: This function allows retrieval of the position of a text item. - parameters: [] + parameters: + - name: theTextItem + type: textitem + description: The textitem you wish to retrieve the position of examples: - path: examples/textItemGetPosition-1.lua description: This example creates a text item 'myTextItem' only if the text item 'otherTextItem' is not in the same position, to prevent overlap. If it is in the same position, then it moves it down. side: server - incomplete: true + returns: + values: + - type: float float + name: value + description: Returns two floats of the x and y position on the screen, where the + maximum value is 1.0. + requires_review: true diff --git a/functions/Text/textItemGetPriority.yaml b/functions/Text/textItemGetPriority.yaml index e106be78..e2158206 100644 --- a/functions/Text/textItemGetPriority.yaml +++ b/functions/Text/textItemGetPriority.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemGetPriority -server: +shared: name: textItemGetPriority description: This function retrieves the priority of a text item. Priority defines the rate at whihc a text item is updated - parameters: [] + parameters: + - name: textitemToCheck + type: textitem + description: The text item you wish to retrieve the priority of. examples: - path: examples/textItemGetPriority-1.lua description: This page does not have an example. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns a integer of the priority of a text item, 0 = low, 1 = medium, + 2 = high. + requires_review: true diff --git a/functions/Text/textItemGetScale.yaml b/functions/Text/textItemGetScale.yaml index 83050d65..7d1e8938 100644 --- a/functions/Text/textItemGetScale.yaml +++ b/functions/Text/textItemGetScale.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemGetScale -server: +shared: name: textItemGetScale description: This function allows retrieval of the scale or size of a text item. - parameters: [] + parameters: + - name: theTextitem + type: textitem + description: The text item you wish to retrieve the scale of examples: - path: examples/textItemGetScale-1.lua description: This example retrieves the scale of the 'theTextItem' text item, and if it is too small it enlarges it so it is more visible. side: server - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a floating point of the scale of the text. 1.0 is around + 12pt. + requires_review: true diff --git a/functions/Text/textItemGetText.yaml b/functions/Text/textItemGetText.yaml index 920b5a70..143dd289 100644 --- a/functions/Text/textItemGetText.yaml +++ b/functions/Text/textItemGetText.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemGetText -server: +shared: name: textItemGetText description: This function returns the current text of the specified [textitem](/wiki/Textitem "Textitem"). - parameters: [] + parameters: + - name: theTextitem + type: textitem + description: A valid textitem . examples: - path: examples/textItemGetText-1.lua description: Increment a score display. In real scripts it's of course better to keep a global 'score' variable which can be incremented directly. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the text if the function was successful, + false otherwise. + requires_review: true diff --git a/functions/Text/textItemSetColor.yaml b/functions/Text/textItemSetColor.yaml index 6002ebd2..b8ea93e4 100644 --- a/functions/Text/textItemSetColor.yaml +++ b/functions/Text/textItemSetColor.yaml @@ -1,11 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemSetColor -server: +shared: name: textItemSetColor description: This function sets the color of a text item. - parameters: [] + parameters: + - name: theTextItem + type: textitem + description: The textitem you wish to set the color of. + - name: r + type: int + description: MISSING_PARAM_DESC + - name: g + type: int + description: MISSING_PARAM_DESC + - name: b + type: int + description: MISSING_PARAM_DESC + - name: a + type: int + description: MISSING_PARAM_DESC examples: - path: examples/textItemSetColor-1.lua description: This example gets the color of a textitem named 'theTextItem' and if it is green, changes it to blue. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the color was successfully set, false otherwise. + requires_review: true diff --git a/functions/Text/textItemSetPosition.yaml b/functions/Text/textItemSetPosition.yaml index c9b5a847..62cf5e15 100644 --- a/functions/Text/textItemSetPosition.yaml +++ b/functions/Text/textItemSetPosition.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemSetPosition -server: +shared: name: textItemSetPosition description: This function allows the setting of the position of a text item. - parameters: [] + parameters: + - name: theTextItem + type: textitem + description: The text item that you want to move + - name: x + type: float + description: A floating point number between 0.0 and 1.0 indicating how far across + the screen the text should be shown, as a percentage of the width, from the + left hand side. + - name: "y" + type: float + description: A floating point number between 0.0 and 1.0 indicating how far down + the screen the text should be shown, as a percentage of the height, from the + top. examples: - path: examples/textItemSetPosition-1.lua description: This example creates a text item 'myTextItem' only if the text item 'otherTextItem' is not in the same position, to prevent overlap. If it is in the same position, then it moves it down. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position was successfully set, false otherwise. + requires_review: true diff --git a/functions/Text/textItemSetPriority.yaml b/functions/Text/textItemSetPriority.yaml index f01f9ef7..38e3b4d7 100644 --- a/functions/Text/textItemSetPriority.yaml +++ b/functions/Text/textItemSetPriority.yaml @@ -1,14 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemSetPriority -server: +shared: name: textItemSetPriority description: This function sets the priority for a text item. Priority is the importance of sending updated text to the client. The system is implemented as 3 queues, with the *high* queue being emptied before the *medium* queue is processed, and with one update sent per server frame. Hence, if you set all your text items to *medium* priority it has the same effect as if you set them all to *high* or *low*. - parameters: [] + parameters: + - name: theTextItem + type: textitem + description: The text item you wish to set priority to. + - name: priority + type: string + description: The priority you wish to set to the item, which can be "high" , "medium" + , or "low" respective of their priority. examples: - path: examples/textItemSetPriority-1.lua description: This page does not have an example side: server - incomplete: true + requires_review: true diff --git a/functions/Text/textItemSetScale.yaml b/functions/Text/textItemSetScale.yaml index db9565d1..fc852c16 100644 --- a/functions/Text/textItemSetScale.yaml +++ b/functions/Text/textItemSetScale.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemSetScale -server: +shared: name: textItemSetScale description: This function allows the setting of the scale of a text item. - parameters: [] + parameters: + - name: theTextitem + type: textitem + description: The text item you wish to set the scale of. + - name: scale + type: float + description: A floating point value indicating the scale of the text you wish + to set to. 1.0 is around 12pt. examples: - path: examples/textItemSetScale-1.lua description: This example retrieves the scale of thetheTextitemtext item, and if it is too small it enlarges it so it is more visible. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the scale was successfully set, false otherwise. + requires_review: true diff --git a/functions/Text/textItemSetText.yaml b/functions/Text/textItemSetText.yaml index 1b71773e..95cf2711 100644 --- a/functions/Text/textItemSetText.yaml +++ b/functions/Text/textItemSetText.yaml @@ -1,10 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TextItemSetText -server: +shared: name: textItemSetText description: Overwrites a previously created text item with the specified text. - parameters: [] + parameters: + - name: theTextitem + type: textitem + description: An existing text item that was previously created with textCreateTextItem + - name: text + type: string + description: The new text for the text item examples: - path: examples/textItemSetText-1.lua description: 'Here, it is being used to update a scoreboard:' side: server - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.byte.yaml b/functions/UTF8_Library/utf8.byte.yaml index ac83199c..65507dd7 100644 --- a/functions/UTF8_Library/utf8.byte.yaml +++ b/functions/UTF8_Library/utf8.byte.yaml @@ -1,9 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.byte -server: +shared: name: utf8.byte description: Returns the codepoints for the i\-th through j\-th character of the string passed. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: i + type: int + description: An integer representing the beginning position. + default: '1' + - name: j + type: int + description: An integer representing the ending position. + default: '1' examples: - path: examples/utf8.byte-1.lua description: This example will print every codepoint in the input string to the @@ -13,4 +24,12 @@ server: description: 'This example will print the codepoint of the first character (read: ''M'') in the string literal.' side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: '... utf8.byte' + name: value2 + description: Returns a sequence of integer values from the original string if + successful, nil otherwise. + requires_review: true diff --git a/functions/UTF8_Library/utf8.char.yaml b/functions/UTF8_Library/utf8.char.yaml index 74ebbecb..03374476 100644 --- a/functions/UTF8_Library/utf8.char.yaml +++ b/functions/UTF8_Library/utf8.char.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.char -server: +shared: name: utf8.char description: Generates a string representing the character codepoints as arguments. - parameters: [] + parameters: + - name: codepoints... + type: int + description: MISSING_PARAM_DESC examples: - path: examples/utf8.char-1.lua description: This example separates an input string into single codepoints and @@ -15,4 +18,9 @@ server: description: This example takes the first five code points from the input string and then joins them back together. side: client - incomplete: true + returns: + values: + - type: string utf8.char + name: value + description: Returns a string representation of the codepoints passed. + requires_review: true diff --git a/functions/UTF8_Library/utf8.charpos.yaml b/functions/UTF8_Library/utf8.charpos.yaml index 60c98072..93999b06 100644 --- a/functions/UTF8_Library/utf8.charpos.yaml +++ b/functions/UTF8_Library/utf8.charpos.yaml @@ -1,8 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.charpos -server: +shared: name: utf8.charpos description: Converts the UTF\-8 codepoint position to byte\-string position. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: int charpos + type: '[,' + description: MISSING_PARAM_DESC + default: 0 ] + - name: offset + type: int + description: An integer representing the offset to charpos. + default: '1' examples: - path: examples/utf8.charpos-1.lua description: This example takes the second codepoint character and shows the byte-string @@ -13,8 +24,16 @@ server: length with the UTF8 functions and the inbuilt Lua function string.sub, which processes byte strings. side: client + returns: + values: + - type: int + name: value1 + - type: int utf8.charpos + name: value2 + description: Returns the integer position as in a byte string and the integer + codepoint at this position, nil otherwise. notes: - type: info content: Code point characters beyond the byte value range (0-127) require at least 2 bytes to represent the character - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.escape.yaml b/functions/UTF8_Library/utf8.escape.yaml index 9a7a0513..e4835f5e 100644 --- a/functions/UTF8_Library/utf8.escape.yaml +++ b/functions/UTF8_Library/utf8.escape.yaml @@ -1,15 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.escape -server: +shared: name: utf8.escape description: Escapes a string to a UTF\-8 format string. It supports several escape formats, see the formatting table. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence examples: - path: examples/utf8.escape-1.lua description: This example escapes two byte-string literals to UTF-8 format by using the utf8.escape function. side: server - incomplete: true + returns: + values: + - type: string utf8.escape + name: value + description: Returns a string containing the escaped UTF-8 characters from the + original string. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -17,3 +25,4 @@ server: - Missing section: Formatting ' + requires_review: true diff --git a/functions/UTF8_Library/utf8.find.yaml b/functions/UTF8_Library/utf8.find.yaml index 44692360..4562d286 100644 --- a/functions/UTF8_Library/utf8.find.yaml +++ b/functions/UTF8_Library/utf8.find.yaml @@ -1,12 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.find -server: +shared: name: utf8.find description: Finds the first occurrence of the [pattern](http://lua-users.org/wiki/PatternsTutorial) in the string passed. If an instance of the pattern is found, a pair of values representing the start and the end of the matched string is returned. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: pattern + type: string + description: A string match pattern (you can disable pattern matching by using + the optional fourth argument plain ) + - name: startpos + type: int + description: An integer representing the beginning position. + default: '1' + - name: plain + type: boolean + description: A boolean, if pattern matching should be turned off + default: 'false' examples: - path: examples/utf8.find-1.lua description: This example shows how to search for parts of a string. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int utf8.find + name: value2 + description: Returns two number values for the beginning and ending position of + the matched string, nil otherwise. + requires_review: true diff --git a/functions/UTF8_Library/utf8.fold.yaml b/functions/UTF8_Library/utf8.fold.yaml index f21bd1fe..f28f235b 100644 --- a/functions/UTF8_Library/utf8.fold.yaml +++ b/functions/UTF8_Library/utf8.fold.yaml @@ -1,17 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.fold -server: +shared: name: utf8.fold description: Converts a UTF\-8 string to folded case (lowercase), which can be used to compare two strings. If *input* is an integer, it's treat as a codepoint and a convert codepoint (integer) is returned. - parameters: [] + parameters: + - name: input + type: string|int + description: A string character sequence OR an integer value examples: - path: examples/utf8.fold-1.lua description: This example shows how to convert a string to lowercase, which can be used to compare with other folded strings. side: server + returns: + values: + - type: string|int utf8.fold + name: value + description: Returns a string in lowercase OR returns an integer (see description). notes: - type: info content: You may want to read up on case folding for more information about the use of this function. - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.gmatch.yaml b/functions/UTF8_Library/utf8.gmatch.yaml index 2e82649e..fb941355 100644 --- a/functions/UTF8_Library/utf8.gmatch.yaml +++ b/functions/UTF8_Library/utf8.gmatch.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.gmatch -server: +shared: name: utf8.gmatch description: This function returns a pattern finding iterator for UTF\-8 strings. The iterator will search through the string **input** looking for instances of the pattern you passed. For more information on iterators read the [ForTutorial](http://lua-users.org/wiki/ForTutorial) and [IteratorsTutorial](http://lua-users.org/wiki/IteratorsTutorial). - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: pattern + type: string + description: A string match pattern examples: - path: examples/utf8.gmatch-1.lua description: This example prints every word in the UTF-8 string side: server - incomplete: true + returns: + values: + - type: iterator utf8.gmatch + name: value + description: Returns an function for iterations on the input string by using the + passed pattern string. + requires_review: true diff --git a/functions/UTF8_Library/utf8.gsub.yaml b/functions/UTF8_Library/utf8.gsub.yaml index 11a07848..30dab2ad 100644 --- a/functions/UTF8_Library/utf8.gsub.yaml +++ b/functions/UTF8_Library/utf8.gsub.yaml @@ -1,9 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.gsub -server: +shared: name: utf8.gsub description: Returns a copy of the original input string with replaced matches from the pattern by the replacement value. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: pattern + type: string + description: A string match pattern + - name: replace + type: mixed + description: A string literal OR an integer value OR a function (see examples + below) OR a table ({ match = replacement }) + - name: int match_limit + type: '[,' + description: MISSING_PARAM_DESC + default: utf8.len( input examples: - path: examples/utf8.gsub-1.lua description: This example shows how to remove color codes from a string and how @@ -17,8 +31,14 @@ server: description: This example shows a simple bad word filter, which censors the word 'ugly' in the input string. side: client + returns: + values: + - type: string utf8.gsub + name: value + description: Returns a pair of values, the modified string and the integer number + of substitutions made. notes: - type: warning content: 'This function may modify your input string even if no changes were made. Try it with runcode: srun utf8.gsub(utf8.char(66376), "", "") == utf8.char(66376)' - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.insert.yaml b/functions/UTF8_Library/utf8.insert.yaml index 31afaf50..0df41d37 100644 --- a/functions/UTF8_Library/utf8.insert.yaml +++ b/functions/UTF8_Library/utf8.insert.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.insert -server: +shared: name: utf8.insert description: Inserts a substring into input string. If insert\-position is given, the substring will be inserted before the character at this index, otherwise the substring will concatenate to input. The insert position may be negative. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: int insert_pos + type: '[,' + description: MISSING_PARAM_DESC + default: utf8.len( input examples: - path: examples/utf8.insert-1.lua description: This example shows a command handler for '/insert [something]', which will concatenate the '[something]' after the 'hello ' string in 2 ways. side: server - incomplete: true + returns: + values: + - type: string utf8.insert + name: value + description: Returns a string with the inserted substring value. + requires_review: true diff --git a/functions/UTF8_Library/utf8.len.yaml b/functions/UTF8_Library/utf8.len.yaml index f0d19710..7990b537 100644 --- a/functions/UTF8_Library/utf8.len.yaml +++ b/functions/UTF8_Library/utf8.len.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.len -server: +shared: name: utf8.len description: Returns the length of the string passed. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: int i + type: '[,' + description: MISSING_PARAM_DESC + default: 1, int j = utf8.len( input examples: - path: examples/utf8.len-1.lua description: This example calculates the length of the input of the command /length and shows it in the chatbox. side: client - incomplete: true + returns: + values: + - type: int utf8.len + name: value + description: Returns the length of the string as an integer . + requires_review: true diff --git a/functions/UTF8_Library/utf8.lower.yaml b/functions/UTF8_Library/utf8.lower.yaml index 74052cda..86dd364f 100644 --- a/functions/UTF8_Library/utf8.lower.yaml +++ b/functions/UTF8_Library/utf8.lower.yaml @@ -1,17 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.lower -server: +shared: name: utf8.lower description: Converts a UTF\-8 string to folded case (lowercase), which can be used to compare two strings. If *input* is an integer, it's treat as a codepoint and a convert codepoint (integer) is returned. - parameters: [] + parameters: + - name: input + type: string|int + description: A string character sequence OR an integer value examples: - path: examples/utf8.lower-1.lua description: This example shows how to convert a string to lowercase, which can be used to compare with other folded strings. side: server + returns: + values: + - type: string|int utf8.fold + name: value + description: Returns a string in lowercase OR returns an integer (see description). notes: - type: info content: You may want to read up on case folding for more information about the use of this function. - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.match.yaml b/functions/UTF8_Library/utf8.match.yaml index 04cc20ce..82940fff 100644 --- a/functions/UTF8_Library/utf8.match.yaml +++ b/functions/UTF8_Library/utf8.match.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.match -server: +shared: name: utf8.match description: Extract substrings by matching patterns in the input string. This function can be used to extract specific information from a string. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: pattern + type: string + description: A string match pattern + - name: index + type: int + description: An integer representing the beginning position for the pattern matching + default: '1' examples: - path: examples/utf8.match-1.lua description: This example shows how to extract values from an input string by using a pattern to match the value parts. side: server - incomplete: true + returns: + values: + - type: string + name: value1 + - type: '... utf8.match' + name: value2 + description: Returns a sequence of string matches from the input string, nil otherwise. + requires_review: true diff --git a/functions/UTF8_Library/utf8.ncasecmp.yaml b/functions/UTF8_Library/utf8.ncasecmp.yaml index 9d3e498a..e17f58d8 100644 --- a/functions/UTF8_Library/utf8.ncasecmp.yaml +++ b/functions/UTF8_Library/utf8.ncasecmp.yaml @@ -1,9 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.ncasecmp -server: +shared: name: utf8.ncasecmp description: Compares two strings in lower\-case and returns the difference indicator (see table below) as an integer value. - parameters: [] + parameters: + - name: a + type: string + description: A string character sequence + - name: b + type: string + description: A string character sequence examples: - path: examples/utf8.ncasecmp-1.lua description: This example shows a simple comparsion of two different strings. @@ -12,7 +18,12 @@ server: description: This example shows how to greet a player, when he write 'hello' into the chat. side: server - incomplete: true + returns: + values: + - type: int utf8.ncasecmp + name: value + description: Returns an integer , which indicates the difference, see the table + below for further information. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -20,3 +31,4 @@ server: - Missing section: Indicators ' + requires_review: true diff --git a/functions/UTF8_Library/utf8.next.yaml b/functions/UTF8_Library/utf8.next.yaml index ef2a1640..31bc89ca 100644 --- a/functions/UTF8_Library/utf8.next.yaml +++ b/functions/UTF8_Library/utf8.next.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.next -server: +shared: name: utf8.next description: This is an iteration function to traverse each single codepoint of a UTF\-8 string. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: int charpos + type: '[,' + description: MISSING_PARAM_DESC + default: 0 ] + - name: offset + type: int + description: An integer representing the offset to charpos. + default: '1' examples: - path: examples/utf8.next-1.lua description: This example shows how to traverse a UTF-8 string the proper way without running into problems as in byte strings. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int utf8.next + name: value2 + description: Returns the integer position in bytes and the integer codepoint at + this position, nil otherwise. + requires_review: true diff --git a/functions/UTF8_Library/utf8.remove.yaml b/functions/UTF8_Library/utf8.remove.yaml index d83433d4..79414959 100644 --- a/functions/UTF8_Library/utf8.remove.yaml +++ b/functions/UTF8_Library/utf8.remove.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.remove -server: +shared: name: utf8.remove description: This function removes a substring in a UTF\-8 string by using a position range. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: start + type: int + description: An integer representing the beginning position. + default: '1' + - name: stop + type: int + description: An integer representing the ending position. + default: '-1' examples: - path: examples/utf8.remove-1.lua description: This example shows how to remove substrings from strings. side: server - incomplete: true + returns: + values: + - type: string utf8.remove + name: value + description: Returns the string with the removed substring from the range. + requires_review: true diff --git a/functions/UTF8_Library/utf8.reverse.yaml b/functions/UTF8_Library/utf8.reverse.yaml index 60050175..2beb4892 100644 --- a/functions/UTF8_Library/utf8.reverse.yaml +++ b/functions/UTF8_Library/utf8.reverse.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.reverse -server: +shared: name: utf8.reverse description: Reverses the input string. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence examples: - path: examples/utf8.reverse-1.lua description: This example shows how to reverse a UTF-8 string. side: client - incomplete: true + returns: + values: + - type: string utf8.reverse + name: value + description: Returns a string containing the reversed original UTF-8 string. + requires_review: true diff --git a/functions/UTF8_Library/utf8.sub.yaml b/functions/UTF8_Library/utf8.sub.yaml index 4cef8fb1..efcea4ce 100644 --- a/functions/UTF8_Library/utf8.sub.yaml +++ b/functions/UTF8_Library/utf8.sub.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.sub -server: +shared: name: utf8.sub description: Returns a substring of the string passed. The substring starts at *i*. If the third argument *j* is not given, the substring will end at the end of the string. If the third argument is given, the substring ends at and includes *j*. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: int i + type: '[,' + description: MISSING_PARAM_DESC + default: 1, int j = utf8.len( input examples: - path: examples/utf8.sub-1.lua description: This example shows how to extract a substring from a UTF-8 string. @@ -12,4 +19,10 @@ server: - path: examples/utf8.sub-2.lua description: '' side: server - incomplete: true + returns: + values: + - type: string utf8.sub + name: value + description: Returns a string substring of the original string, containing the + selected range from the original string. + requires_review: true diff --git a/functions/UTF8_Library/utf8.title.yaml b/functions/UTF8_Library/utf8.title.yaml index 152a2ac7..52ccc27a 100644 --- a/functions/UTF8_Library/utf8.title.yaml +++ b/functions/UTF8_Library/utf8.title.yaml @@ -1,15 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.title -server: +shared: name: utf8.title description: Converts a UTF\-8 string to title case (uppercase). If *input* is an integer, it is treated as a codepoint and a converted codepoint (integer) is returned. - parameters: [] + parameters: + - name: input + type: string|int + description: A string character sequence OR an integer value examples: - path: examples/utf8.title-1.lua description: This example shows how to convert a string to uppercase. side: client + returns: + values: + - type: string utf8.title + name: value + description: Returns a string in uppercase OR returns an integer (see description). notes: - type: info content: You may want to read up on case folding for more information about the use of this function. - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.upper.yaml b/functions/UTF8_Library/utf8.upper.yaml index 7849fcaa..c91f4ecb 100644 --- a/functions/UTF8_Library/utf8.upper.yaml +++ b/functions/UTF8_Library/utf8.upper.yaml @@ -1,15 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.upper -server: +shared: name: utf8.upper description: Converts a UTF\-8 string to title case (uppercase). If *input* is an integer, it is treated as a codepoint and a converted codepoint (integer) is returned. - parameters: [] + parameters: + - name: input + type: string|int + description: A string character sequence OR an integer value examples: - path: examples/utf8.upper-1.lua description: This example shows how to convert a string to uppercase. side: client + returns: + values: + - type: string utf8.title + name: value + description: Returns a string in uppercase OR returns an integer (see description). notes: - type: info content: You may want to read up on case folding for more information about the use of this function. - incomplete: true + requires_review: true diff --git a/functions/UTF8_Library/utf8.width.yaml b/functions/UTF8_Library/utf8.width.yaml index fb15680d..851443cb 100644 --- a/functions/UTF8_Library/utf8.width.yaml +++ b/functions/UTF8_Library/utf8.width.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.width -server: +shared: name: utf8.width description: Calculates the width of UTF\-8 strings with special/unprintable characters, which require special width treatment. - parameters: [] + parameters: + - name: input + type: string|int + description: A string character sequence OR a codepoint integer + - name: ambi_is_double + type: bool + description: A boolean, if set to true , ambiguous character's width is 2 (see + example below). + default: 'false' + - name: default_width + type: int + description: An integer, if given, is used as width for unprintable characters. + default: '0' examples: - path: examples/utf8.width-1.lua description: This example shows the difference whenambi_is_doubleis set tofalseortrue. side: server - incomplete: true + returns: + values: + - type: int utf8.width + name: value + description: Returns the integer width of the input string OR the width of the + codepoint integer. + requires_review: true diff --git a/functions/UTF8_Library/utf8.widthindex.yaml b/functions/UTF8_Library/utf8.widthindex.yaml index eb14bd18..f0d6f063 100644 --- a/functions/UTF8_Library/utf8.widthindex.yaml +++ b/functions/UTF8_Library/utf8.widthindex.yaml @@ -1,11 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Utf8.widthindex -server: +shared: name: utf8.widthindex description: Returns the location, offset and width of the character at the given location in the UTF\-8 string. - parameters: [] + parameters: + - name: input + type: string + description: A string character sequence + - name: location + type: int + description: MISSING_PARAM_DESC + - name: ambi_is_double + type: bool + description: A boolean, if set to true , ambiguous character's width is 2 (see + example). + default: 'false' + - name: default_width + type: int + description: An integer, if given, is used as width for unprintable characters. + default: '0' examples: - path: examples/utf8.widthindex-1.lua description: This example side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int utf8.widthindex + name: value3 + description: Returns the given location, the offset in UTF-8 encoding (if cursor + is in the middle of the wide char - offset will be 2) and the width of the character, + otherwise only the location as integer will be returned. + requires_review: true diff --git a/functions/Utility/addDebugHook.yaml b/functions/Utility/addDebugHook.yaml index d653d587..93723003 100644 --- a/functions/Utility/addDebugHook.yaml +++ b/functions/Utility/addDebugHook.yaml @@ -1,9 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddDebugHook -server: +shared: name: addDebugHook description: This function allows tracing of MTA functions and events. It should only be used when debugging scripts as it may degrade script performance. - parameters: [] + parameters: + - name: hookType + type: string + description: 'The type of hook to add. This can be: preEvent postEvent preFunction + postFunction preEventFunction postEventFunction' + - name: callbackFunction + type: function + description: The function to call Returning the string "skip" from the callback + function will cause the original function/event to be skipped + - name: nameList + type: table + description: Table of strings for restricting which functions and events the hook + will be triggered on addDebugHook and removeDebugHook will only be hooked if + they are specified in the name list examples: - path: examples/addDebugHook-1.lua description: 'This example will dump info about all triggered events:' @@ -15,7 +28,11 @@ server: description: This example adds a hook which will only be triggered for the named functions side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the hook was successfully added, or false otherwise. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -23,3 +40,4 @@ server: - Missing section: Callback parameters ' + requires_review: true diff --git a/functions/Utility/bitAnd.yaml b/functions/Utility/bitAnd.yaml index 177b7680..d5f27514 100644 --- a/functions/Utility/bitAnd.yaml +++ b/functions/Utility/bitAnd.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitAnd -server: +shared: name: bitAnd description: This function performs a bitwise AND\-conjunction on two or more (unsigned) 32\-bit [integers](/wiki/Int "Int"). See [Bitwise operation](http://en.wikipedia.org/wiki/Bitwise_operation#AND) for more details. - parameters: [] + parameters: + - name: var1 + type: uint + description: MISSING_PARAM_DESC + - name: var2 + type: uint + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/bitAnd-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the conjuncted value. + requires_review: true diff --git a/functions/Utility/bitArShift.yaml b/functions/Utility/bitArShift.yaml index 93246a50..1705bfc5 100644 --- a/functions/Utility/bitArShift.yaml +++ b/functions/Utility/bitArShift.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitArShift -server: +shared: name: bitArShift description: 'This functions performs an arithmetic shift on the integer **value** by integer **n** positions. In an *arithmetic shift*, zeros are shifted in to @@ -8,10 +8,21 @@ server: See [Bitwise operation](https://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift) for more details.' - parameters: [] + parameters: + - name: value + type: int + description: The value you want to perform the arithmetic shift on. + - name: "n" + type: int + description: The amount of positions to shift the value by. examples: - path: examples/bitArShift-1.lua description: This example adds the clientside command/arshift [value] [positions = 1], which will print the result from the functionbitArShift. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the arithmetic shifted value as integer . + requires_review: true diff --git a/functions/Utility/bitExtract.yaml b/functions/Utility/bitExtract.yaml index a9c1ee6b..7d780a41 100644 --- a/functions/Utility/bitExtract.yaml +++ b/functions/Utility/bitExtract.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitExtract -server: +shared: name: bitExtract description: 'This function returns the unsigned number formed by the bits field to field \+ width \- 1 (range: 0\-31\).' - parameters: [] + parameters: + - name: var + type: uint + description: The value + - name: field + type: int + description: The field number + - name: width + type: int + description: Number of bits to extract + default: '1' examples: - path: examples/bitExtract-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the extracted value/bit sequence. + requires_review: true diff --git a/functions/Utility/bitLRotate.yaml b/functions/Utility/bitLRotate.yaml index 9e13936f..c8328e7f 100644 --- a/functions/Utility/bitLRotate.yaml +++ b/functions/Utility/bitLRotate.yaml @@ -1,14 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitLRotate -server: +shared: name: bitLRotate description: 'This functions performs a bitwise circular left\-rotation on the integer **value** by integer **n** positions. See [Bitwise operation](https://en.wikipedia.org/wiki/Bitwise_operation#Rotate_no_carry) for more details.' - parameters: [] + parameters: + - name: value + type: int + description: The value you want to perform the rotation on. + - name: "n" + type: int + description: The amount of positions to rotate the value by. examples: - path: examples/bitLRotate-1.lua description: This example shows the usage of the functionbitLRotate. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the circular left-rotated value as integer . + requires_review: true diff --git a/functions/Utility/bitLShift.yaml b/functions/Utility/bitLShift.yaml index aeb56756..7ad1da6b 100644 --- a/functions/Utility/bitLShift.yaml +++ b/functions/Utility/bitLShift.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitLShift -server: +shared: name: bitLShift description: 'This functions performs a logical left shift on the integer **value** by integer **n** positions. In a *logical shift*, zeros are shifted in to replace @@ -7,9 +7,20 @@ server: See [Bitwise operation](https://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift) for more details.' - parameters: [] + parameters: + - name: value + type: int + description: The value you want to perform the shift on. + - name: "n" + type: int + description: The amount of positions to shift the value by. examples: - path: examples/bitLShift-1.lua description: This example shows the usage of the functionbitLShift. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the logical left shifted value as integer . + requires_review: true diff --git a/functions/Utility/bitNot.yaml b/functions/Utility/bitNot.yaml index 8fe4cc0c..993b3a75 100644 --- a/functions/Utility/bitNot.yaml +++ b/functions/Utility/bitNot.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitNot -server: +shared: name: bitNot description: This function performs a bitwise NOT on an (unsigned) 32\-bit [integer](/wiki/Int "Int"). See [Bitwise operation](http://en.wikipedia.org/wiki/Bitwise_operation#NOT) for more details. - parameters: [] + parameters: + - name: var + type: uint + description: The value you want to perform a bitwise NOT on examples: - path: examples/bitNot-1.lua description: --In this example we make a command which you can do a bitNot operator side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the value on which the operation has been performed. + requires_review: true diff --git a/functions/Utility/bitOr.yaml b/functions/Utility/bitOr.yaml index cc7ed1f9..43b56722 100644 --- a/functions/Utility/bitOr.yaml +++ b/functions/Utility/bitOr.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitOr -server: +shared: name: bitOr description: This function performs a bitwise OR\-conjunction on two or more (unsigned) 32\-bit [integers](/wiki/Int "Int"). See [Bitwise operation](http://en.wikipedia.org/wiki/Bitwise_operation#OR) for more details. - parameters: [] + parameters: + - name: var1 + type: uint + description: MISSING_PARAM_DESC + - name: var2 + type: uint + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/bitOr-1.lua description: This example will do a bitwise OR of x1, x2, ... side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the conjuncted value. + requires_review: true diff --git a/functions/Utility/bitRRotate.yaml b/functions/Utility/bitRRotate.yaml index 8a61543e..afd7baec 100644 --- a/functions/Utility/bitRRotate.yaml +++ b/functions/Utility/bitRRotate.yaml @@ -1,15 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitRRotate -server: +shared: name: bitRRotate description: 'This functions performs a bitwise circular right\-rotation on the integer **value** by integer **n** positions. See [Bitwise operation](https://en.wikipedia.org/wiki/Bitwise_operation#Rotate_no_carry) for more details.' - parameters: [] + parameters: + - name: value + type: int + description: The value you want to perform the rotation on. + - name: "n" + type: int + description: The amount of positions to rotate the value by. examples: - path: examples/bitRRotate-1.lua description: This example adds the clientside command/rightrotate [value] [positions = 1], which will print the result from the functionbitRRotate. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the circular right-rotated value as integer . + requires_review: true diff --git a/functions/Utility/bitRShift.yaml b/functions/Utility/bitRShift.yaml index 354bc327..5f70a436 100644 --- a/functions/Utility/bitRShift.yaml +++ b/functions/Utility/bitRShift.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitRShift -server: +shared: name: bitRShift description: 'This functions performs a logical right shift on the integer **value** by integer **n** positions. In a *logical shift*, zeros are shifted in to replace @@ -7,9 +7,20 @@ server: See [Bitwise operation](https://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift) for more details.' - parameters: [] + parameters: + - name: value + type: int + description: The value you want to perform the shift on. + - name: "n" + type: int + description: The amount of positions to shift the value by. examples: - path: examples/bitRShift-1.lua description: This example shows the usage of the functionbitRShift. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the logical right shifted value as integer . + requires_review: true diff --git a/functions/Utility/bitReplace.yaml b/functions/Utility/bitReplace.yaml index fbf7451b..c05e6b7b 100644 --- a/functions/Utility/bitReplace.yaml +++ b/functions/Utility/bitReplace.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitReplace -server: +shared: name: bitReplace description: This function returns the unsigned number formed by var value with replacement specified at bits field to field \+ width \- 1 - parameters: [] + parameters: + - name: var + type: uint + description: The value + - name: replaceValue + type: uint + description: The replaceValue + - name: field + type: int + description: The field number + - name: width + type: int + description: Number of bits to extract + default: '1' examples: - path: examples/bitReplace-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the replaced value/bit sequence. + requires_review: true diff --git a/functions/Utility/bitTest.yaml b/functions/Utility/bitTest.yaml index d1777b16..6a4b6dde 100644 --- a/functions/Utility/bitTest.yaml +++ b/functions/Utility/bitTest.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitTest -server: +shared: name: bitTest description: This function performs an AND\-conjunction on two or more (unsigned) 32\-bit [integers](/wiki/Int "Int") and checks, whether the conjuncted value is zero or not. See [Bitwise operation](http://en.wikipedia.org/wiki/Bitwise_operation#AND) for more details. - parameters: [] + parameters: + - name: var1 + type: uint + description: MISSING_PARAM_DESC + - name: var2 + type: uint + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/bitTest-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the conjuncted value is not zero, false otherwise. + If a bad argument was passed to bitTest , you'll get nil . + requires_review: true diff --git a/functions/Utility/bitXor.yaml b/functions/Utility/bitXor.yaml index 4967a43a..5676cebb 100644 --- a/functions/Utility/bitXor.yaml +++ b/functions/Utility/bitXor.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BitXor -server: +shared: name: bitXor description: This function performs a bitwise XOR\-conjunction (exclusive OR) on two or more (unsigned) 32\-bit [integers](/wiki/Int "Int"). See [Bitwise operation](http://en.wikipedia.org/wiki/Bitwise_operation#XOR) for more details. - parameters: [] + parameters: + - name: var1 + type: uint + description: MISSING_PARAM_DESC + - name: var2 + type: uint + description: MISSING_PARAM_DESC + - name: '...' + type: unknown + description: MISSING_PARAM_DESC examples: - path: examples/bitXor-1.lua description: This example will do a bitwise XOR of x1, x2, ... side: server - incomplete: true + returns: + values: + - type: uint + name: value + description: Returns the conjuncted value. + requires_review: true diff --git a/functions/Utility/createTrayNotification.yaml b/functions/Utility/createTrayNotification.yaml index b68f2018..726203f0 100644 --- a/functions/Utility/createTrayNotification.yaml +++ b/functions/Utility/createTrayNotification.yaml @@ -1,8 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateTrayNotification -client: +shared: name: createTrayNotification description: This function creates a notification balloon on the desktop. - parameters: [] + parameters: + - name: notificationText + type: string + description: The text to send in the notification. + - name: iconType + type: string + description: 'The notification icon type. Possible values are: "default" (the + MTA icon), "info", "warning", "error"' + default: '"default"' + - name: useSound + type: bool + description: A boolean value indicating whether or not to play a sound when receiving + the notification. + default: 'true' examples: - path: examples/createTrayNotification-1.lua description: '' @@ -10,6 +23,11 @@ client: - path: examples/createTrayNotification-2.lua description: 'Example of notification on minimize MTA application:' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the notification is correctly created, false otherwise. notes: - type: info content: MTA won't show any tray notifications if the MTA window is focused, because @@ -17,4 +35,4 @@ client: to test this function you should use a Timer and switch to your desktop. - type: info content: You can only show a tray notification every 30 seconds. - incomplete: true + requires_review: true diff --git a/functions/Utility/debugSleep.yaml b/functions/Utility/debugSleep.yaml index 101a181d..b749cb83 100644 --- a/functions/Utility/debugSleep.yaml +++ b/functions/Utility/debugSleep.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DebugSleep -server: +shared: name: debugSleep description: debugSleep freezes the client/server for the specified time. This means that all synchronization, rendering and script execution will stop except HTTP @@ -7,12 +7,21 @@ server: only works, if development mode is enabled by [setDevelopmentMode](/wiki/SetDevelopmentMode "SetDevelopmentMode") and can be utilised to build a debugger that communicates via HTTP requests with the editor/IDE. - parameters: [] + parameters: + - name: sleep + type: int + description: An integer value in milliseconds. examples: - path: examples/debugSleep-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the development mode is enabled and arguments are + correct, false otherwise. notes: - type: warning content: Only use this function if you know what you are doing! - incomplete: true + requires_review: true diff --git a/functions/Utility/decodeString.yaml b/functions/Utility/decodeString.yaml index bfa1f998..3488fb4c 100644 --- a/functions/Utility/decodeString.yaml +++ b/functions/Utility/decodeString.yaml @@ -1,16 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DecodeString -server: +shared: name: decodeString description: This function decodes an encoded [string](/wiki/String "String") using the specified algorithm. The counterpart of this function is [encodeString](/wiki/EncodeString "EncodeString"). - parameters: [] + parameters: + - name: algorithm + type: string + description: The algorithm to use. + - name: input + type: string + description: The input to decode. + - name: options + type: table + description: MISSING_PARAM_DESC + - name: callback + type: function + description: providing a callback will run this function asynchronously, the arguments + to the callback are the same as the returned values below. examples: - path: examples/decodeString-1.lua description: Adds a/decodecommand in which you can provide an algorithm, key and data to decode. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the decoded string if successful, false otherwise. If a callback + was provided, the decoded string is argument to the callback. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -18,3 +36,4 @@ server: - Missing section: Options for each algorithm ' + requires_review: true diff --git a/functions/Utility/deref.yaml b/functions/Utility/deref.yaml index e8422492..f442d843 100644 --- a/functions/Utility/deref.yaml +++ b/functions/Utility/deref.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Deref -server: +shared: name: deref description: This function will take a reference obtained by the [ref](/wiki/Ref "Ref") function and returns its Lua element. - parameters: [] + parameters: + - name: reference + type: int + description: The valid reference, which you want to dereference examples: [] + returns: + values: + - type: mixed + name: value + description: Returns mixed if the reference were valid. Returns false if the reference + were invalid. notes: - type: info content: This function was originally created to prevent garbage-collection of @@ -12,4 +21,4 @@ server: reference them. The storage of those references can be obtained by a call to the debug.getregistry function. The ref and deref template can easily be remade using a locally-hidden Lua table and two such function implementations. - incomplete: true + requires_review: true diff --git a/functions/Utility/downloadFile.yaml b/functions/Utility/downloadFile.yaml index 96a476fa..8ced0dda 100644 --- a/functions/Utility/downloadFile.yaml +++ b/functions/Utility/downloadFile.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DownloadFile -client: +shared: name: downloadFile description: This function ensures the requested resource file is correct and then triggers [onClientFileDownloadComplete](/wiki/OnClientFileDownloadComplete "OnClientFileDownloadComplete"). @@ -8,12 +8,20 @@ client: "OnClientFileDownloadComplete") will still run. The **file** should also be included in the resource meta.xml with the **download** attribute set to "false", see [meta.xml](/wiki/Meta.xml "Meta.xml") for more details. - parameters: [] + parameters: + - name: fileName + type: string + description: A string referencing the name of the file to download examples: - path: examples/downloadFile-1.lua description: Example 1:This client side event downloads a file when the current resource has started. side: client + returns: + values: + - type: bool + name: value + description: Returns true if file download has been queued, false otherwise. notes: - type: info content: This function may cause performance issues with client and/or server. @@ -24,4 +32,4 @@ client: - type: tip content: Avoid using fileExists before calling downloadFile . Always call downloadFile and handle the result in onClientFileDownloadComplete - incomplete: true + requires_review: true diff --git a/functions/Utility/encodeString.yaml b/functions/Utility/encodeString.yaml index e0fbf73e..71475b22 100644 --- a/functions/Utility/encodeString.yaml +++ b/functions/Utility/encodeString.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/EncodeString -server: +shared: name: encodeString description: This function encodes a [string](/wiki/String "String") using the specified algorithm. The counterpart of this function is [decodeString](/wiki/DecodeString "DecodeString"). - parameters: [] + parameters: + - name: algorithm + type: string + description: The algorithm to use. + - name: input + type: string + description: The input to encode. + - name: options + type: table + description: A table with options and other necessary data for the algorithm, + as detailed below. + - name: callback + type: function + description: providing a callback will run this function asynchronously, the arguments + to the callback are the same as the returned values below. examples: - path: examples/encodeString-1.lua description: Adds an/encodecommand in which you can provide an algorithm, key @@ -15,12 +29,15 @@ server: description: This example shows you how to use the RSA encryption with a simple string message. side: server + returns: + values: + - type: string + name: value notes: - type: tip content: If it doesn't matter which algorithm you use for the encoding, keep in mind that aes128 uses hardware acceleration so it may outperform the tea algorithm on most processors. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -30,3 +47,4 @@ server: - Missing section: Returns for each algorithm ' + requires_review: true diff --git a/functions/Utility/fromJSON.yaml b/functions/Utility/fromJSON.yaml index 4f1b9acd..3abd87c0 100644 --- a/functions/Utility/fromJSON.yaml +++ b/functions/Utility/fromJSON.yaml @@ -1,10 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FromJSON -server: +shared: name: fromJSON description: This function parses a [JSON](/wiki/JSON "JSON") formatted string into variables. You can use [toJSON](/wiki/ToJSON "ToJSON") to encode variables into a JSON string that can be read by this function. - parameters: [] + parameters: + - name: json + type: string + description: A JSON formatted string examples: - path: examples/fromJSON-1.lua description: This makes data equal:{ ["1"] = "cat", ["2"] = "mouse", ["3"] = 5, @@ -13,4 +16,9 @@ server: - path: examples/fromJSON-2.lua description: 'This shows how to extract data from JSON:' side: server - incomplete: true + returns: + values: + - type: var + name: value + description: Returns variables read from the JSON string. + requires_review: true diff --git a/functions/Utility/generateKeyPair.yaml b/functions/Utility/generateKeyPair.yaml index ba8138d1..80fc3385 100644 --- a/functions/Utility/generateKeyPair.yaml +++ b/functions/Utility/generateKeyPair.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GenerateKeyPair -server: +shared: name: generateKeyPair description: This function creates a new public key and private key for encrypting data - parameters: [] + parameters: + - name: algorithm + type: string + description: 'The algorithm to use: RSA : use the RSA public-key algorithm' + - name: options + type: table + description: table with options for the hashing algorithm, as detailed below. + - name: callback + type: function + description: providing a callback will run this function asynchronously, the arguments + to the callback are the same as the returned values below. examples: - path: examples/generateKeyPair-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: string + name: value1 + - type: string + name: value2 + description: 'Returns 2 strings if successful: private key and public key . Otherwise + returns false' meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -16,3 +33,4 @@ server: - Missing section: Options for each hashing algorithm ' + requires_review: true diff --git a/functions/Utility/getColorFromString.yaml b/functions/Utility/getColorFromString.yaml index f8eb18d0..0ba731ac 100644 --- a/functions/Utility/getColorFromString.yaml +++ b/functions/Utility/getColorFromString.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColorFromString -server: +shared: name: getColorFromString description: This function will extract Red, Green, Blue and Alpha values from a hex string you provide it. These strings follow the same format as used in HTML, with addition of the Alpha values. - parameters: [] + parameters: + - name: theColor + type: string + description: A string containing a valid color code. examples: - path: examples/getColorFromString-1.lua description: This example will set the blip attached to a player to a color they specify by typingset_my_color [color]in the console. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: 'Returns four integers in RGBA format, with a maximum value of 255 + for each. Each stands for red , green , blue , and alpha . Alpha decides transparancy + where 255 is opaque and 0 is transparent. false is returned if the string passed + is invalid (for example, is missing the preceeding # sign).' + requires_review: true diff --git a/functions/Utility/getDevelopmentMode.yaml b/functions/Utility/getDevelopmentMode.yaml index 24841108..01f160fd 100644 --- a/functions/Utility/getDevelopmentMode.yaml +++ b/functions/Utility/getDevelopmentMode.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetDevelopmentMode -server: +shared: name: getDevelopmentMode description: This function is used to get the development mode of the client or whole server. For more information see [setDevelopmentMode](/wiki/SetDevelopmentMode @@ -9,4 +9,9 @@ server: - path: examples/getDevelopmentMode-1.lua description: This command enables / disables the development mode side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the development mode is on, false if off. + requires_review: true diff --git a/functions/Utility/getDistanceBetweenPoints2D.yaml b/functions/Utility/getDistanceBetweenPoints2D.yaml index 4c7fee6e..2fbfaf66 100644 --- a/functions/Utility/getDistanceBetweenPoints2D.yaml +++ b/functions/Utility/getDistanceBetweenPoints2D.yaml @@ -1,9 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints2D -server: +shared: name: getDistanceBetweenPoints2D description: This function returns the distance between two 2 dimensional points using the pythagorean theorem. - parameters: [] + parameters: + - name: x1 + type: float + description: The X position of the first point + - name: y1 + type: float + description: The Y position of the first point + - name: x2 + type: float + description: The X position of the second point + - name: y2 + type: float + description: The Y position of the second point examples: - path: examples/getDistanceBetweenPoints2D-1.lua description: This example gets the distance between two vehicles, stored in variablesvehicle1andvehicle2. @@ -13,10 +25,16 @@ server: points and is also more efficient if your script is calling this function extremely often. side: server + returns: + values: + - type: float + name: value + description: Returns a float containing the 2D distance between the two points. + Returns false if invalid parameters are passed. notes: - type: info content: This function is equivalent to the Vector2 class getLength method when used with a vector that holds the direction and distance between two points. In other words, it produces exactly the same result as substracting the points' coordinates and getting the length of the result vector. - incomplete: true + requires_review: true diff --git a/functions/Utility/getDistanceBetweenPoints3D.yaml b/functions/Utility/getDistanceBetweenPoints3D.yaml index f4c6e7b6..b7d8a10b 100644 --- a/functions/Utility/getDistanceBetweenPoints3D.yaml +++ b/functions/Utility/getDistanceBetweenPoints3D.yaml @@ -1,9 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints3D -server: +shared: name: getDistanceBetweenPoints3D description: This function returns the distance between two 3 dimensional points using the pythagorean theorem. - parameters: [] + parameters: + - name: x1 + type: float + description: The X position of the first point + - name: y1 + type: float + description: The Y position of the first point + - name: z1 + type: float + description: The Z position of the first point + - name: x2 + type: float + description: The X position of the second point + - name: y2 + type: float + description: The Y position of the second point + - name: z2 + type: float + description: The Z position of the second point examples: - path: examples/getDistanceBetweenPoints3D-1.lua description: '' @@ -16,10 +34,16 @@ server: of 3 dimensional vectors. This example calculates the speed of a vehicle by measuring the size of the it''s velocity vector:' side: server + returns: + values: + - type: float + name: value + description: Returns a float containing the distance between the two points as + a float . Returns false if an argument passed was invalid. notes: - type: info content: This function is equivalent to the Vector3 class getLength method when used with a vector that holds the direction and distance between two points. In other words, it produces exactly the same result as substracting the points' coordinates and getting the length of the result vector. - incomplete: true + requires_review: true diff --git a/functions/Utility/getEasingValue.yaml b/functions/Utility/getEasingValue.yaml index 41d9bc2b..1fe37edf 100644 --- a/functions/Utility/getEasingValue.yaml +++ b/functions/Utility/getEasingValue.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetEasingValue -server: +shared: name: getEasingValue description: 'Used for custom Lua based interpolation, returns the easing value (animation time to use in your custom interpolation) given a progress and an [easing @@ -8,7 +8,26 @@ server: In most cases, either [moveObject](/wiki/MoveObject "MoveObject") or [interpolateBetween](/wiki/InterpolateBetween "InterpolateBetween") can do the job. getEasingValue is only provided in case you want to do your own custom interpolation based on easing.' - parameters: [] + parameters: + - name: fProgress + type: float + description: float between 0 and 1 indicating the interpolation progress (0 at + the beginning of the interpolation, 1 at the end). + - name: strEasingType + type: string + description: the easing function to use for the interpolation + - name: fEasingPeriod + type: float + description: the period of the easing function (only some easing functions use + this parameter) + - name: fEasingAmplitude + type: float + description: the amplitude of the easing function (only some easing functions + use this parameter) + - name: fEasingOvershoot + type: float + description: the overshoot of the easing function (only some easing functions + use this parameter) examples: - path: examples/getEasingValue-1.lua description: 'This clientside example uses getEasingValue to make a custom camera @@ -23,4 +42,11 @@ server: the alpha between 0 and 255 and then 255 and 0 but is example is just to illustrate the use of getEasingValue by itself.' side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns fAnimationTime the animation time given by the easing function + (can be < 0 or > 1 since some easing functions have overshoot or bounce/spring + effects, false otherwise (error in parameters). + requires_review: true diff --git a/functions/Utility/getFPSLimit.yaml b/functions/Utility/getFPSLimit.yaml index 4c072e67..dccdff19 100644 --- a/functions/Utility/getFPSLimit.yaml +++ b/functions/Utility/getFPSLimit.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetFPSLimit -server: +shared: name: getFPSLimit description: This function retrieves the maximum [FPS (Frames per second)](http://en.wikipedia.org/wiki/Frame_rate) that players on the server can run their game at. @@ -9,8 +9,14 @@ server: description: This example displays a message in the chatbox showing the current FPS limit. side: server + returns: + values: + - type: int + name: value + description: Returns an integer between 25 and 32767 (refer to the note above) + of the maximum FPS that players can run their game at. notes: - type: info content: Starting from version [ r21313 ] and above fpsLimit range is 25-32767 . In older MTA releases it was 25-100 . - incomplete: true + requires_review: true diff --git a/functions/Utility/getKeyboardLayout.yaml b/functions/Utility/getKeyboardLayout.yaml index 7831691e..67d89d39 100644 --- a/functions/Utility/getKeyboardLayout.yaml +++ b/functions/Utility/getKeyboardLayout.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetKeyboardLayout -client: +shared: name: getKeyboardLayout description: This function gets the player's keyboard layout settings, which they are currently (keyboard layout can be changed at any moment) using at the time @@ -9,4 +9,9 @@ client: - path: examples/getKeyboardLayout-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with keyboard layout properties:' + requires_review: true diff --git a/functions/Utility/getLocalization.yaml b/functions/Utility/getLocalization.yaml index 33ab102e..494aa150 100644 --- a/functions/Utility/getLocalization.yaml +++ b/functions/Utility/getLocalization.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetLocalization -client: +shared: name: getLocalization description: This function gets the player's localization setting as set in the MTA client. @@ -17,4 +17,9 @@ client: description: This function is useful for fixing any scripts that were made before MTA 1.6 as some of the language codes were changed. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with the following entries:' + requires_review: true diff --git a/functions/Utility/getNetworkStats.yaml b/functions/Utility/getNetworkStats.yaml index 7c398be2..8ba0740a 100644 --- a/functions/Utility/getNetworkStats.yaml +++ b/functions/Utility/getNetworkStats.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetNetworkStats -server: +client: name: getNetworkStats description: This function returns network status information. parameters: [] @@ -8,4 +8,24 @@ server: description: This example outputs the local players network status information to their console when using the /netstatus command side: client - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table, the indexes in the table are the following:' + requires_review: true +server: + name: getNetworkStats + description: This function returns network status information. + parameters: + - name: thePlayer + type: element + description: MISSING_PARAM_DESC + default: nil + examples: [] + returns: + values: + - type: table + name: value + description: 'Returns a table, the indexes in the table are the following:' + requires_review: true diff --git a/functions/Utility/getNetworkUsageData.yaml b/functions/Utility/getNetworkUsageData.yaml index edc792f3..b20c1d2d 100644 --- a/functions/Utility/getNetworkUsageData.yaml +++ b/functions/Utility/getNetworkUsageData.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetNetworkUsageData -server: +shared: name: getNetworkUsageData description: This function returns a [table](/wiki/Table "Table") containing network usage information about inbound and outbound packets. @@ -9,4 +9,12 @@ server: description: This example adds commandndthat shows info about all inbound packets with bits bigger than zero. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with two fields: "in" and "out". Each of these contain + a table with two fields: "bits" and "count". Each of these contain a table with + 256 numeric fields ranging from 0 to 255, containing the appropriate network + usage data for such packet id.' + requires_review: true diff --git a/functions/Utility/getPerformanceStats.yaml b/functions/Utility/getPerformanceStats.yaml index ae899e35..41c88fa5 100644 --- a/functions/Utility/getPerformanceStats.yaml +++ b/functions/Utility/getPerformanceStats.yaml @@ -1,10 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPerformanceStats -server: +shared: name: getPerformanceStats description: This function returns performance information. - parameters: [] + parameters: + - name: category + type: string + description: Performance statistics category. If empty string is given, list of + all categories is returned.See categories for more information. + - name: options + type: string + description: Category specific ',' separated options. All categories supports + 'h' option for help. + default: '""' + - name: filter + type: string + description: Case-sensitive filter used to select returned rows. Only 'name' column + is filtered. + default: '""' examples: - path: examples/getPerformanceStats-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table table + name: value + description: Returns two tables. First contains column names. The second contains + result rows. Each row is table of cells. + requires_review: true diff --git a/functions/Utility/getProcessMemoryStats.yaml b/functions/Utility/getProcessMemoryStats.yaml index 70bfab21..54269d87 100644 --- a/functions/Utility/getProcessMemoryStats.yaml +++ b/functions/Utility/getProcessMemoryStats.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetProcessMemoryStats -server: +shared: name: getProcessMemoryStats description: This function returns a breakdown of the process memory usage. The reported numbers are always byte units and these numbers can be **inaccurate**. @@ -8,4 +8,9 @@ server: - path: examples/getProcessMemoryStats-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table|nil + name: value + description: Returns a table if successful, otherwise returns nil + requires_review: true diff --git a/functions/Utility/getRealTime.yaml b/functions/Utility/getRealTime.yaml index 343400c9..76c2fbff 100644 --- a/functions/Utility/getRealTime.yaml +++ b/functions/Utility/getRealTime.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRealTime -server: +shared: name: getRealTime description: This function gets the server or client (if used client sided it returns time as set on client's computer) real time and returns it in a table. If you want to get the in\-game time (shown on GTA's clock) use [getTime](/wiki/GetTime "GetTime"). - parameters: [] + parameters: + - name: seconds + type: int + description: A count in seconds from the year 1970. Useful for storing points + in time, or for retrieving time information for getBanTime . The valid range + of this argument is 0 to 32,000,000,000 + default: current + - name: localTime + type: bool + description: MISSING_PARAM_DESC + default: 'true' examples: - path: examples/getRealTime-1.lua description: 'This example adds ''showtime'' like the default MTA ''time'' command:' @@ -13,10 +23,16 @@ server: - path: examples/getRealTime-2.lua description: 'Example with year, month, monthday using string.format:' side: server + returns: + values: + - type: table + name: value + description: Returns a table of substrings with different time format or false + if the seconds argument is out of range. notes: - type: info content: The seconds parameter can be left out entirely while still using the localTime parameter. To achieve that simply pass the boolean localTime parameter as first argument where you would otherwise pass the seconds parameter. This way you can retrieve a current timepoint that is not denoted in local time. - incomplete: true + requires_review: true diff --git a/functions/Utility/getServerIp.yaml b/functions/Utility/getServerIp.yaml index 59bdf6c2..5f7934e3 100644 --- a/functions/Utility/getServerIp.yaml +++ b/functions/Utility/getServerIp.yaml @@ -1,18 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetServerIp -client: +shared: name: getServerIp description: This function returns the IP of the server the client is currently connected to. - parameters: [] + parameters: + - name: includePort + type: bool + description: If set to true , the string will include the port of the server at + the end of the string, after a colon (:) character. + default: 'false' examples: - path: examples/getServerIp-1.lua description: This example creates a console command that outputs the server's IP to the chatbox. side: client + returns: + values: + - type: string + name: value + description: A string containing the remote address of the server the client is + currently connected to. notes: - type: info content: On server-side there is the getServerIpFromMasterServer function, which might return the server IP under certain conditions. You should consider using a third-party service via fetchServerIp (not an MTA function) if the previous function is unreliable for you. - incomplete: true + requires_review: true diff --git a/functions/Utility/getTickCount.yaml b/functions/Utility/getTickCount.yaml index 780905e4..80d2f1a5 100644 --- a/functions/Utility/getTickCount.yaml +++ b/functions/Utility/getTickCount.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTickCount -server: +shared: name: getTickCount description: This function returns amount of time that your system has been running in milliseconds. By comparing two values of getTickCount, you can determine how @@ -18,8 +18,14 @@ server: displayed every frame. You can log any specific moment in time by outputting the currentCount variable. side: server + returns: + values: + - type: int + name: value + description: Returns an integer containing the number of milliseconds since the + system the server is running on started. This has the potential to wrap-around. notes: - type: important content: The value returned by this function client-side may not be reliable if a client is maliciously modifying their operating system speed. - incomplete: true + requires_review: true diff --git a/functions/Utility/getTimerDetails.yaml b/functions/Utility/getTimerDetails.yaml index da99abce..b3e4f925 100644 --- a/functions/Utility/getTimerDetails.yaml +++ b/functions/Utility/getTimerDetails.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTimerDetails -server: +shared: name: getTimerDetails description: This function is for getting the details of a running timer. - parameters: [] + parameters: + - name: theTimer + type: timer + description: A timer element. examples: - path: examples/getTimerDetails-1.lua description: 'This example creates a 1 second (1000 ms) timer that will run 10 times, and you can see the timer details by using the command: timerdetails.' side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: 'This example creates a 1 second (1000 ms) timer that will run 10 + times, and you can see the timer details by using the command: timerdetails.' + oop: + element: timer + method: getDetails + static: false + requires_review: true diff --git a/functions/Utility/getTimers.yaml b/functions/Utility/getTimers.yaml index d9c2eac6..e2a87e3e 100644 --- a/functions/Utility/getTimers.yaml +++ b/functions/Utility/getTimers.yaml @@ -1,12 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTimers -server: +shared: name: getTimers description: This function returns a table of all active timers that the resource that calls it has created. Alternatively, only the timers with a remaining time less than or equal to a certain value can be retrieved. - parameters: [] + parameters: + - name: theTime + type: int + description: The maximum time left (in milliseconds) on the timers you wish to + retrieve. + default: nil examples: - path: examples/getTimers-1.lua description: This example kills timers with a remaining time of less than 1 minute. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the active timers. + requires_review: true diff --git a/functions/Utility/getUserdataType.yaml b/functions/Utility/getUserdataType.yaml index aac5940d..6fe01875 100644 --- a/functions/Utility/getUserdataType.yaml +++ b/functions/Utility/getUserdataType.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetUserdataType -server: +shared: name: getUserdataType description: This function gets the type of a userdata value, which is not always a [element](/wiki/Element "Element") in the element tree. - parameters: [] + parameters: + - name: value + type: userdata + description: 'A userdata value to get the type of. Userdata types can be: Shared + resource-data : a resource pointer . xml-node : a XML node . lua-timer : a timer + . vector2 : a 2D vector, used in the Vector2 class. vector3 : a 3D vector, used + in the Vector3 class. vector4 : a 4D vector, used in the Vector4 class. matrix + : a matrix, used in the Matrix class. request : a userdata type returned via + fetchRemote (since r21436 ) userdata : a fallback userdata type return value, + when no other type could be found for the object. Server only account : a player + account . db-query : a database query handle . acl : an ACL entry . acl-group + : an ACL group . ban : a player ban . text-item : a text display item . text-display + : a text display item .' examples: - path: examples/getUserdataType-1.lua description: This example shows a function that can be used to work around the impossibility to transfer vectors as arguments when usingtriggerClientEventandtriggerServerEvent, by converting them into a table which can be used safely. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the specified userdata's type, or false + plus an error message if the given value is not userdata. + requires_review: true diff --git a/functions/Utility/getVersion.yaml b/functions/Utility/getVersion.yaml index 812d9965..734c85e9 100644 --- a/functions/Utility/getVersion.yaml +++ b/functions/Utility/getVersion.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVersion -server: +shared: name: getVersion description: This function gives you various version information about MTA and the operating system. @@ -17,6 +17,12 @@ server: which will output version information of your client, whilst the example above outputs information of the server you are connected to. side: client + returns: + values: + - type: table + name: value + description: 'Returns a table with version information. Specifically these keys + are present in the table:' notes: - type: info content: Clientside will return the version from the player, and the server-sided @@ -24,4 +30,4 @@ server: - type: info content: 'Current MTA version: mta -> 1.6 netcode -> 474 number -> 352 sortable -> 1.6.0-9.22279.0 tag -> 1.6-release-22279 type -> Release' - incomplete: true + requires_review: true diff --git a/functions/Utility/gettok.yaml b/functions/Utility/gettok.yaml index 91645551..e73e83ff 100644 --- a/functions/Utility/gettok.yaml +++ b/functions/Utility/gettok.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Gettok -server: +shared: name: gettok description: This function splits a string using the given separating character and returns one specified substring. - parameters: [] + parameters: + - name: text + type: string + description: the string that should be split. + - name: tokenNumber + type: int + description: which token should be returned (1 for the first, 2 for the second, + and so on). + - name: / int separatingCharacter + type: string + description: MISSING_PARAM_DESC examples: - path: examples/gettok-1.lua description: This example retrieves the startskin and endskin for spawning a player from a string of two numbers "a,b" side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the token if it exists, false otherwise. + requires_review: true diff --git a/functions/Utility/hash.yaml b/functions/Utility/hash.yaml index 5dfcc7b8..e2704e52 100644 --- a/functions/Utility/hash.yaml +++ b/functions/Utility/hash.yaml @@ -1,14 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Hash -server: +shared: name: hash description: This function returns a hash of the specified string in the specified algorithm. - parameters: [] + parameters: + - name: algorithm + type: string + description: 'A string which must be one of these: "md5", "sha1", "sha224", "sha256", + "sha384", "sha512", "hmac"' + - name: dataToHash + type: string + description: A string of the data to hash. + - name: options + type: table + description: A table with options and other necessary data for the algorithm, + as detailed below. examples: - path: examples/hash-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the hash of the data, false if an invalid argument was used. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -16,3 +31,4 @@ server: - Missing section: Options for each algorithm ' + requires_review: true diff --git a/functions/Utility/inspect.yaml b/functions/Utility/inspect.yaml index 08adade6..62604f60 100644 --- a/functions/Utility/inspect.yaml +++ b/functions/Utility/inspect.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Inspect -server: +shared: name: inspect description: This function returns human\-readable representations of tables and MTA datatypes as a string. - parameters: [] + parameters: + - name: var + type: mixed + description: A variable of any datatype. + - name: options + type: table + description: A table of options. It is not mandatory, but when it is provided, + it must be a table. For a list of options, see the Inspect's GitHub page . examples: - path: examples/inspect-1.lua description: 'This example draws the contents of a table and its data type:' side: client - incomplete: true + returns: + values: + - type: string + name: value + description: Always returns a string. The contents can change if we update the + inspect library, so it is not expected to be consistent across Lua versions. + requires_review: true diff --git a/functions/Utility/interpolateBetween.yaml b/functions/Utility/interpolateBetween.yaml index 1afe8211..f662280a 100644 --- a/functions/Utility/interpolateBetween.yaml +++ b/functions/Utility/interpolateBetween.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/InterpolateBetween -server: +shared: name: interpolateBetween description: 'Interpolates a 3D Vector between a source value and a target value using either linear interpolation or any other [easing function](/wiki/Easing @@ -7,7 +7,45 @@ server: It can also be used to interpolate 2D vectors or scalars by only setting some of the x, y, z values and putting 0 to the others.' - parameters: [] + parameters: + - name: x1 + type: float + description: MISSING_PARAM_DESC + - name: y1 + type: float + description: MISSING_PARAM_DESC + - name: z1 + type: float + description: MISSING_PARAM_DESC + - name: x2 + type: float + description: MISSING_PARAM_DESC + - name: y2 + type: float + description: MISSING_PARAM_DESC + - name: z2 + type: float + description: MISSING_PARAM_DESC + - name: fProgress + type: float + description: float between 0 and 1 indicating the interpolation progress (0 at + the beginning of the interpolation, 1 at the end). If it is higher than 1, it + will start from the beginning. + - name: strEasingType + type: string + description: the easing function to use for the interpolation + - name: fEasingPeriod + type: float + description: the period of the easing function (only some easing functions use + this parameter) + - name: fEasingAmplitude + type: float + description: the amplitude of the easing function (only some easing functions + use this parameter) + - name: fEasingOvershoot + type: float + description: the overshoot of the easing function (only some easing functions + use this parameter) examples: - path: examples/interpolateBetween-1.lua description: 'This clientside example uses interpolateBetween to create position @@ -38,4 +76,14 @@ server: When the camera pops up it uses "OutQuad" as the strEasingType to create the slow down effect.' side: client - incomplete: true + returns: + values: + - type: float float float + name: value + description: 'Returns x, y, z the interpolated 3D vector/value if successful, + false otherwise (error in parameters). + + As mentioned before, interpolateBetween can be used on 2D vectors or scalars + in which case only some (x, y or just x) of the returned values are to be used + (cf. alpha interpolation in marker example or size interpolation in window example).' + requires_review: true diff --git a/functions/Utility/iprint.yaml b/functions/Utility/iprint.yaml index 2cbc218b..77608057 100644 --- a/functions/Utility/iprint.yaml +++ b/functions/Utility/iprint.yaml @@ -1,15 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Iprint -server: +shared: name: iprint description: This function intelligently outputs debug messages into the Debug Console. It is similar to [outputDebugString](/wiki/OutputDebugString "OutputDebugString"), but outputs useful information for **any** variable type, and does not require use of Lua's tostring. This includes information about element types, and table structures. It is especially useful for quick debug tasks. - parameters: [] + parameters: + - name: var1 + type: mixed + description: A variable of any type to print intelligent information for. + - name: var2 + type: mixed + description: MISSING_PARAM_DESC + - name: var3... + type: mixed + description: MISSING_PARAM_DESC examples: - path: examples/iprint-1.lua description: 'This example prints some sample debug messages, assuming the server is running a typical freeroam/play environment:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns nil . + requires_review: true diff --git a/functions/Utility/isOOPEnabled.yaml b/functions/Utility/isOOPEnabled.yaml index d4daeed3..8900b698 100644 --- a/functions/Utility/isOOPEnabled.yaml +++ b/functions/Utility/isOOPEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsOOPEnabled -server: +shared: name: isOOPEnabled description: This function checks whether *[OOP](/wiki/OOP "OOP")* (Object Oriented Programming) is enabled in the current [resource](/wiki/Resource "Resource") or @@ -9,4 +9,10 @@ server: - path: examples/isOOPEnabled-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true or false if OOP is enabled or not. Returns nil if an + error arised. + requires_review: true diff --git a/functions/Utility/isShowCollisionsEnabled.yaml b/functions/Utility/isShowCollisionsEnabled.yaml index d84b3752..e89a44d4 100644 --- a/functions/Utility/isShowCollisionsEnabled.yaml +++ b/functions/Utility/isShowCollisionsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsShowCollisionsEnabled -client: +shared: name: isShowCollisionsEnabled description: This function gets the collision previews state. parameters: [] @@ -7,7 +7,12 @@ client: - path: examples/isShowCollisionsEnabled-1.lua description: 'You can refer to the example below:' side: client + returns: + values: + - type: bool + name: value + description: 'You can refer to the example below:' notes: - type: info content: This function only works in development mode. - incomplete: true + requires_review: true diff --git a/functions/Utility/isShowSoundEnabled.yaml b/functions/Utility/isShowSoundEnabled.yaml index 1edebfc0..d9c466ee 100644 --- a/functions/Utility/isShowSoundEnabled.yaml +++ b/functions/Utility/isShowSoundEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsShowSoundEnabled -client: +shared: name: isShowSoundEnabled description: This function indicates if world [sound](/wiki/Sound "Sound") IDs should be printed in the debug window or not. @@ -8,7 +8,12 @@ client: - path: examples/isShowSoundEnabled-1.lua description: 'You can refer to the example below:' side: client + returns: + values: + - type: bool + name: value + description: 'You can refer to the example below:' notes: - type: info content: This function only works in development mode. - incomplete: true + requires_review: true diff --git a/functions/Utility/isTimer.yaml b/functions/Utility/isTimer.yaml index ff879efb..919e282c 100644 --- a/functions/Utility/isTimer.yaml +++ b/functions/Utility/isTimer.yaml @@ -1,15 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTimer -server: +shared: name: isTimer description: This function checks if a variable is a [timer](/wiki/Timer "Timer"). - parameters: [] + parameters: + - name: theTimer + type: timer + description: The variable that we want to check. examples: - path: examples/isTimer-1.lua description: This example uses isTimer to prevent players from using chat/teamchat/me more than once a second, to prevent spammers. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the passed value is a timer, false otherwise. + oop: + element: timer + method: isValid + variable: valid + static: false notes: - type: info content: This function is not reliable as timer ids are eventually recycled. Always make sure you nil variables containing a timer after it has expired. - incomplete: true + requires_review: true diff --git a/functions/Utility/isTimerPaused.yaml b/functions/Utility/isTimerPaused.yaml index f91e905f..5548ea41 100644 --- a/functions/Utility/isTimerPaused.yaml +++ b/functions/Utility/isTimerPaused.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTimerPaused -server: +shared: name: isTimerPaused description: This function allows you to check whether a timer is paused. - parameters: [] + parameters: + - name: theTimer + type: timer + description: The timer you wish to check. examples: - path: examples/isTimerPaused-1.lua description: This example pauses all currently running timers and resumes all currently paused timers from this resource. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the timer is currently paused, false if not or if + no such timer existed. + requires_review: true diff --git a/functions/Utility/isTransferBoxAlwaysVisible.yaml b/functions/Utility/isTransferBoxAlwaysVisible.yaml index 87e0332a..3d6b29f5 100644 --- a/functions/Utility/isTransferBoxAlwaysVisible.yaml +++ b/functions/Utility/isTransferBoxAlwaysVisible.yaml @@ -1,9 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTransferBoxAlwaysVisible -client: +shared: name: isTransferBoxAlwaysVisible description: Determines if the transfer box should be always visible during downloads. Players can forcefully show the transfer box through a user setting, even if disabled by scripts. parameters: [] examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a boolean , whether the transfer box should be always visible + or not. + requires_review: true diff --git a/functions/Utility/isTransferBoxVisible.yaml b/functions/Utility/isTransferBoxVisible.yaml index 2e2f82b6..5ad98033 100644 --- a/functions/Utility/isTransferBoxVisible.yaml +++ b/functions/Utility/isTransferBoxVisible.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTransferBoxVisible -server: +shared: name: isTransferBoxVisible description: Determines if the transfer box is visible. parameters: [] @@ -7,4 +7,10 @@ server: - path: examples/isTransferBoxVisible-1.lua description: This example defines a command to remove the player's transfer box. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: On server this returns a boolean, whether the transfer box should + be visible during downloads or not. + requires_review: true diff --git a/functions/Utility/isTrayNotificationEnabled.yaml b/functions/Utility/isTrayNotificationEnabled.yaml index b15e25fe..b9ae3b0f 100644 --- a/functions/Utility/isTrayNotificationEnabled.yaml +++ b/functions/Utility/isTrayNotificationEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTrayNotificationEnabled -client: +shared: name: isTrayNotificationEnabled description: This function returns a boolean value whether the client has enabled tray notifications in his settings or not. @@ -8,4 +8,10 @@ client: - path: examples/isTrayNotificationEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the tray notifications are enabled in the settings, + false otherwise. + requires_review: true diff --git a/functions/Utility/killTimer.yaml b/functions/Utility/killTimer.yaml index 5ba0212d..998fb781 100644 --- a/functions/Utility/killTimer.yaml +++ b/functions/Utility/killTimer.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/KillTimer -server: +shared: name: killTimer description: This function allows you to kill/halt existing timers. - parameters: [] + parameters: + - name: theTimer + type: timer + description: The timer you wish to halt. examples: - path: examples/killTimer-1.lua description: This example kills all timers with a remaining time of less than @@ -11,4 +14,14 @@ server: - path: examples/killTimer-2.lua description: This example checks if the time then kill the timer. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the timer was successfully killed, false if no such + timer existed. + oop: + element: timer + method: destroy + static: false + requires_review: true diff --git a/functions/Utility/md5.yaml b/functions/Utility/md5.yaml index 36fd62b3..9101e35c 100644 --- a/functions/Utility/md5.yaml +++ b/functions/Utility/md5.yaml @@ -1,13 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Md5 -server: +shared: name: md5 description: Calculates the MD5 hash of the specified string and returns its hexadecimal representation. - parameters: [] + parameters: + - name: str + type: string + description: the string to hash. examples: - path: examples/md5-1.lua description: '' side: server + returns: + values: + - type: string + name: value + description: Returns the MD5 hash of the input string if successful, false otherwise. notes: - type: warning content: It is strongly recommended to use passwordHash to hash passwords, md5 @@ -21,4 +29,4 @@ server: present the fact that the script wants to express ownership to a legal entity. This can be used as argument in a court of law or for DRM purposes. You can find the general idea here . - incomplete: true + requires_review: true diff --git a/functions/Utility/passwordHash.yaml b/functions/Utility/passwordHash.yaml index 3a303b7e..737befd5 100644 --- a/functions/Utility/passwordHash.yaml +++ b/functions/Utility/passwordHash.yaml @@ -1,13 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PasswordHash -server: +shared: name: passwordHash description: This function creates a new password hash using a specified hashing algorithm. - parameters: [] + parameters: + - name: password + type: string + description: The password to hash. + - name: algorithm + type: string + description: 'The algorithm to use: bcrypt : use the bcrypt hashing algorithm. + Hash length: 60 characters. Note that only the prefix $2y$ is supported (older + prefixes can cause security issues).' + - name: options + type: table + description: table with options for the hashing algorithm, as detailed below. + - name: callback + type: function + description: providing a callback will run this function asynchronously, the arguments + to the callback are the same as the returned values below. examples: - path: examples/passwordHash-1.lua description: '' side: server + returns: + values: + - type: string + name: value + description: Returns the hash as a string if hashing was successful, false otherwise. + If a callback was provided, the aforementioned values are arguments to the callback, + and this function will always return true . notes: - type: info content: Using passwordHash is the recommended way of storing passwords. @@ -18,7 +40,6 @@ server: - type: warning content: If you will be using "Example 1" then you will have to save account data "hash_password" after server restart, otherwise this script will no longer work. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -26,3 +47,4 @@ server: - Missing section: Options for each hashing algorithm ' + requires_review: true diff --git a/functions/Utility/passwordVerify.yaml b/functions/Utility/passwordVerify.yaml index 5c0e5d84..0caef5ef 100644 --- a/functions/Utility/passwordVerify.yaml +++ b/functions/Utility/passwordVerify.yaml @@ -1,9 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PasswordVerify -server: +shared: name: passwordVerify description: This function verifies whether a password matches a password hash. - parameters: [] + parameters: + - name: password + type: string + description: The password to check. + - name: hash + type: string + description: A supported hash (see passwordHash ). Note that only the prefix $2y$ + is supported for type bcrypt (older prefixes can cause security issues). + - name: options + type: table + description: 'advanced options insecureBcrypt: If set to true , you can use the + $2a$ prefix for bcrypt hashes as well. It is strongly not recommended to use + it though, because the underlying implementation has a bug that leads to such + hashes being relatively easy to crack. This bug was fixed for $2y$ .' + - name: callback + type: function + description: MISSING_PARAM_DESC examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the password matches the hash. Returns false if the + password does not match, or if an unknown hash was passed. If a callback was + provided, the aforementioned values are arguments to the callback, and this + function will always return true . notes: - type: info content: Using passwordHash is the recommended way of storing passwords. @@ -11,4 +35,4 @@ server: content: It is strongly recommended to use the async version of the function (i.e. provide a callback function). Otherwise, you will experience short freezes due to the slow nature of the bcrypt algorithm - incomplete: true + requires_review: true diff --git a/functions/Utility/pregFind.yaml b/functions/Utility/pregFind.yaml index f7442839..8808dc0b 100644 --- a/functions/Utility/pregFind.yaml +++ b/functions/Utility/pregFind.yaml @@ -1,17 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PregFind -server: +shared: name: pregFind description: This function stops at the first occurrence of the pattern in the input string and returns the result of the search. - parameters: [] + parameters: + - name: subject + type: string + description: The input string + - name: pattern + type: string + description: The pattern string to search for in the input string . + - name: flags + type: int/string + description: Conjuncted value that contains flags ( 1 - ignorecase, 2 - multiline, + 4 - dotall, 8 - extended, 16 - unicode ) or ( i - Ignore case, m - Multiline, + d - Dotall, e - Extended, u - Unicode ) examples: - path: examples/pregFind-1.lua description: 'Some examples:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the pattern was found in the input string, false + otherwise. notes: - type: warning content: When declaring a pattern string in quotes, the backslash character should be doubled up. e.g. "\\(" will match a single bracket. - type: warning content: Multiline flag does not work correctly - incomplete: true + requires_review: true diff --git a/functions/Utility/pregMatch.yaml b/functions/Utility/pregMatch.yaml index 8e23a328..e10dfa87 100644 --- a/functions/Utility/pregMatch.yaml +++ b/functions/Utility/pregMatch.yaml @@ -1,16 +1,37 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PregMatch -server: +shared: name: pregMatch description: This function returns all matches. - parameters: [] + parameters: + - name: base + type: string + description: The base string for replace. + - name: pattern + type: string + description: The pattern for match in base string. + - name: flags + type: int/string + description: Conjuncted value that contains flags ( 1 - ignorecase, 2 - multiline, + 4 - dotall, 8 - extended, 16 - unicode ) or ( i - Ignore case, m - Multiline, + d - Dotall, e - Extended, u - Unicode ) + default: '0' + - name: maxResults + type: int + description: Maximum number of results to return + default: '100000' examples: - path: examples/pregMatch-1.lua description: 'Some examples:' side: server + returns: + values: + - type: table + name: value + description: Returns a table if one or more match is found, false otherwise. notes: - type: warning content: When declaring a pattern string in quotes, the backslash character should be doubled up. e.g. "\\(" will match a single bracket. - type: warning content: Multiline flag does not work correctly - incomplete: true + requires_review: true diff --git a/functions/Utility/pregReplace.yaml b/functions/Utility/pregReplace.yaml index 94e4ed56..00859bd9 100644 --- a/functions/Utility/pregReplace.yaml +++ b/functions/Utility/pregReplace.yaml @@ -1,13 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/PregReplace -server: +shared: name: pregReplace description: This function performs a regular expression search and replace and returns the replaced string. - parameters: [] + parameters: + - name: subject + type: string + description: The input string . + - name: pattern + type: string + description: The pattern string to search for in the input string . + - name: replacement + type: string + description: The replacement string to replace all matches within the input string + . + - name: flags + type: int/string + description: Conjuncted value that contains flags ( 1 - ignorecase, 2 - multiline, + 4 - dotall, 8 - extended, 16 - unicode ) or ( i - Ignore case, m - Multiline, + d - Dotall, e - Extended, u - Unicode ) examples: - path: examples/pregReplace-1.lua description: 'Some examples:' side: server + returns: + values: + - type: string + name: value + description: Returns the replaced string , or bool false otherwise. notes: - type: warning content: When declaring a pattern string in quotes, the backslash character should @@ -15,4 +35,4 @@ server: the replacement string. - type: warning content: Multiline flag does not work correctly - incomplete: true + requires_review: true diff --git a/functions/Utility/ref.yaml b/functions/Utility/ref.yaml index bf384695..1302785e 100644 --- a/functions/Utility/ref.yaml +++ b/functions/Utility/ref.yaml @@ -1,9 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Ref -server: +shared: name: ref description: This function will create a reference to the given argument. - parameters: [] + parameters: + - name: objectToReference + type: mixed + description: MISSING_PARAM_DESC examples: [] + returns: + values: + - type: int + name: value + description: Returns an int if the reference were successfully created. Returns + false if the parameter were invalid. notes: - type: info content: This function was originally created to prevent garbage-collection of @@ -12,4 +21,4 @@ server: the debug.getregistry function. Since at the moment MTA does not make use of advanced garbage-collector semantics, this function serves little purpose other than leak memory! - incomplete: true + requires_review: true diff --git a/functions/Utility/removeDebugHook.yaml b/functions/Utility/removeDebugHook.yaml index 68596078..c6ecb560 100644 --- a/functions/Utility/removeDebugHook.yaml +++ b/functions/Utility/removeDebugHook.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveDebugHook -server: +shared: name: removeDebugHook description: This function removes hooks added by [addDebugHook](/wiki/AddDebugHook "AddDebugHook") - parameters: [] + parameters: + - name: hookType + type: string + description: 'The type of hook to remove. This can be: preEvent postEvent preFunction + postFunction' + - name: callbackFunction + type: function + description: MISSING_PARAM_DESC examples: - path: examples/removeDebugHook-1.lua description: 'This example adds a hook, then removes it:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the hook was successfully removed, or false otherwise. + requires_review: true diff --git a/functions/Utility/resetTimer.yaml b/functions/Utility/resetTimer.yaml index 9cbc98e7..47c808e2 100644 --- a/functions/Utility/resetTimer.yaml +++ b/functions/Utility/resetTimer.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetTimer -server: +shared: name: resetTimer description: This function allows you to reset the value of the elapsed time in existing timers. The function resets the "execution time" value for timers with a limited number of repetitions. - parameters: [] + parameters: + - name: theTimer + type: timer + description: The timer whose elapsed time you wish to reset. examples: - path: examples/resetTimer-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the timer was successfully reset, false otherwise. + oop: + element: timer + method: reset + static: false + requires_review: true diff --git a/functions/Utility/setClipboard.yaml b/functions/Utility/setClipboard.yaml index 692d7e03..02e22632 100644 --- a/functions/Utility/setClipboard.yaml +++ b/functions/Utility/setClipboard.yaml @@ -1,9 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetClipboard -client: +shared: name: setClipboard description: This function sets the players clipboard text (what appears when you paste with CTRL \+ V) - parameters: [] + parameters: + - name: theText + type: string + description: The new text to be in the players clipboard when the player pastes + with CTRL + V. examples: - path: examples/setClipboard-1.lua description: This example adds a command called clipboard which lets you set your @@ -13,4 +17,9 @@ client: description: This example is to allow you to copy the words that are written in edit box side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the text in the clip board was set correctly. + requires_review: true diff --git a/functions/Utility/setDevelopmentMode.yaml b/functions/Utility/setDevelopmentMode.yaml index a0468013..201cd597 100644 --- a/functions/Utility/setDevelopmentMode.yaml +++ b/functions/Utility/setDevelopmentMode.yaml @@ -1,17 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetDevelopmentMode -server: +shared: name: setDevelopmentMode description: This function is used to set the development mode. Setting development mode allows access to special commands which can assist with script debugging. - parameters: [] + parameters: + - name: enable + type: bool + description: A boolean to indicate whether development mode is on ( true ) or + off ( false ) + - name: enableWeb + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setDevelopmentMode-1.lua description: Example 1:This example would set the development mode of the client. Use /showcol [<0-1>] and /showsound [<0-1>] later to enable/disable respective functions. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the mode was set correctly, false otherwise. notes: - type: info content: Enabling development mode on the server side does not enable it on the client side. These functions work independently on both sides - incomplete: true + requires_review: true diff --git a/functions/Utility/setFPSLimit.yaml b/functions/Utility/setFPSLimit.yaml index 21297f09..3c7cc6fe 100644 --- a/functions/Utility/setFPSLimit.yaml +++ b/functions/Utility/setFPSLimit.yaml @@ -1,19 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetFPSLimit -server: +shared: name: setFPSLimit description: This function sets the maximum [FPS (Frames per second)](http://en.wikipedia.org/wiki/Frame_rate) that players on the server can run their game at. - parameters: [] + parameters: + - name: fpsLimit + type: int + description: An integer value representing the maximum FPS. Refer to the note + above for possible values. You can also pass 0 or false , in which case the + FPS limit will be the one set in the client settings (by default 100 FPS and + the client fps limit should also be manually changed via " fps_limit=0 " in + console or MTA San Andreas\MTA\config\coreconfig.xml ). examples: - path: examples/setFPSLimit-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, or false if it was not possible to set + the limit or an invalid value was passed. notes: - type: info content: When set client side, the actual limit used is the lowest of both the server and client set values. Starting from version [ r21313 ] and above fpsLimit range is 25-32767 . In older MTA releases it was 25-100 . - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -23,3 +35,4 @@ server: - Missing section: Fix for climbing over certain objects ' + requires_review: true diff --git a/functions/Utility/setTimer.yaml b/functions/Utility/setTimer.yaml index 12a2b436..91c85004 100644 --- a/functions/Utility/setTimer.yaml +++ b/functions/Utility/setTimer.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTimer -server: +shared: name: setTimer description: This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built\-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed. - parameters: [] + parameters: + - name: theFunction + type: function + description: The function you wish the timer to call. + - name: timeInterval + type: int + description: MISSING_PARAM_DESC + - name: timesToExecute + type: int + description: MISSING_PARAM_DESC + - name: arguments... + type: var + description: MISSING_PARAM_DESC examples: - path: examples/setTimer-1.lua description: This example will output some text after a small delay. @@ -23,6 +35,15 @@ server: description: This example should send a global message about the death of a player on a random time. I usedmath.roundin this example to give a nicer output. side: server + returns: + values: + - type: timer + name: value + description: Returns a timer pointer if the timer was set successfully, false + if the arguments are invalid or the timer could not be set. + oop: + element: timer + constructorclass: Timer notes: - type: info content: The hidden global variable sourceTimer contains the currently executing @@ -37,4 +58,4 @@ server: - type: important content: Writing the following code can cause performance issues. Use onClientPreRender instead. setTimer(theFunction, 0, 0) - incomplete: true + requires_review: true diff --git a/functions/Utility/setTimerPaused.yaml b/functions/Utility/setTimerPaused.yaml index 131d8192..8cae673d 100644 --- a/functions/Utility/setTimerPaused.yaml +++ b/functions/Utility/setTimerPaused.yaml @@ -1,10 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTimerPaused -server: +shared: name: setTimerPaused description: This function is used to either pause or resume a timer. - parameters: [] + parameters: + - name: theTimer + type: timer + description: The timer you wish to pause or resume. + - name: paused + type: bool + description: a boolean value representing whether the timer should be paused or + not. To pause the timer, use true . examples: - path: examples/setTimerPaused-1.lua description: This example pauses all current timers from this resource. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the timer was successfully paused or resumed, false + if no such timer existed. + requires_review: true diff --git a/functions/Utility/setTransferBoxVisible.yaml b/functions/Utility/setTransferBoxVisible.yaml index 680c0093..6d48d356 100644 --- a/functions/Utility/setTransferBoxVisible.yaml +++ b/functions/Utility/setTransferBoxVisible.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTransferBoxVisible -server: +shared: name: setTransferBoxVisible description: Determines whether or not the transfer box should appear to [players](/wiki/Player "Player"). - parameters: [] + parameters: + - name: visible + type: bool + description: The new transfer box visibility state. examples: - path: examples/setTransferBoxVisible-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the visibility was set successfully, false otherwise. + requires_review: true diff --git a/functions/Utility/setWindowFlashing.yaml b/functions/Utility/setWindowFlashing.yaml index 6401d9d7..e2d5f0d7 100644 --- a/functions/Utility/setWindowFlashing.yaml +++ b/functions/Utility/setWindowFlashing.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWindowFlashing -client: +shared: name: setWindowFlashing description: This function allows the window to flash in the Windows taskbar. - parameters: [] + parameters: + - name: shouldFlash + type: bool + description: whether the window should flash + - name: count + type: int + description: the number of times the window should flash, defaults to 10 times + default: '10' examples: - path: examples/setWindowFlashing-1.lua description: A command that allows the player to flash their window three times @@ -12,4 +19,9 @@ client: description: A command that allows the player to flash their window after a certain period of time for a certain count. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: 'Returns false if:' + requires_review: true diff --git a/functions/Utility/sha256.yaml b/functions/Utility/sha256.yaml index 741499fd..cbeb3f03 100644 --- a/functions/Utility/sha256.yaml +++ b/functions/Utility/sha256.yaml @@ -1,16 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Sha256 -server: +shared: name: sha256 description: Calculates the sha256 hash of the specified string. - parameters: [] + parameters: + - name: str + type: string + description: the string to hash. examples: - path: examples/sha256-1.lua description: '' side: server + returns: + values: + - type: string + name: value + description: Returns the sha256 hash of the input string if successful, false + otherwise. notes: - type: tip content: The sha module and this function may conflict with eachother, if you use this function uninstall the module! This function returns an uppercase string, so make sure you string.upper() anything else you are checking against that has been sha256'd elsewhere. - incomplete: true + requires_review: true diff --git a/functions/Utility/showCol.yaml b/functions/Utility/showCol.yaml index b602ffcb..fcdf4195 100644 --- a/functions/Utility/showCol.yaml +++ b/functions/Utility/showCol.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ShowCol -client: +shared: name: showCol description: Shows collision previews for developers ([colshapes](/wiki/Colshape "Colshape") in wireframe, useful when writing scripts). - parameters: [] + parameters: + - name: state + type: bool + description: A boolean indicating if the collision previews should be enabled + or disabled. examples: - path: examples/showCol-1.lua description: 'You can refer to the example below:' side: client + returns: + values: + - type: bool + name: value + description: 'You can refer to the example below:' notes: - type: info content: This function only works in development mode. - incomplete: true + requires_review: true diff --git a/functions/Utility/showSound.yaml b/functions/Utility/showSound.yaml index 6f339356..a8849639 100644 --- a/functions/Utility/showSound.yaml +++ b/functions/Utility/showSound.yaml @@ -1,15 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ShowSound -client: +shared: name: showSound description: Prints world [sound](/wiki/Sound "Sound") IDs in the debug output window to help when writing scripts with [setWorldSoundEnabled](/wiki/SetWorldSoundEnabled "SetWorldSoundEnabled"). - parameters: [] + parameters: + - name: state + type: bool + description: A boolean indicating if the world sound IDs should be printed in + the debug window or not. examples: - path: examples/showSound-1.lua description: 'You can refer to the example below:' side: client + returns: + values: + - type: bool + name: value + description: 'You can refer to the example below:' notes: - type: info content: This function only works in development mode. - incomplete: true + requires_review: true diff --git a/functions/Utility/split.yaml b/functions/Utility/split.yaml index 5e924267..eabf4b39 100644 --- a/functions/Utility/split.yaml +++ b/functions/Utility/split.yaml @@ -1,21 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Split -server: +shared: name: split description: This function splits a string into substrings. You specify a character that will act as a separating character; this will determine where to split the sub\-strings. For example, it can split the string "Hello World" into two strings containing the two words, by spliting using a space as a separator. - parameters: [] + parameters: + - name: stringToSplit + type: string + description: '' + - name: / int separatingChar + type: string + description: MISSING_PARAM_DESC examples: - path: examples/split-1.lua description: 'This example gives the specified weapons to the given player, while the weapons are a string in the form: ''weaponId,ammo;weaponId2,ammo2;weaponId3,ammo3;..''. This is especially for data read from a .map file attribute.' side: server + returns: + values: + - type: table + name: value + description: Returns a table of substrings split from the original string if successful, + false otherwise. notes: - type: info content: 'Unicode characters work but when combined with others do not. E.g: #split("a€cb†", "€") returns 3 but #split("a€cb", "€") returns 2.' - type: info content: 'You can''t use same char twice as a separator. Eg.:' - incomplete: true + requires_review: true diff --git a/functions/Utility/teaDecode.yaml b/functions/Utility/teaDecode.yaml index 54decd41..58bae1b6 100644 --- a/functions/Utility/teaDecode.yaml +++ b/functions/Utility/teaDecode.yaml @@ -1,18 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TeaDecode -server: +shared: name: teaDecode description: This function decrypts given [base64](https://en.wikipedia.org/wiki/Base64) representation of encrypted data using the [Tiny Encryption Algorithm](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm). - parameters: [] + parameters: + - name: data + type: string + description: The block of data you want to decrypt + - name: key + type: string + description: The key that should be used for decryption (Only first 16 characters + are used) examples: - path: examples/teaDecode-1.lua description: This example creates a /teadecrypt command, which reverts the TEA on a given string with the specified key. side: client + returns: + values: + - type: string + name: value + description: Returns string containing the decrypted data if the decryption process + was successfully completed, false otherwise. notes: - type: important content: Use decodeString instead, because teaEncode inflates the file size by as high as ~77% (or by ~33% if the input isn't binary converted to base64 string). - type: important content: teaDecode cannot handle binary data. - incomplete: true + requires_review: true diff --git a/functions/Utility/teaEncode.yaml b/functions/Utility/teaEncode.yaml index 0f0f6be8..583b8d39 100644 --- a/functions/Utility/teaEncode.yaml +++ b/functions/Utility/teaEncode.yaml @@ -1,17 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TeaEncode -server: +shared: name: teaEncode description: This functions performs the [Tiny Encryption Algorithm](https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm) on the given string and returns the [base64](https://en.wikipedia.org/wiki/Base64) representation of the encrypted string. - parameters: [] + parameters: + - name: text + type: string + description: The string you want to encrypt. (See second example if you want to + encode binary data) + - name: key + type: string + description: The key that should be used for encryption (Only first 16 characters + are used) examples: - path: examples/teaEncode-1.lua description: This example creates a /teaencrypt command, which performs the TEA on a given string with the specified key, if any. side: client + returns: + values: + - type: string + name: value + description: Returns the base64 representation of the encrypted string if the + encryption process was successfully completed, false otherwise. notes: - type: important content: Use encodeString instead, because teaEncode inflates the file size by as high as ~77% (or by ~33% if the input isn't binary converted to base64 string). - incomplete: true + requires_review: true diff --git a/functions/Utility/toJSON.yaml b/functions/Utility/toJSON.yaml index 7b8b3e60..349714d0 100644 --- a/functions/Utility/toJSON.yaml +++ b/functions/Utility/toJSON.yaml @@ -1,16 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ToJSON -server: +shared: name: toJSON description: This function converts a **single** value (preferably a Lua table) into a [JSON](/wiki/JSON "JSON") encoded string. You can use this to store the data and then load it again using [fromJSON](/wiki/FromJSON "FromJSON"). - parameters: [] + parameters: + - name: value + type: var + description: MISSING_PARAM_DESC + - name: compact + type: bool + description: a boolean representing whether the string will contain whitespaces. + To remove whitespaces from JSON string, use true . String will contain whitespaces + per default. + default: 'false' + - name: prettyType + type: string + description: MISSING_PARAM_DESC + default: '"none"' examples: - path: examples/toJSON-1.lua description: 'This example shows how you can encode an array. The string json should equal"[ { "1": "dogs", "mouse": "food", "cat": "hungry", "birds": 4 } ]" after executed.' side: server + returns: + values: + - type: string + name: value + description: Returns a JSON formatted string. notes: - type: warning content: When using toJSON for submitting data using fetchRemote for example, @@ -19,4 +37,4 @@ server: - type: important content: Due to technical limitations (partly of json-c) the stringified keys will be truncated to the first 255 characters - incomplete: true + requires_review: true diff --git a/functions/Utility/tocolor.yaml b/functions/Utility/tocolor.yaml index c9160f20..6b72497f 100644 --- a/functions/Utility/tocolor.yaml +++ b/functions/Utility/tocolor.yaml @@ -1,14 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/Tocolor -server: +shared: name: tocolor description: 'This function retrieves the hex number of a specified color, useful for the dx functions. Added server\-side.' - parameters: [] + parameters: + - name: red + type: int + description: The amount of red in the color (0-255). + - name: green + type: int + description: The amount of green in the color (0-255). + - name: blue + type: int + description: The amount of blue in the color (0-255). + - name: alpha + type: int + description: The amount of alpha in the color (0-255). + default: '255' examples: - path: examples/tocolor-1.lua description: This example displays the text "Tuna" in small at the top left side of your screen. The color of this text can be changed using the command /tunaColor. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns a single value representing the color. + requires_review: true diff --git a/functions/Utility/utfChar.yaml b/functions/Utility/utfChar.yaml index e29d0966..33201704 100644 --- a/functions/Utility/utfChar.yaml +++ b/functions/Utility/utfChar.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UtfChar -server: +shared: name: utfChar description: The function returns the string of the specified UTF code. - parameters: [] + parameters: + - name: characterCode + type: int + description: The UTF code, to get the string of. examples: - path: examples/utfChar-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Utility/utfCode.yaml b/functions/Utility/utfCode.yaml index 56cfe617..5efe66c9 100644 --- a/functions/Utility/utfCode.yaml +++ b/functions/Utility/utfCode.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UtfCode -server: +shared: name: utfCode description: The function returns the UTF codes of the given string. - parameters: [] + parameters: + - name: theString + type: string + description: The string to get the UTF code of. examples: - path: examples/utfCode-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Utility/utfLen.yaml b/functions/Utility/utfLen.yaml index 82635d11..c708097b 100644 --- a/functions/Utility/utfLen.yaml +++ b/functions/Utility/utfLen.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UtfLen -server: +shared: name: utfLen description: The function gets the real length of a string, in characters. - parameters: [] + parameters: + - name: theString + type: string + description: The string to get the length of. examples: - path: examples/utfLen-1.lua description: This example adds a commandrussian_text_lengthwhich prints out a length russian text. side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Utility/utfSeek.yaml b/functions/Utility/utfSeek.yaml index d74f4b76..c333590e 100644 --- a/functions/Utility/utfSeek.yaml +++ b/functions/Utility/utfSeek.yaml @@ -1,10 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UtfSeek -server: +shared: name: utfSeek description: The function returns the byte position at specified character position. - parameters: [] + parameters: + - name: theString + type: string + description: The string . + - name: position + type: int + description: An int with the specified character position. examples: - path: examples/utfSeek-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Utility/utfSub.yaml b/functions/Utility/utfSub.yaml index dbcf1aeb..91c9dc76 100644 --- a/functions/Utility/utfSub.yaml +++ b/functions/Utility/utfSub.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/UtfSub -server: +shared: name: utfSub description: The function returns a sub string, from the specified positions on a character. - parameters: [] + parameters: + - name: theString + type: string + description: The string . + - name: Start + type: int + description: An int with the start position. + - name: End + type: int + description: An int with the end position. examples: - path: examples/utfSub-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string if the function was successful, false otherwise. + requires_review: true diff --git a/functions/Vehicle/addVehicleSirens.yaml b/functions/Vehicle/addVehicleSirens.yaml index 2e345c8b..efdc50ac 100644 --- a/functions/Vehicle/addVehicleSirens.yaml +++ b/functions/Vehicle/addVehicleSirens.yaml @@ -1,11 +1,47 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddVehicleSirens -server: +shared: name: addVehicleSirens description: This function adds sirens to a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to add sirens + - name: sirenCount + type: int + description: The amount of siren points on the vehicle (8 maximum) + - name: sirenType + type: int + description: 'An integer between 1 and 6 (1: invisible, 2: single, 3+: dual)' + - name: flag360 + type: bool + description: Visible from all directions (applies to single type only) + default: 'false' + - name: checkLosFlag + type: bool + description: Check line of sight between camera and light so it won't draw if + blocked + default: 'true' + - name: useRandomiser + type: bool + description: Randomise the light order, false for sequential + default: 'true' + - name: silentFlag + type: bool + description: If you want the siren to be silent set this to true + default: 'false' examples: - path: examples/addVehicleSirens-1.lua description: This example adds a siren for the vehicle, then sets two custom sirens at the top of the vehicle. And then removes the siren when getting out the vehicle. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sirens were successfully added to the vehicle, false + otherwise. + oop: + element: vehicle + method: addSirens + static: false + requires_review: true diff --git a/functions/Vehicle/addVehicleUpgrade.yaml b/functions/Vehicle/addVehicleUpgrade.yaml index a9217e96..cee6296c 100644 --- a/functions/Vehicle/addVehicleUpgrade.yaml +++ b/functions/Vehicle/addVehicleUpgrade.yaml @@ -1,9 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AddVehicleUpgrade -server: +shared: name: addVehicleUpgrade description: This function adds an upgrade to a [vehicle](/wiki/Vehicle "Vehicle"), e.g. nitrous, hydraulics. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The element representing the vehicle you wish to add the upgrade + to. + - name: upgrade + type: string/int + description: 'The id of the upgrade you wish to add: 1000 to 1193 ( see Vehicle + Upgrades ) or " all" to add all upgrades.' examples: - path: examples/addVehicleUpgrade-1.lua description: 'This serverside function allows the user to get an upgrade by typing @@ -13,4 +21,14 @@ server: description: 'This client-side script gives vehicles a nitro upgrade whenever they pass through a certain collision shape:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the upgrade was successfully added to the vehicle, + otherwise false . + oop: + element: vehicle + method: addUpgrade + static: false + requires_review: true diff --git a/functions/Vehicle/areVehicleLightsOn.yaml b/functions/Vehicle/areVehicleLightsOn.yaml index a7e9d09d..49e83c1e 100644 --- a/functions/Vehicle/areVehicleLightsOn.yaml +++ b/functions/Vehicle/areVehicleLightsOn.yaml @@ -1,18 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AreVehicleLightsOn -client: +shared: name: areVehicleLightsOn description: This function is used to find out whether the lights of the vehicle are on. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to retrieve the lights state of. examples: - path: examples/areVehicleLightsOn-1.lua description: This example checks if your vehicle lights are on/off and tells you the reason side: client + returns: + values: + - type: bool + name: value + description: Returns true if the lights are on, false otherwise. + oop: + element: vehicle + method: areLightsOn + variable: lightsOn + static: false notes: - type: info content: This is different to getVehicleOverrideLights because this function will return true if the lights were turned on by natural causes. Unless setVehicleOverrideLights is used, vehicles always automatically disable their lights at 06:25 and enable them at 20:26. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/attachTrailerToVehicle.yaml b/functions/Vehicle/attachTrailerToVehicle.yaml index 4ba57329..ee981029 100644 --- a/functions/Vehicle/attachTrailerToVehicle.yaml +++ b/functions/Vehicle/attachTrailerToVehicle.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AttachTrailerToVehicle -server: +shared: name: attachTrailerToVehicle description: This function attaches a trailer type vehicle to a trailer\-towing\-type vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to attach a trailer to. + - name: theTrailer + type: vehicle + description: the trailer you wish to be attached. examples: - path: examples/attachTrailerToVehicle-1.lua description: This example will create a trailer and a trailer tower, then attach them. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's were successfully attached, false otherwise. + oop: + element: vehicle + method: attachTrailer + static: false + requires_review: true diff --git a/functions/Vehicle/blowVehicle.yaml b/functions/Vehicle/blowVehicle.yaml index 9e0efcbf..6d851993 100644 --- a/functions/Vehicle/blowVehicle.yaml +++ b/functions/Vehicle/blowVehicle.yaml @@ -1,9 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/BlowVehicle +client: + name: blowVehicle + description: This function will blow up a vehicle. This will cause an explosion + and will kill the driver and any passengers inside it. + parameters: + - name: vehicleToBlow + type: vehicle + description: the vehicle that you wish to blow up. + examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was blown up, false if invalid arguments + were passed to the function. + oop: &id001 + element: vehicle + method: blow + variable: blown + static: false + pair: isVehicleBlown + meta: + - needs_checking: 'This function was partially migrated from the old wiki. Please + review manually: + + - Missing section: Client Class Example + + ' + requires_review: true server: name: blowVehicle description: This function will blow up a vehicle. This will cause an explosion and will kill the driver and any passengers inside it. - parameters: [] + parameters: + - name: vehicleToBlow + type: vehicle + description: the vehicle that you wish to blow up. + - name: explode + type: bool + description: if this argument is true then the vehicle will explode, otherwise + it will just be blown up silently. + default: 'true' examples: - path: examples/blowVehicle-1.lua description: This example will blow up every vehicle in the game. @@ -12,8 +49,14 @@ server: description: This example will blow a player's vehicle when he enters the car, like a carbomb. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was blown up, false if invalid arguments + were passed to the function. + oop: *id001 pair: isVehicleBlown - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -21,3 +64,4 @@ server: - Missing section: Client Class Example ' + requires_review: true diff --git a/functions/Vehicle/createVehicle.yaml b/functions/Vehicle/createVehicle.yaml index 6ea180b1..51774f8d 100644 --- a/functions/Vehicle/createVehicle.yaml +++ b/functions/Vehicle/createVehicle.yaml @@ -1,8 +1,50 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateVehicle -server: +shared: name: createVehicle description: This function creates a vehicle at the specified location. - parameters: [] + parameters: + - name: model + type: int + description: The vehicle ID of the vehicle being created. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rx + type: float + description: A floating point number representing the rotation about the X axis + in degrees. + - name: ry + type: float + description: A floating point number representing the rotation about the Y axis + in degrees. + - name: rz + type: float + description: A floating point number representing the rotation about the Z axis + in degrees. + - name: numberplate + type: string + description: A string that will go on the number plate of the vehicle (max 8 characters). + - name: bDirection + type: bool + description: Placeholder boolean which provides backward compatibility with some + scripts. It never had any effect, but it is read by the code. It is recommended + to ignore this argument, passing false or the variant1 argument in its place. + - name: variant1 + type: int + description: MISSING_PARAM_DESC + - name: variant2 + type: int + description: MISSING_PARAM_DESC + - name: synced + type: bool + description: MISSING_PARAM_DESC + default: 'true' examples: - path: examples/createVehicle-1.lua description: This example creates a 'vehicle spawner' marker that gives the player @@ -27,6 +69,15 @@ server: description: This script will create an Infernus at the center (0, 0, 3) of San Andreas upon execution. side: server + returns: + values: + - type: vehicle + name: value + description: Returns the vehicle element that was created. Returns false if the + arguments are incorrect, or if the vehicle limit of 65535 is exceeded. + oop: + element: vehicle + constructorclass: Vehicle notes: - type: info content: Vehicles (and other elements) created client-side are only seen by the @@ -36,7 +87,6 @@ server: content: Due to how GTA works, creating a lot of vehicles in the same place will cause lag. The more geometries and unique textures has model the bigger the lag is. Even a lot of default vehicles will cause lag if in the same place. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -44,3 +94,4 @@ server: - Missing section: Using trains ' + requires_review: true diff --git a/functions/Vehicle/detachTrailerFromVehicle.yaml b/functions/Vehicle/detachTrailerFromVehicle.yaml index f46d9dfc..e02f0b62 100644 --- a/functions/Vehicle/detachTrailerFromVehicle.yaml +++ b/functions/Vehicle/detachTrailerFromVehicle.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/DetachTrailerFromVehicle -server: +shared: name: detachTrailerFromVehicle description: This function detaches an already attached trailer from a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to detach a trailer from. + - name: theTrailer + type: vehicle + description: The trailer you wish to be detached. + default: nil examples: - path: examples/detachTrailerFromVehicle-1.lua description: 'Example 1:A command for players to detach a trailer attached to @@ -12,8 +19,18 @@ server: description: 'Example 2:This example attaches a trailer to a truck, and detaches it if the trailer is damaged:' side: server + returns: + values: + - type: bool + name: value + description: Returns 'true' if the vehicle's were successfully detached, 'false' + otherwise. + oop: + element: vehicle + method: detachTrailer + static: false notes: - type: info content: If 'theTrailer' is specified, it will only detach if this matches. If it is not specified, any trailer attached to 'theVehicle' will be detached. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/fixVehicle.yaml b/functions/Vehicle/fixVehicle.yaml index fb29677f..ddf39ff8 100644 --- a/functions/Vehicle/fixVehicle.yaml +++ b/functions/Vehicle/fixVehicle.yaml @@ -1,13 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FixVehicle -server: +shared: name: fixVehicle description: This function will set a [vehicle](/wiki/Vehicle "Vehicle")'s health to full and fix its damage model. If you wish to only change the vehicle's health, without affecting its damage model, use [setElementHealth](/wiki/SetElementHealth "SetElementHealth"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to fix examples: - path: examples/fixVehicle-1.lua description: This example fixes all the vehicles that exist in the map. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was fixed, false if theVehicle is invalid. + oop: + element: vehicle + method: fix + static: false + requires_review: true diff --git a/functions/Vehicle/getHeliBladeCollisionsEnabled.yaml b/functions/Vehicle/getHeliBladeCollisionsEnabled.yaml index 07f019ae..1aafd354 100644 --- a/functions/Vehicle/getHeliBladeCollisionsEnabled.yaml +++ b/functions/Vehicle/getHeliBladeCollisionsEnabled.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetHeliBladeCollisionsEnabled -client: +shared: name: getHeliBladeCollisionsEnabled description: This function gets the state of the helicopter blades collisions on the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that will be checked. examples: - path: examples/getHeliBladeCollisionsEnabled-1.lua description: This example shows the blade collisions state side: client + returns: + values: + - type: bool + name: value + description: Returns true if the collisions are enabled for specified vehicle, + false if the collisions aren't enabled for the specified vehicle, if the vehicle + is not a helicopter or if invalid arguments are specified. + oop: + element: vehicle + method: areHeliBladeCollisionsEnabled + variable: heliBladeCollisionsEnabled + static: false pair: setHeliBladeCollisionsEnabled - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getModelHandling.yaml b/functions/Vehicle/getModelHandling.yaml index 24e1eb83..83a93355 100644 --- a/functions/Vehicle/getModelHandling.yaml +++ b/functions/Vehicle/getModelHandling.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetModelHandling -server: +shared: name: getModelHandling description: This function returns a table containing the handling data of the specified vehicle model. - parameters: [] + parameters: + - name: modelId + type: int + description: the vehicle model you wish to get the handling data of. examples: - path: examples/getModelHandling-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table containing all the handling data, false if an invalid + vehicle model is specified. Here is a list of valid table properties and what + they return:' + requires_review: true diff --git a/functions/Vehicle/getOriginalHandling.yaml b/functions/Vehicle/getOriginalHandling.yaml index 46b44616..5644e6bd 100644 --- a/functions/Vehicle/getOriginalHandling.yaml +++ b/functions/Vehicle/getOriginalHandling.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetOriginalHandling -server: +shared: name: getOriginalHandling description: This function returns a table of the original vehicle handling. Use [getVehicleHandling](/wiki/GetVehicleHandling "GetVehicleHandling") if you wish to get the current handling of a vehicle, or [getModelHandling](/wiki/GetModelHandling "GetModelHandling") for a specific vehicle model. - parameters: [] + parameters: + - name: modelID + type: int + description: The vehicle ID you wish to get the original handling from. examples: - path: examples/getOriginalHandling-1.lua description: This example creates a new function called getVehicleOriginalProperty, which simulates the previous syntax of this function. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table containing all the handling data, false otherwise. + Here a list of valid table properties and what they return:' + requires_review: true diff --git a/functions/Vehicle/getTrainDirection.yaml b/functions/Vehicle/getTrainDirection.yaml index fec8fc70..57f10198 100644 --- a/functions/Vehicle/getTrainDirection.yaml +++ b/functions/Vehicle/getTrainDirection.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTrainDirection -server: +shared: name: getTrainDirection description: Gets the direction in which a train is driving (clockwise or counterclockwise). - parameters: [] + parameters: + - name: train + type: vehicle + description: the train of which to get the driving direction. examples: - path: examples/getTrainDirection-1.lua description: This example outputs to the player the direction the train they're driving is travelling. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the train is driving clockwise on the train track, + false if it is going counterclockwise or a failure occured. + oop: + element: vehicle + method: getDirection + variable: direction + static: false pair: setTrainDirection - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getTrainPosition.yaml b/functions/Vehicle/getTrainPosition.yaml index fc81bf17..823ca056 100644 --- a/functions/Vehicle/getTrainPosition.yaml +++ b/functions/Vehicle/getTrainPosition.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTrainPosition -server: +shared: name: getTrainPosition description: Gets the position the train is currently on the track - parameters: [] + parameters: + - name: train + type: vehicle + description: the train to get the position of examples: - path: examples/getTrainPosition-1.lua description: This example adds a command called "/getpos", allowing you to get the position of the train. side: server + returns: + values: + - type: float + name: value + description: Returns a float that represents how along the track it is, false + if there is problem with train element. + oop: + element: vehicle + method: getTrainPosition + variable: trainPosition + static: false pair: setTrainPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getTrainSpeed.yaml b/functions/Vehicle/getTrainSpeed.yaml index a2195d2a..b0b286d5 100644 --- a/functions/Vehicle/getTrainSpeed.yaml +++ b/functions/Vehicle/getTrainSpeed.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTrainSpeed -server: +shared: name: getTrainSpeed description: Gets the speed at which a train is traveling on the rails. - parameters: [] + parameters: + - name: train + type: vehicle + description: the train of which to retrieve the speed. examples: - path: examples/getTrainSpeed-1.lua description: This example outputs how fast a player is going if they're in a train. The command is "/speed". side: server + returns: + values: + - type: float + name: value + description: Returns the train's speed if successful, false otherwise. + oop: + element: vehicle + method: getTrainSpeed + variable: trainSpeed + static: false pair: setTrainSpeed - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleAdjustableProperty.yaml b/functions/Vehicle/getVehicleAdjustableProperty.yaml index 68be625b..670afdd2 100644 --- a/functions/Vehicle/getVehicleAdjustableProperty.yaml +++ b/functions/Vehicle/getVehicleAdjustableProperty.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleAdjustableProperty -client: +shared: name: getVehicleAdjustableProperty description: Use this to get the value of a vehicles adjustable property. This property relates to movable parts of a model, for example hydra jets or dump truck tray. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you want to get the adjustable property of. examples: - path: examples/getVehicleAdjustableProperty-1.lua description: This example creates a command, so if the local player wants to know how much they tilt/adjusted a vehicle adjustable property side: client - incomplete: true + returns: + values: + - type: int + name: value + description: Returns a value from 0 upwards representing adjustment. 0 is default + position. Maximum varies per vehicle, for example hydra horizontal flight is + 5000, while dump truck tray max tilt is 2500. Or returns false if the vehicle + passed to the function is invalid. + requires_review: true diff --git a/functions/Vehicle/getVehicleColor.yaml b/functions/Vehicle/getVehicleColor.yaml index 4af4d701..02247bf1 100644 --- a/functions/Vehicle/getVehicleColor.yaml +++ b/functions/Vehicle/getVehicleColor.yaml @@ -1,11 +1,48 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleColor -server: +shared: name: getVehicleColor description: This function returns the color of the specified vehicle. A vehicle can have up to four colors. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to get the color of. + - name: bRGB + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleColor-1.lua description: This will output the 4 colors of any car that the player enters. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + - type: int + name: value6 + - type: int + name: value7 + - type: int + name: value8 + - type: int + name: value9 + - type: int + name: value10 + - type: int + name: value11 + - type: int + name: value12 + description: 'Valid color ids if bRGB is set to false:' + oop: + element: vehicle + method: getColor + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleCompatibleUpgrades.yaml b/functions/Vehicle/getVehicleCompatibleUpgrades.yaml index a5cbe87d..b97f8153 100644 --- a/functions/Vehicle/getVehicleCompatibleUpgrades.yaml +++ b/functions/Vehicle/getVehicleCompatibleUpgrades.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleCompatibleUpgrades -server: +shared: name: getVehicleCompatibleUpgrades description: This function returns a table of all the compatible upgrades (or all for a specified slot, optionally) for a specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to retrieve the list of compatible upgrades + of. + - name: slot + type: int + description: the upgrade slot number for which you're getting the list (from 0 + to 16). Compatible upgrades for all slots are listed if this is not specified. examples: - path: examples/getVehicleCompatibleUpgrades-1.lua description: This example displays a list of all the compatible upgrades for a vehicle when you enter it. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table with all the compatible upgrades, or false if invalid + arguments are passed. + oop: + element: vehicle + method: getCompatibleUpgrades + variable: compatibleUpgrades + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleComponentPosition.yaml b/functions/Vehicle/getVehicleComponentPosition.yaml index 18c532a2..9e4eeaf3 100644 --- a/functions/Vehicle/getVehicleComponentPosition.yaml +++ b/functions/Vehicle/getVehicleComponentPosition.yaml @@ -1,9 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleComponentPosition -client: +shared: name: getVehicleComponentPosition description: This function gets the component position of a [vehicle](/wiki/Vehicle "Vehicle"). The vehicle must be streamed in. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get component position of. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: base + type: string + description: 'A string representing what the returned position is relative to. + It can be one of the following values: parent: The position is relative to the + parent component. root: The position is relative to the root component. world: + The position is a world position.' + default: '"root"' examples: - path: examples/getVehicleComponentPosition-1.lua description: '' @@ -11,5 +25,19 @@ client: - path: examples/getVehicleComponentPosition-2.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three floats indicating the position of the component, x + , y and z respectively. + oop: + element: vehicle + method: getComponentPosition + static: false pair: setVehicleComponentPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleComponentRotation.yaml b/functions/Vehicle/getVehicleComponentRotation.yaml index f7dc60c0..96d1bc88 100644 --- a/functions/Vehicle/getVehicleComponentRotation.yaml +++ b/functions/Vehicle/getVehicleComponentRotation.yaml @@ -1,18 +1,47 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleComponentRotation -client: +shared: name: getVehicleComponentRotation description: This function gets the component rotation of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get component rotation of. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: base + type: string + description: 'A string representing what the returned rotation is relative to. + It can be one of the following values: parent (default if not specified): The + rotation is relative to the parent component. root : The rotation is relative + to the root component. world : The rotation is a world rotation, relative to + the world''s coordinates axes.' + default: '"parent"' examples: - path: examples/getVehicleComponentRotation-1.lua description: Example 1:This example would get the name and the position of the components and output it in the chat. side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three floats indicating the rotation of the component, x + , y and z respectively. + oop: + element: vehicle + method: getComponentRotation + static: false pair: setVehicleComponentRotation notes: - type: info content: Before r6974 the component rotations went the wrong way (i.e. opposite to the vehicle rotations). This has been corrected, so you'll have to modify any scripts written before r6974 that use this function. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleComponentScale.yaml b/functions/Vehicle/getVehicleComponentScale.yaml index 3c2d4348..54bb65ae 100644 --- a/functions/Vehicle/getVehicleComponentScale.yaml +++ b/functions/Vehicle/getVehicleComponentScale.yaml @@ -1,12 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleComponentScale -client: +shared: name: getVehicleComponentScale description: This function gets the component scale of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get component scale of. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: base + type: string + description: 'A string representing what the returned scale is relative to. It + can be one of the following values: parent: The scale is relative to the parent + component. root: The scale is relative to the root component. world: The scale + is a world scale.' + default: '"root"' examples: - path: examples/getVehicleComponentScale-1.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three floats indicating the scale of the component, x , y + and z respectively. + oop: + element: vehicle + method: getComponentScale + static: false pair: setVehicleComponentScale - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleComponentVisible.yaml b/functions/Vehicle/getVehicleComponentVisible.yaml index 43645db6..4807d3db 100644 --- a/functions/Vehicle/getVehicleComponentVisible.yaml +++ b/functions/Vehicle/getVehicleComponentVisible.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleComponentVisible -client: +shared: name: getVehicleComponentVisible description: This function get component visibility for [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get component visibility of. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) examples: - path: examples/getVehicleComponentVisible-1.lua description: Example 1:This example would get the name and tells if the component is visible or not. side: client + returns: + values: + - type: bool + name: value + description: Returns a bool indicating the visible state of the component. + oop: + element: vehicle + method: getComponentVisible + static: false pair: setVehicleComponentVisible - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleComponents.yaml b/functions/Vehicle/getVehicleComponents.yaml index aed37348..8c25fad6 100644 --- a/functions/Vehicle/getVehicleComponents.yaml +++ b/functions/Vehicle/getVehicleComponents.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleComponents -client: +shared: name: getVehicleComponents description: This function gets a table of the components currently on a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get the components of. examples: - path: examples/getVehicleComponents-1.lua description: '' @@ -11,4 +14,15 @@ client: - path: examples/getVehicleComponents-2.lua description: This example draw all components names on the player screen. side: client - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table containing the name of the component as the key and + visibility flag of that component as the value + oop: + element: vehicle + method: getComponents + variable: components + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleController.yaml b/functions/Vehicle/getVehicleController.yaml index 388d6bf7..8ea936f3 100644 --- a/functions/Vehicle/getVehicleController.yaml +++ b/functions/Vehicle/getVehicleController.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleController -server: +shared: name: getVehicleController description: This function is used to get the player in control of the specified vehicle which includes somebody who is trying to enter the drivers seat. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you want to get the 'controller' of. examples: - path: examples/getVehicleController-1.lua description: This example outputs a chatbox message when a vehicle gets a trailer attached. side: server - incomplete: true + returns: + values: + - type: player + name: value + description: Returns a player object, if there isn't a driver, it will search + the 'trailer chain' for the front driver, false otherwise. + oop: + element: vehicle + method: getController + variable: controller + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleCurrentGear.yaml b/functions/Vehicle/getVehicleCurrentGear.yaml index ddaea97e..d16420e4 100644 --- a/functions/Vehicle/getVehicleCurrentGear.yaml +++ b/functions/Vehicle/getVehicleCurrentGear.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleCurrentGear -client: +shared: name: getVehicleCurrentGear description: Gets the specified vehicle's current gear. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle to get the gear of examples: - path: examples/getVehicleCurrentGear-1.lua description: Example of a program that outputs the current gear to the lower, center of the screen side: client + returns: + values: + - type: int + name: value + description: Returns the gear if successful, false otherwise. + oop: + element: vehicle + method: getGear + static: false pair: .gear - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleDoorOpenRatio.yaml b/functions/Vehicle/getVehicleDoorOpenRatio.yaml index 5efb088d..33198a73 100644 --- a/functions/Vehicle/getVehicleDoorOpenRatio.yaml +++ b/functions/Vehicle/getVehicleDoorOpenRatio.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleDoorOpenRatio -server: +shared: name: getVehicleDoorOpenRatio description: This function tells you how open a door is (the 'open ratio'). Doors include boots/trunks and bonnets on vehicles that have them. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: door + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleDoorOpenRatio-1.lua description: This example opens all the doors of the vehicle gradually over 2.5 seconds. side: server + returns: + values: + - type: float + name: value + description: Returns a number between 0 and 1 that indicates how open the door + is. 0 is closed, and 1 is fully open. Returns false if invalid arguments are + passed. + oop: + element: vehicle + method: getDoorOpenRatio + static: false pair: setVehicleDoorOpenRatio - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleDoorState.yaml b/functions/Vehicle/getVehicleDoorState.yaml index bcdb7e99..c6775920 100644 --- a/functions/Vehicle/getVehicleDoorState.yaml +++ b/functions/Vehicle/getVehicleDoorState.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleDoorState -server: +shared: name: getVehicleDoorState description: This function returns the current state of the specifed door on the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: door + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleDoorState-1.lua description: This example implements a doesVehicleHaveDoorOpen() function, that returns true if any of the doors on a vehicle are open. side: server + returns: + values: + - type: int + name: value + description: 'If successful, one of the following integers will be returned:' + oop: + element: vehicle + method: getDoorState + static: false pair: setVehicleDoorState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleDummyPosition.yaml b/functions/Vehicle/getVehicleDummyPosition.yaml index 49ec55a5..1f1311b1 100644 --- a/functions/Vehicle/getVehicleDummyPosition.yaml +++ b/functions/Vehicle/getVehicleDummyPosition.yaml @@ -1,16 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleDummyPosition -client: +shared: name: getVehicleDummyPosition description: This function returns the position of the dummy for the given [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you want to get the dummy positions from. + - name: dummy + type: string + description: The dummy whose position you want to get. examples: - path: examples/getVehicleDummyPosition-1.lua description: This is a command to get the position of the player's vehicle dummy position specified as an argument. side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns 3 floats indicating the position X, Y and Z of the vehicle's + dummy. It returns false otherwise. + oop: + element: vehicle + method: getDummyPosition + static: false pair: setVehicleDummyPosition - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -18,3 +37,4 @@ client: - Missing section: Allowed Dummies ' + requires_review: true diff --git a/functions/Vehicle/getVehicleEngineState.yaml b/functions/Vehicle/getVehicleEngineState.yaml index f0150d10..b72d7a9d 100644 --- a/functions/Vehicle/getVehicleEngineState.yaml +++ b/functions/Vehicle/getVehicleEngineState.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleEngineState -server: +shared: name: getVehicleEngineState description: This function returns a vehicle's engine state (on or off). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to get the engine state of. examples: - path: examples/getVehicleEngineState-1.lua description: This example will switch the vehicle engine state with the command "/switchengine". side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's engine is started, false otherwise. + oop: + element: vehicle + method: getEngineState + variable: engineState + static: false pair: setVehicleEngineState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleEntryPoints.yaml b/functions/Vehicle/getVehicleEntryPoints.yaml index ae813a74..e6867167 100644 --- a/functions/Vehicle/getVehicleEntryPoints.yaml +++ b/functions/Vehicle/getVehicleEntryPoints.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleEntryPoints -client: +shared: name: getVehicleEntryPoints description: This function returns a table containing the positions to 4 possible entry points to a vehicle. This function can be used alongside [setPedEnterVehicle](/wiki/SetPedEnterVehicle @@ -7,7 +7,10 @@ client: ped to a entry point retrieved through **getVehicleEntryPoints** and then using [setPedEnterVehicle](/wiki/SetPedEnterVehicle "SetPedEnterVehicle") to make them enter. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleEntryPoints-1.lua description: 'Example 1: This example renders 3D (text & circle) on eachstreamed-invehicle @@ -17,10 +20,21 @@ client: description: 'Example 2: This example checks if the player is near the vehicle door toenter' side: client + returns: + values: + - type: table + name: value + description: If the vehicle has entry points, it returns a table containing the + positions of the 4 possible entry points to the vehicle, otherwise it returns + false . + oop: + element: vehicle + method: getEntryPoints + static: false notes: - type: info content: This does not directly relate to the amount of doors a vehicle has as vehicles with two doors can have multiple entry points to the same door. - type: info content: The vehicle needs to be streamed in for this function to work. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleGravity.yaml b/functions/Vehicle/getVehicleGravity.yaml index 018f8bd2..db384683 100644 --- a/functions/Vehicle/getVehicleGravity.yaml +++ b/functions/Vehicle/getVehicleGravity.yaml @@ -1,13 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleGravity -client: +shared: name: getVehicleGravity description: Retrieves the current gravity vector of a vehicle. This is the direction in which the vehicle falls, also the cameras of any passengers will be rotated to match it. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle to retrieve the gravity vector of. examples: - path: examples/getVehicleGravity-1.lua description: This command will get gravity of your vehicle and output to chat using the /grav command side: client - incomplete: true + returns: + values: + - type: float float float + name: value + description: Returns the x, y and z components of the gravity vector if successful, + false otherwise. + requires_review: true diff --git a/functions/Vehicle/getVehicleHandling.yaml b/functions/Vehicle/getVehicleHandling.yaml index 5db8d575..d4f9d2d3 100644 --- a/functions/Vehicle/getVehicleHandling.yaml +++ b/functions/Vehicle/getVehicleHandling.yaml @@ -1,11 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleHandling -server: +shared: name: getVehicleHandling description: This function returns a table of the current vehicle handling data. - parameters: [] + parameters: + - name: theVehicle + type: element + description: the vehicle you wish to get the handling data of. + - name: property + type: string + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleHandling-1.lua description: This example creates a new function called getVehicleHandlingProperty, which simulates the previous syntax of this function. side: server - incomplete: true + returns: + values: + - type: mixed + name: value + description: 'Returns a table containing all the handling data, false otherwise. + If a property is specified, it returns the value of the specific property. Here''s + a list of valid table properties and what they return:' + oop: + element: vehicle + method: getHandling + variable: handling + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleHeadLightColor.yaml b/functions/Vehicle/getVehicleHeadLightColor.yaml index 80e316d4..6904d217 100644 --- a/functions/Vehicle/getVehicleHeadLightColor.yaml +++ b/functions/Vehicle/getVehicleHeadLightColor.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleHeadLightColor -server: +shared: name: getVehicleHeadLightColor description: This function will get the headlight color of a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to set the headlight color of. examples: - path: examples/getVehicleHeadLightColor-1.lua description: '' @@ -10,5 +13,19 @@ server: - path: examples/getVehicleHeadLightColor-2.lua description: '' side: server + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: Returns three integers for the red, green and blue of the headlight + color for the specified vehicle, false if an invalid vehicle was specified. + oop: + element: vehicle + method: getHeadLightColor + static: false pair: setVehicleHeadLightColor - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleIdleRespawnDelay.yaml b/functions/Vehicle/getVehicleIdleRespawnDelay.yaml index 073a55de..0113cb26 100644 --- a/functions/Vehicle/getVehicleIdleRespawnDelay.yaml +++ b/functions/Vehicle/getVehicleIdleRespawnDelay.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleIdleRespawnDelay -server: +shared: name: getVehicleIdleRespawnDelay description: 'This function gets the time delay (in milliseconds) the vehicle will remain at its position while empty.' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get the idle delay of. examples: - path: examples/getVehicleIdleRespawnDelay-1.lua description: This example gets the idle delay of a current occupying vehicle. side: server + returns: + values: + - type: int + name: value + description: Returns the delay in milliseconds. + oop: + element: vehicle + method: getIdleRespawnDelay + variable: idleRespawnDelay + static: false pair: setVehicleIdleRespawnDelay - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleLandingGearDown.yaml b/functions/Vehicle/getVehicleLandingGearDown.yaml index f8930ed5..f4e441dd 100644 --- a/functions/Vehicle/getVehicleLandingGearDown.yaml +++ b/functions/Vehicle/getVehicleLandingGearDown.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleLandingGearDown -server: +shared: name: getVehicleLandingGearDown description: This function is used to check whether a vehicle's landing gear is down or not. Only planes can be used with this function. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle of which you wish to check the landing gear state. examples: - path: examples/getVehicleLandingGearDown-1.lua description: This function tells you to pull up the landing gear if you're in a Hydra with its landing gear down. side: server + returns: + values: + - type: bool + name: value + description: Returns true if landing gear is down, false if the landing gear is + up. Returns nil if the vehicle has no landing gear, or is invalid. + oop: + element: vehicle + method: getLandingGearDown + variable: landingGearDown + static: false pair: setVehicleLandingGearDown - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleLightState.yaml b/functions/Vehicle/getVehicleLightState.yaml index 990b0094..3a2f7130 100644 --- a/functions/Vehicle/getVehicleLightState.yaml +++ b/functions/Vehicle/getVehicleLightState.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleLightState -server: +shared: name: getVehicleLightState description: This function returns the current state of the specified light on the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: light + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleLightState-1.lua description: '' side: server + returns: + values: + - type: int + name: value + description: Returns 0 (working) or 1 (broken) + oop: + element: vehicle + method: getLightState + static: false pair: setVehicleLightState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleMaxPassengers.yaml b/functions/Vehicle/getVehicleMaxPassengers.yaml index 0d19c4ab..1927b76c 100644 --- a/functions/Vehicle/getVehicleMaxPassengers.yaml +++ b/functions/Vehicle/getVehicleMaxPassengers.yaml @@ -1,15 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleMaxPassengers -server: +shared: name: getVehicleMaxPassengers description: This function returns the maximum number of passengers that a specified vehicle can hold. Only passenger seats are counted, the driver seat is excluded. - parameters: [] + parameters: + - name: theVehicle / int modelID + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleMaxPassengers-1.lua description: This example creates a vehicle then gets the number of passenger seats and outputs it in the chat box. side: server + returns: + values: + - type: int + name: value + description: Returns an int indicating the maximum number of passengers that can + enter a vehicle. Returns false if vehicle (or its ID) is a trailer + oop: + element: vehicle + method: getMaxPassengers + variable: maxPassengers + static: false notes: - type: important content: Only passenger seats are counted, the driver seat is excluded. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleModelDummyDefaultPosition.yaml b/functions/Vehicle/getVehicleModelDummyDefaultPosition.yaml index cbaec245..a8f84ca1 100644 --- a/functions/Vehicle/getVehicleModelDummyDefaultPosition.yaml +++ b/functions/Vehicle/getVehicleModelDummyDefaultPosition.yaml @@ -1,11 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleModelDummyDefaultPosition -client: +shared: name: getVehicleModelDummyDefaultPosition description: This function gets the default position of the dummies contained in a [vehicle](/wiki/Vehicle "Vehicle") model. - parameters: [] + parameters: + - name: modelId + type: int + description: The model ID which you want to apply the change to. + - name: dummy + type: string + description: The dummy whose position you want to get. examples: [] - incomplete: true + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns 3 floats indicating the default position X, Y and Z of the + given dummy. It returns false otherwise. + oop: + element: vehicle + method: ) + static: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -13,3 +32,4 @@ client: - Missing section: Allowed Dummies ' + requires_review: true diff --git a/functions/Vehicle/getVehicleModelDummyPosition.yaml b/functions/Vehicle/getVehicleModelDummyPosition.yaml index 7bc7a227..ba171e62 100644 --- a/functions/Vehicle/getVehicleModelDummyPosition.yaml +++ b/functions/Vehicle/getVehicleModelDummyPosition.yaml @@ -1,15 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleModelDummyPosition -client: +shared: name: getVehicleModelDummyPosition description: This function gets position of the dummies contained in a vehicle model. - parameters: [] + parameters: + - name: modelID + type: int + description: The model ID which you want to apply the change to + - name: dummy + type: string + description: The dummy whose position you want to get examples: - path: examples/getVehicleModelDummyPosition-1.lua description: Given example will draw rectangle over every dummy in vehicle player is currently sitting it. side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three floats indicating the position x , y and z of given + dummy. It returns false otherwise. + oop: + element: Vehicle + method: ) + static: true pair: setVehicleModelDummyPosition - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -17,3 +36,4 @@ client: - Missing section: Allowed dummies ' + requires_review: true diff --git a/functions/Vehicle/getVehicleModelExhaustFumesPosition.yaml b/functions/Vehicle/getVehicleModelExhaustFumesPosition.yaml index 3ce441e2..7bef76ac 100644 --- a/functions/Vehicle/getVehicleModelExhaustFumesPosition.yaml +++ b/functions/Vehicle/getVehicleModelExhaustFumesPosition.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleModelExhaustFumesPosition -client: +shared: name: getVehicleModelExhaustFumesPosition description: This function returns the position of the exhaust fumes the vehicle model emits. - parameters: [] + parameters: + - name: modelID + type: int + description: The vehicle model ID. examples: - path: examples/getVehicleModelExhaustFumesPosition-1.lua description: '' side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns the position of the exhaust fumes if everything went fine + or false otherwise. + oop: + element: Vehicle + method: ) + static: true pair: setVehicleModelExhaustFumesPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleModelFromName.yaml b/functions/Vehicle/getVehicleModelFromName.yaml index f15a756c..67a58149 100644 --- a/functions/Vehicle/getVehicleModelFromName.yaml +++ b/functions/Vehicle/getVehicleModelFromName.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleModelFromName -server: +shared: name: getVehicleModelFromName description: This function retrieves the model ID of a vehicle as an [integer](/wiki/Int "Int") value from its name. - parameters: [] + parameters: + - name: name + type: string + description: A string containing the name of the vehicle. examples: - path: examples/getVehicleModelFromName-1.lua description: This will allow the player to create a vehicle by name and it's model ID will be displayed in the chatbox when the vehicle is spawned. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: 'Returns an integer if the name exists, false otherwise. + + If you use this function on vehicles with shared names, such as "police", it + will return the earliest occurrence of that vehicle''s ID.' + oop: + element: Vehicle + note: This function is a static function underneath the Vehicle class. + method: ) + static: true + requires_review: true diff --git a/functions/Vehicle/getVehicleModelWheelSize.yaml b/functions/Vehicle/getVehicleModelWheelSize.yaml index f6a7842d..cc932aec 100644 --- a/functions/Vehicle/getVehicleModelWheelSize.yaml +++ b/functions/Vehicle/getVehicleModelWheelSize.yaml @@ -1,14 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleModelWheelSize -client: +shared: name: getVehicleModelWheelSize description: This function gets the size of a group of wheels for a [vehicle model](/wiki/Vehicle_IDs "Vehicle IDs"). - parameters: [] + parameters: + - name: vehicleModel + type: int + description: The vehicle model ID. + - name: wheelGroup + type: string + description: 'The group of wheels of the vehicle model to retrieve their size + value. If not specified, it defaults to all_wheels . The following values are + supported: front_axle : Represents the wheels in the front axle. rear_axle : + Represents the wheels in the rear axle. all_wheels : Convenience group that + returns all the wheel sizes in a table of the following format:' examples: - path: examples/getVehicleModelWheelSize-1.lua description: This example adds ahovermecommand that exploits the fact that the wheel size changes the ground clearance of a vehicle model to make it hover over the ground. side: client + returns: + values: + - type: float|table + name: value + description: Returns a decimal number or a table, depending on the specified wheel + group. If the specified vehicle model ID or wheel group are not valid, an error + is raised instead. The meaning of the wheel size values is documented in setVehicleModelWheelSize + . + oop: + element: Vehicle + method: ) + static: true pair: setVehicleModelWheelSize - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleName.yaml b/functions/Vehicle/getVehicleName.yaml index 7e2d4fec..078108be 100644 --- a/functions/Vehicle/getVehicleName.yaml +++ b/functions/Vehicle/getVehicleName.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleName -server: +shared: name: getVehicleName description: This function returns a string containing the name of the vehicle - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you want to get the name of. examples: - path: examples/getVehicleName-1.lua description: This example checks whether a player enters an AT-400 or a Shamal. If they do, it announces it to the chat specifying what vehicle was stolen. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string containing the requested vehicle's name, or false + if the vehicle passed to the function is invalid. + oop: + element: vehicle + method: getName + variable: name + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleNameFromModel.yaml b/functions/Vehicle/getVehicleNameFromModel.yaml index da1af5ee..0f89d43b 100644 --- a/functions/Vehicle/getVehicleNameFromModel.yaml +++ b/functions/Vehicle/getVehicleNameFromModel.yaml @@ -1,11 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleNameFromModel -server: +shared: name: getVehicleNameFromModel description: Gets the name of a vehicle by its model ID. - parameters: [] + parameters: + - name: model + type: int + description: This is the vehicle model ID. See vehicle IDs to see what values + will return names. examples: - path: examples/getVehicleNameFromModel-1.lua description: This will retrieve the name of a car so its name can be displayed when the player chooses to spawn a car by model ID. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the name of the vehicle if the model ID was valid, false + otherwise. + oop: + element: Vehicle + note: This function is a static function underneath the Vehicle class. + method: ) + static: true + requires_review: true diff --git a/functions/Vehicle/getVehicleNitroCount.yaml b/functions/Vehicle/getVehicleNitroCount.yaml index 49130331..48c57789 100644 --- a/functions/Vehicle/getVehicleNitroCount.yaml +++ b/functions/Vehicle/getVehicleNitroCount.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleNitroCount -client: +shared: name: getVehicleNitroCount description: This function gets the nitro count of the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' examples: - path: examples/getVehicleNitroCount-1.lua description: This example draws the nitro count on vehicle on the player's screen. side: client + returns: + values: + - type: int + name: value + description: Returns an integer determining the amount of nitro counts of the + vehicle, false if there is no nitro in the vehicle. notes: - type: warning content: Only works if the vehicle is streamed in, use isElementStreamedIn to check. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleNitroLevel.yaml b/functions/Vehicle/getVehicleNitroLevel.yaml index f9cc7711..826cddd1 100644 --- a/functions/Vehicle/getVehicleNitroLevel.yaml +++ b/functions/Vehicle/getVehicleNitroLevel.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleNitroLevel -client: +shared: name: getVehicleNitroLevel description: This function gets the nitro level of the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' examples: - path: examples/getVehicleNitroLevel-1.lua description: This function displays the nitro level of the vehicle the player is entering. side: client + returns: + values: + - type: float + name: value + description: Returns a float determining the nitro level (ranges from 0.0001 to + 1.0) of the vehicle, false if there is no nitro in the vehicle. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleOccupant.yaml b/functions/Vehicle/getVehicleOccupant.yaml index b7ec41eb..1558c590 100644 --- a/functions/Vehicle/getVehicleOccupant.yaml +++ b/functions/Vehicle/getVehicleOccupant.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleOccupant -server: +shared: name: getVehicleOccupant description: This function gets the player sitting/trying to enter the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle of which you wish to retrieve the driver or a passenger. + - name: seat + type: int + description: the seat where the player is sitting (0 for driver, 1+ for passengers). + default: '0' examples: - path: examples/getVehicleOccupant-1.lua description: 'This example announces the driver of a certain vehicle whenever it is damaged:' side: server - incomplete: true + returns: + values: + - type: player + name: value + description: Returns the player sitting in the vehicle, or false if the seat is + unoccupied or doesn't exist. + oop: + element: vehicle + method: getOccupant + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleOccupants.yaml b/functions/Vehicle/getVehicleOccupants.yaml index 04fa75cd..be8b7cc8 100644 --- a/functions/Vehicle/getVehicleOccupants.yaml +++ b/functions/Vehicle/getVehicleOccupants.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleOccupants -server: +shared: name: getVehicleOccupants description: This function gets all peds sitting in the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle of which you wish to retrieve the occupants. examples: - path: examples/getVehicleOccupants-1.lua description: 'This example prints all vehicle occupants into the F8 console if "/occupants" is typed:' side: server - incomplete: true + returns: + values: + - type: table + name: value + description: 'Returns a table with seat ID as an index and the occupant as an + element like this: table[seat] = occupant' + oop: + element: vehicle + method: getOccupants + variable: occupants + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleOverrideLights.yaml b/functions/Vehicle/getVehicleOverrideLights.yaml index 5a51d1e6..c725194c 100644 --- a/functions/Vehicle/getVehicleOverrideLights.yaml +++ b/functions/Vehicle/getVehicleOverrideLights.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleOverrideLights -server: +shared: name: getVehicleOverrideLights description: This function is used to find out the current state of the override\-lights setting of a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to retrieve the override lights setting of. examples: - path: examples/getVehicleOverrideLights-1.lua description: This example will toggle the car lights on and off for a player's vehicle side: server + returns: + values: + - type: int + name: value + description: 'Returns an integer value: 0 (No override), 1 (Force off) or 2 (Force + on).' + oop: + element: vehicle + method: getOverrideLights + variable: overrideLights + static: false pair: setVehicleOverrideLights - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehiclePaintjob.yaml b/functions/Vehicle/getVehiclePaintjob.yaml index 511aeb51..554f3b99 100644 --- a/functions/Vehicle/getVehiclePaintjob.yaml +++ b/functions/Vehicle/getVehiclePaintjob.yaml @@ -1,15 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehiclePaintjob -server: +shared: name: getVehiclePaintjob description: This function gets the current paintjob on the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to get the paintjob of. examples: - path: examples/getVehiclePaintjob-1.lua description: This example will set the paintjob of a new sultan to '2', then check it was set. side: server + returns: + values: + - type: int + name: value + description: Returns an integer representing the current paintjob on the vehicle. + oop: + element: vehicle + method: getPaintjob + variable: paintjob + static: false pair: setVehiclePaintjob notes: - type: info content: Always returns 3 if paintjobs are not supported for the vehicle. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehiclePanelState.yaml b/functions/Vehicle/getVehiclePanelState.yaml index 08e3e1ab..2d1bb0fa 100644 --- a/functions/Vehicle/getVehiclePanelState.yaml +++ b/functions/Vehicle/getVehiclePanelState.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehiclePanelState -server: +shared: name: getVehiclePanelState description: This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: panel + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getVehiclePanelState-1.lua description: This function creates an admiral and outputs every panel's state in the chatbox. side: server + returns: + values: + - type: int + name: value + description: Returns an int indicating the state of the specified the panel. This + is a value between 0 and 3, with 0 indicating the panel is undamaged and 3 indicating + it is very damaged. + oop: + element: vehicle + method: getPanelState + static: false pair: setVehiclePanelState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehiclePlateText.yaml b/functions/Vehicle/getVehiclePlateText.yaml index 97d072d2..86f7aa60 100644 --- a/functions/Vehicle/getVehiclePlateText.yaml +++ b/functions/Vehicle/getVehiclePlateText.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehiclePlateText -server: +shared: name: getVehiclePlateText description: This function is used to retrieve the text on the number plate of a specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle that you wish to retrieve the plate text from. examples: - path: examples/getVehiclePlateText-1.lua description: This example outputs the text on the license plate of the vehicle the player is driving to the chatbox. side: client + returns: + values: + - type: string + name: value + description: Returns a string that corresponds to the plate on the text, false + if a bad argument was passed or if it is not a vehicle. Every vehicle (including + planes, boats, etc.) has a numberplate, even if it's not visible. + oop: + element: vehicle + method: getPlateText + variable: plateText + static: false pair: setVehiclePlateText - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleRespawnDelay.yaml b/functions/Vehicle/getVehicleRespawnDelay.yaml index 05c0d4a9..64202495 100644 --- a/functions/Vehicle/getVehicleRespawnDelay.yaml +++ b/functions/Vehicle/getVehicleRespawnDelay.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleRespawnDelay -server: +shared: name: getVehicleRespawnDelay description: 'This function gets the time delay (in milliseconds) the vehicle will remain wrecked before respawning.' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get the respawn delay of. examples: - path: examples/getVehicleRespawnDelay-1.lua description: This example gets the delay of a current occupying vehicle. side: server + returns: + values: + - type: int + name: value + description: Returns the delay in milliseconds. + oop: + element: vehicle + method: getRespawnDelay + variable: respawnDelay + static: false pair: setVehicleRespawnDelay - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleRespawnPosition.yaml b/functions/Vehicle/getVehicleRespawnPosition.yaml index 94a264d8..24333d91 100644 --- a/functions/Vehicle/getVehicleRespawnPosition.yaml +++ b/functions/Vehicle/getVehicleRespawnPosition.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleRespawnPosition -server: +shared: name: getVehicleRespawnPosition description: This function retrieves the respawn coordinates of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle which you'd like to retrieve the respawn coordinates + of. examples: - path: examples/getVehicleRespawnPosition-1.lua description: '' side: server + returns: + values: + - type: float float float + name: value + description: Returns three floats indicating the respawn coordinates of the vehicle + , x , y and z respectively. + oop: + element: vehicle + method: getRespawnPosition + variable: respawnPosition + static: false pair: setVehicleRespawnPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleRespawnRotation.yaml b/functions/Vehicle/getVehicleRespawnRotation.yaml index 71344b5f..4b30108e 100644 --- a/functions/Vehicle/getVehicleRespawnRotation.yaml +++ b/functions/Vehicle/getVehicleRespawnRotation.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleRespawnRotation -server: +shared: name: getVehicleRespawnRotation description: This function retrieves the respawn rotation of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle which you'd like to retrieve the respawn rotation of. examples: - path: examples/getVehicleRespawnRotation-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: float float float + name: value + description: Returns three floats indicating the respawn rotation of the vehicle + , x , y and z respectively. + oop: + element: vehicle + method: getRespawnRotation + variable: respawnRotation + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleRotorSpeed.yaml b/functions/Vehicle/getVehicleRotorSpeed.yaml index 97d9f9e8..20e56e8e 100644 --- a/functions/Vehicle/getVehicleRotorSpeed.yaml +++ b/functions/Vehicle/getVehicleRotorSpeed.yaml @@ -1,11 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleRotorSpeed -client: +shared: name: getVehicleRotorSpeed description: Retrieves the speed at which the rotor of a helicopter or plane rotates. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle element (helicopter or plane) to get the rotor speed + of. examples: - path: examples/getVehicleRotorSpeed-1.lua description: '' side: client + returns: + values: + - type: float + name: value + description: Returns the rotor speed if successful. This is 0 when the helicopter + or plane is stationary, and about 0.2 when it is fully spun up. It can be negative + if the rotor rotates counter-clockwise. Returns false in case of failure (an + invalid element or a vehicle element that is not a helicopter or plane was passed). + oop: + element: vehicle + method: getVehicleRotorSpeed + variable: vehicleRotorSpeed + static: false pair: setVehicleRotorSpeed - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleRotorState.yaml b/functions/Vehicle/getVehicleRotorState.yaml index 72707408..90765518 100644 --- a/functions/Vehicle/getVehicleRotorState.yaml +++ b/functions/Vehicle/getVehicleRotorState.yaml @@ -1,16 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleRotorState -client: +shared: name: getVehicleRotorState description: This function returns a vehicle's (plane or helicopter) rotor state (on or off). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle you wish to get the engine state of. examples: - path: examples/getVehicleRotorState-1.lua description: This code adds a simple command that allows you to check a vehicle's rotor state keeping in mind you have to be in either a plane or helicopter. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's rotor is started, false otherwise. + oop: + element: vehicle + method: getRotorState + variable: rotorState + static: false pair: setVehicleRotorState notes: - type: info content: The function should not be confused with getVehicleEngineState . - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleSirenParams.yaml b/functions/Vehicle/getVehicleSirenParams.yaml index c0e4af89..6dd83772 100644 --- a/functions/Vehicle/getVehicleSirenParams.yaml +++ b/functions/Vehicle/getVehicleSirenParams.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleSirenParams -server: +shared: name: getVehicleSirenParams description: This function get the parameters of a vehicles siren. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to get the siren parameters of examples: - path: examples/getVehicleSirenParams-1.lua description: This example returns the vehicle parameters when the players presses g. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table with the siren count, siren type and a sub table + for the four flags. False otherwise. + oop: + element: vehicle + method: getSirenParams + variable: sirenParams + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleSirens.yaml b/functions/Vehicle/getVehicleSirens.yaml index b611db9a..fca5a185 100644 --- a/functions/Vehicle/getVehicleSirens.yaml +++ b/functions/Vehicle/getVehicleSirens.yaml @@ -1,12 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleSirens -server: +shared: name: getVehicleSirens description: This function gets the properties of a vehicle's sirens. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to get siren information of. examples: - path: examples/getVehicleSirens-1.lua description: This example returns the siren properties when the player presses Z. side: server + returns: + values: + - type: table + name: value + description: 'If the vehicle is invalid, it returns false . Otherwise, returns + a table with sub tables containing the properties of each siren point in the + following manner:' + oop: + element: vehicle + method: getSirens + variable: sirens + static: false pair: setVehicleSirens - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleSirensOn.yaml b/functions/Vehicle/getVehicleSirensOn.yaml index b3b81a31..9d5b63b9 100644 --- a/functions/Vehicle/getVehicleSirensOn.yaml +++ b/functions/Vehicle/getVehicleSirensOn.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleSirensOn -server: +shared: name: getVehicleSirensOn description: This function returns whether the sirens are turned on for the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that will be checked. examples: - path: examples/getVehicleSirensOn-1.lua description: This example toggles siren state when a player enters a vehicle as a driver. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the sirens are turned on for the specified vehicle, + false if the sirens are turned off for the specified vehicle, if the vehicle + doesn't have sirens or if invalid arguments are specified. + oop: + element: vehicle + method: areSirensOn + variable: sirensOn + static: false pair: setVehicleSirensOn - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleTowedByVehicle.yaml b/functions/Vehicle/getVehicleTowedByVehicle.yaml index 3bb1d3cc..3bc9fbd8 100644 --- a/functions/Vehicle/getVehicleTowedByVehicle.yaml +++ b/functions/Vehicle/getVehicleTowedByVehicle.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleTowedByVehicle -server: +shared: name: getVehicleTowedByVehicle description: This function is used to get the vehicle being towed by another. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to get the towed vehicle from. examples: - path: examples/getVehicleTowedByVehicle-1.lua description: This example will create a trailer and a trailer-tower, attach them, then check if they attached. side: server - incomplete: true + returns: + values: + - type: vehicle + name: value + description: Returns the vehicle that theVehicle is towing, false if it isn't + towing a vehicle. + oop: + element: vehicle + method: getTowedByVehicle + variable: towedByVehicle + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleTowingVehicle.yaml b/functions/Vehicle/getVehicleTowingVehicle.yaml index afc1f1c1..5631794f 100644 --- a/functions/Vehicle/getVehicleTowingVehicle.yaml +++ b/functions/Vehicle/getVehicleTowingVehicle.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleTowingVehicle -server: +shared: name: getVehicleTowingVehicle description: This function is used to get the vehicle that is towing another. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle being towed. examples: - path: examples/getVehicleTowingVehicle-1.lua description: This example will create a trailer and a trailer-tower, attach them, then check if they attached. side: server - incomplete: true + returns: + values: + - type: vehicle + name: value + description: This example will create a trailer and a trailer-tower, attach them, + then check if they attached. + oop: + element: vehicle + method: getTowingVehicle + variable: towingVehicle + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleTurretPosition.yaml b/functions/Vehicle/getVehicleTurretPosition.yaml index 57dd1dc8..6d1dec85 100644 --- a/functions/Vehicle/getVehicleTurretPosition.yaml +++ b/functions/Vehicle/getVehicleTurretPosition.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleTurretPosition -server: +shared: name: getVehicleTurretPosition description: This function gets the position of a vehicle's turret, if it has one. Vehicles with turrets include firetrucks and tanks. - parameters: [] + parameters: + - name: turretVehicle + type: vehicle + description: The vehicle whose turret position you want to retrieve. This should + be a vehicle with a turret. examples: - path: examples/getVehicleTurretPosition-1.lua description: '' side: server + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: Returns two floats for the X (horizontal) and Y (vertical) axis rotation + respectively. These values are in radians. The function will return 0, 0 if + the vehicle is not a vehicle with a turret. + oop: + element: vehicle + method: getTurretPosition + variable: turretPosition + static: false pair: setVehicleTurretPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleType.yaml b/functions/Vehicle/getVehicleType.yaml index 9416a104..e66f6236 100644 --- a/functions/Vehicle/getVehicleType.yaml +++ b/functions/Vehicle/getVehicleType.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleType -server: +shared: name: getVehicleType description: This function retrieves the type of a vehicle (such as if it is a car or a boat). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleType-1.lua description: Example 1:In this example when a player enters an airplane, it displays @@ -13,4 +16,16 @@ server: description: Example 2:In this example player gets message what type of vehicle he just entered. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string with vehicle type or false if an invalid modelID + has been supplied, or an empty string if the vehicle is blocked internally (some + trailers). + oop: + element: vehicle + method: getVehicleType + variable: vehicleType + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleUpgradeOnSlot.yaml b/functions/Vehicle/getVehicleUpgradeOnSlot.yaml index c16c022a..f3283a5c 100644 --- a/functions/Vehicle/getVehicleUpgradeOnSlot.yaml +++ b/functions/Vehicle/getVehicleUpgradeOnSlot.yaml @@ -1,15 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleUpgradeOnSlot -server: +shared: name: getVehicleUpgradeOnSlot description: 'This function returns the current upgrade id on the specified vehicle''s ''upgrade slot'' An upgrade slot is a certain type of upgrade (eg: exhaust, spoiler), there are 17 slots (0 to 16\).' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle whose upgrade you want to retrieve. + - name: slot + type: int + description: The slot id of the upgrade. ( Upgrade list ordered by slot number) examples: - path: examples/getVehicleUpgradeOnSlot-1.lua description: This example prints the name and upgrades on each slot of an entered vehicle to the chat. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer with the upgrade on the slot if correct arguments + were passed, false otherwise. + oop: + element: vehicle + method: getUpgradeOnSlot + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleUpgradeSlotName.yaml b/functions/Vehicle/getVehicleUpgradeSlotName.yaml index 8f66f9b0..6e3f2847 100644 --- a/functions/Vehicle/getVehicleUpgradeSlotName.yaml +++ b/functions/Vehicle/getVehicleUpgradeSlotName.yaml @@ -1,12 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleUpgradeSlotName -server: +shared: name: getVehicleUpgradeSlotName description: This function returns the name of an upgrade slot name (e.g. roof, spoiler). - parameters: [] + parameters: + - name: slot/upgrade + type: int + description: 'the slot ID or corresponding upgrade ID of which you want the name. + 0 : Hood 1 : Vent 2 : Spoiler 3 : Sideskirt 4 : Front Bullbars 5 : Rear Bullbars + 6 : Headlights 7 : Roof 8 : Nitro 9 : Hydraulics 10 : Stereo 11 : Unknown 12 + : Wheels 13 : Exhaust 14 : Front Bumper 15 : Rear Bumper 16 : Misc' examples: - path: examples/getVehicleUpgradeSlotName-1.lua description: This example prints the name and upgrades on each slot of an entered vehicle to the chat. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns a string with the slot name if a valid slot or upgrade ID + was given, false otherwise. + requires_review: true diff --git a/functions/Vehicle/getVehicleUpgrades.yaml b/functions/Vehicle/getVehicleUpgrades.yaml index 598705d3..979def58 100644 --- a/functions/Vehicle/getVehicleUpgrades.yaml +++ b/functions/Vehicle/getVehicleUpgrades.yaml @@ -1,11 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleUpgrades -server: +shared: name: getVehicleUpgrades description: This function returns a table of all the upgrades on a specifed vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to retrieve the upgrades of. examples: - path: examples/getVehicleUpgrades-1.lua description: This example prints the name and upgrades on each slot of an entered vehicle to the chat. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of all the upgrades on each slot of a vehicle, which + may be empty, or false if a valid vehicle is not passed. + oop: + element: vehicle + method: getUpgrades + variable: upgrades + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleVariant.yaml b/functions/Vehicle/getVehicleVariant.yaml index c746bbd1..dff9825c 100644 --- a/functions/Vehicle/getVehicleVariant.yaml +++ b/functions/Vehicle/getVehicleVariant.yaml @@ -1,15 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleVariant -server: +shared: name: getVehicleVariant description: 'This function gets the variant of a specified vehicle. In GTA: San Andreas some vehicles are different; for example the labelling on trucks or the contents of a pick\-up truck and the varying types of a motor bike. For the default variant list see: [Vehicle variants](/wiki/Vehicle_variants "Vehicle variants").' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you want to get the variant of. examples: - path: examples/getVehicleVariant-1.lua description: 'This example tells theplayerin thevehiclewhat their vehicle variants are with a command namedgetvehvar:' side: client + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns 2 int containing the vehicle variants, false otherwise (the + specified vehicle doesn't exist). + oop: + element: vehicle + method: getVariant + static: false pair: setVehicleVariant - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleWheelFrictionState.yaml b/functions/Vehicle/getVehicleWheelFrictionState.yaml index 2b8297e2..20864010 100644 --- a/functions/Vehicle/getVehicleWheelFrictionState.yaml +++ b/functions/Vehicle/getVehicleWheelFrictionState.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleWheelFrictionState -client: +shared: name: getVehicleWheelFrictionState description: This function returns the current wheel friction state of the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to get the wheel friction state. + - name: wheel + type: int + description: 'The wheel you want to check. (0: front left, 1: rear left, 2: front + right, 3: rear right)' examples: - path: examples/getVehicleWheelFrictionState-1.lua description: 'This example will show the friction state of each wheel of the player''s current vehicle:' side: client - incomplete: true + returns: + values: + - type: int + name: value + description: 'Returns a int indicating the wheel friction state. This value can + be:' + oop: + element: vehicle + method: getWheelFrictionState + static: false + requires_review: true diff --git a/functions/Vehicle/getVehicleWheelScale.yaml b/functions/Vehicle/getVehicleWheelScale.yaml index 58ef17bf..a17a188a 100644 --- a/functions/Vehicle/getVehicleWheelScale.yaml +++ b/functions/Vehicle/getVehicleWheelScale.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleWheelScale -client: +shared: name: getVehicleWheelScale description: This function gets the scale of all the wheels of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to get its wheel scale of. examples: - path: examples/getVehicleWheelScale-1.lua description: This example adds ashrinkwheelscommand that reduces the wheel scale of a vehicle in half each time it is invoked. side: client + returns: + values: + - type: float + name: value + description: Returns the wheel scale of the specified vehicle as a decimal number, + or an error if the vehicle is invalid. For more information about the returned + number, see setVehicleWheelScale . + oop: + element: vehicle + method: getWheelScale + variable: wheelScale + static: false pair: setVehicleWheelScale - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehicleWheelStates.yaml b/functions/Vehicle/getVehicleWheelStates.yaml index 6e448d2f..872ac057 100644 --- a/functions/Vehicle/getVehicleWheelStates.yaml +++ b/functions/Vehicle/getVehicleWheelStates.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehicleWheelStates -server: +shared: name: getVehicleWheelStates description: This function returns the current states of all the wheels on the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/getVehicleWheelStates-1.lua description: This example displays the states of the vehicle's wheels and changes @@ -12,5 +15,21 @@ server: description: This example displays the states of the vehicle's wheels and changes their states if any arguments were passed. side: client + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: 'Returns 4 ints indicating the states of the wheels (front left, + rear left, front right, rear right). These values can be:' + oop: + element: vehicle + method: getWheelStates + static: false pair: setVehicleWheelStates - incomplete: true + requires_review: true diff --git a/functions/Vehicle/getVehiclesOfType.yaml b/functions/Vehicle/getVehiclesOfType.yaml index 89fcd595..8313a1da 100644 --- a/functions/Vehicle/getVehiclesOfType.yaml +++ b/functions/Vehicle/getVehiclesOfType.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehiclesOfType -server: +shared: name: getVehiclesOfType description: This function scans through all the current vehicles and returns the ones matching the given model. - parameters: [] + parameters: + - name: model + type: int + description: The model of vehicles you want. examples: - path: examples/getVehiclesOfType-1.lua description: This example finds all landstalkers on the map and moves them 5 units to the left. side: server - incomplete: true + returns: + values: + - type: table + name: value + description: Returns a table of existing vehicles matching the specified model. + oop: + element: Vehicle + note: This function is a static function underneath the Vehicle class. + method: ) + static: true + requires_review: true diff --git a/functions/Vehicle/isTrainChainEngine.yaml b/functions/Vehicle/isTrainChainEngine.yaml index a09e301c..2be8ca24 100644 --- a/functions/Vehicle/isTrainChainEngine.yaml +++ b/functions/Vehicle/isTrainChainEngine.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTrainChainEngine -client: +shared: name: isTrainChainEngine description: This function checks if a [train](/wiki/Element/Vehicle "Element/Vehicle") is a chain engine (moves the rest of the chain's carriages) or not. - parameters: [] + parameters: + - name: theTrain + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/isTrainChainEngine-1.lua description: The next code snippet adds a /isthistrainachainengine, which checks if the train occupied by the player who types the command is a chain engine or not. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: The next code snippet adds a /isthistrainachainengine, which checks + if the train occupied by the player who types the command is a chain engine + or not. + oop: + element: vehicle + method: isTrainChainEngine + variable: chainEngine + static: false + requires_review: true diff --git a/functions/Vehicle/isTrainDerailable.yaml b/functions/Vehicle/isTrainDerailable.yaml index 5019d4ba..a58f68e6 100644 --- a/functions/Vehicle/isTrainDerailable.yaml +++ b/functions/Vehicle/isTrainDerailable.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTrainDerailable -server: +shared: name: isTrainDerailable description: This function will check if a train or tram is derailable. - parameters: [] + parameters: + - name: vehicleToCheck + type: vehicle + description: The vehicle you wish to check. examples: - path: examples/isTrainDerailable-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the train is derailable, false otherwise. + oop: + element: vehicle + method: isDerailable + variable: derailable + static: false pair: setTrainDerailable - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isTrainDerailed.yaml b/functions/Vehicle/isTrainDerailed.yaml index 3eacea14..7100e885 100644 --- a/functions/Vehicle/isTrainDerailed.yaml +++ b/functions/Vehicle/isTrainDerailed.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTrainDerailed -server: +shared: name: isTrainDerailed description: This function will check if a train or tram is derailed. - parameters: [] + parameters: + - name: vehicleToCheck + type: vehicle + description: the vehicle that you wish to check is derailed. examples: - path: examples/isTrainDerailed-1.lua description: This example lets a player check if the train they're driving has derailed. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the train is derailed, false if the train is still + on the rails + oop: + element: vehicle + method: isDerailed + variable: derailed + static: false pair: setTrainDerailed - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleBlown.yaml b/functions/Vehicle/isVehicleBlown.yaml index 03db32c7..125ca6bb 100644 --- a/functions/Vehicle/isVehicleBlown.yaml +++ b/functions/Vehicle/isVehicleBlown.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleBlown -server: +shared: name: isVehicleBlown description: This function allows you to determine whether a vehicle is blown or still intact. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you want to obtain the blown status of. examples: - path: examples/isVehicleBlown-1.lua description: This example creates a taxi and checks whether the taxi has blown up or not every time somebody types "/taxi". side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle specified has blown up, false if it is + still intact or the vehicle specified is invalid. + oop: + element: vehicle + method: isBlown + variable: blown + static: false pair: blowVehicle - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleDamageProof.yaml b/functions/Vehicle/isVehicleDamageProof.yaml index 6cf1bdf9..2f0780bd 100644 --- a/functions/Vehicle/isVehicleDamageProof.yaml +++ b/functions/Vehicle/isVehicleDamageProof.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleDamageProof -server: +shared: name: isVehicleDamageProof description: This function checks if a vehicle is damage proof (set with [setVehicleDamageProof](/wiki/SetVehicleDamageProof "SetVehicleDamageProof")). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle whose invincibility status we want to check. examples: - path: examples/isVehicleDamageProof-1.lua description: This example will output in the chatbox whether the vehicle is vulnerable to damage or not when a player enters in it. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle is damage proof, false if it isn't or + if invalid arguments were passed. + oop: + element: vehicle + method: isDamageProof + variable: damageProof + static: false pair: setVehicleDamageProof - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleFuelTankExplodable.yaml b/functions/Vehicle/isVehicleFuelTankExplodable.yaml index 49b18ecd..51315cf2 100644 --- a/functions/Vehicle/isVehicleFuelTankExplodable.yaml +++ b/functions/Vehicle/isVehicleFuelTankExplodable.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleFuelTankExplodable -server: +shared: name: isVehicleFuelTankExplodable description: This will tell you if a vehicle's petrol tank is explodable. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you want to obtain the fuel tank status of. examples: - path: examples/isVehicleFuelTankExplodable-1.lua description: This example creates a vehicle, then displays if it fuel tank is @@ -12,4 +15,10 @@ server: description: This example toggles vehicle fuel tank explodable when the player typefueltankin the chat. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the specified vehicle is valid and its fuel tank + is explodable, false otherwise. + requires_review: true diff --git a/functions/Vehicle/isVehicleLocked.yaml b/functions/Vehicle/isVehicleLocked.yaml index 794bb0a8..bfc9cad5 100644 --- a/functions/Vehicle/isVehicleLocked.yaml +++ b/functions/Vehicle/isVehicleLocked.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleLocked -server: +shared: name: isVehicleLocked description: This will tell you if a vehicle is locked. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you want to obtain the locked status of. examples: - path: examples/isVehicleLocked-1.lua description: This example allows a player to lock his vehicle when he is inside it. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle specified is locked, false if is unlocked + or the vehicle specified is invalid. + oop: + element: vehicle + method: isLocked + variable: locked + static: false pair: setVehicleLocked - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleNitroActivated.yaml b/functions/Vehicle/isVehicleNitroActivated.yaml index b7027218..775499be 100644 --- a/functions/Vehicle/isVehicleNitroActivated.yaml +++ b/functions/Vehicle/isVehicleNitroActivated.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleNitroActivated -client: +shared: name: isVehicleNitroActivated description: This function checks if nitro is activated on the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' examples: - path: examples/isVehicleNitroActivated-1.lua description: This example creates an explosion if nitro is activated. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the nitro is currently activated on the vehicle, + false otherwise. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleNitroRecharging.yaml b/functions/Vehicle/isVehicleNitroRecharging.yaml index b7d46116..fffeaaab 100644 --- a/functions/Vehicle/isVehicleNitroRecharging.yaml +++ b/functions/Vehicle/isVehicleNitroRecharging.yaml @@ -1,14 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleNitroRecharging -client: +shared: name: isVehicleNitroRecharging description: This function checks if nitro is recharging on the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' examples: - path: examples/isVehicleNitroRecharging-1.lua description: This example will print if vehicle's nitro is already recharging side: client + returns: + values: + - type: bool + name: value + description: Returns true if the nitro is currently recharging on the vehicle, + false otherwise. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleOnGround.yaml b/functions/Vehicle/isVehicleOnGround.yaml index 87ecc7b2..a13691c0 100644 --- a/functions/Vehicle/isVehicleOnGround.yaml +++ b/functions/Vehicle/isVehicleOnGround.yaml @@ -1,19 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleOnGround -server: +shared: name: isVehicleOnGround description: Checks to see if a vehicle has contact with the ground. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to check. examples: - path: examples/isVehicleOnGround-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if vehicle is on the ground, false if it is not. + oop: + element: vehicle + method: isOnGround + variable: onGround + static: false notes: - type: info content: This function has a few issues, see below. Consider using the clientside function isVehicleWheelOnGround instead. issues: - - id: '471' + - id: 471 description: isVehicleOnGround sometimes returns false incorrectly - - id: '2093' + - id: 2093 description: isVehicleOnGround does not work after setVehicleHandling - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleRespawnable.yaml b/functions/Vehicle/isVehicleRespawnable.yaml index c2bade7c..d13da140 100644 --- a/functions/Vehicle/isVehicleRespawnable.yaml +++ b/functions/Vehicle/isVehicleRespawnable.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleRespawnable -server: +shared: name: isVehicleRespawnable description: This function check if the vehicle is respawnable. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle which you'd like to get respawn state of. examples: - path: examples/isVehicleRespawnable-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns three true if the vehicle is respawnable, false otherwise. + oop: + element: vehicle + method: isRespawnable + variable: respawnable + static: false pair: toggleVehicleRespawn - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleSmokeTrailEnabled.yaml b/functions/Vehicle/isVehicleSmokeTrailEnabled.yaml index a9939361..d8a32fdc 100644 --- a/functions/Vehicle/isVehicleSmokeTrailEnabled.yaml +++ b/functions/Vehicle/isVehicleSmokeTrailEnabled.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleSmokeTrailEnabled -client: +shared: name: isVehicleSmokeTrailEnabled description: This function is used to check planes smoke trail enabled or disabled. - parameters: [] + parameters: + - name: veh + type: vehicle + description: MISSING_PARAM_DESC examples: - path: examples/isVehicleSmokeTrailEnabled-1.lua description: This example let you set and check the smoke trail. side: client + returns: + values: + - type: isVehicleSmokeTrailEnabled + name: value + description: If it enabled it returns true , false otherwise. + oop: + element: vehicle + method: isSmokeTrailEnabled + static: false notes: - type: info content: The smoke trail is only supported to models 512 and 513, so this only going to works with that models - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleTaxiLightOn.yaml b/functions/Vehicle/isVehicleTaxiLightOn.yaml index 24eef373..17acda40 100644 --- a/functions/Vehicle/isVehicleTaxiLightOn.yaml +++ b/functions/Vehicle/isVehicleTaxiLightOn.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleTaxiLightOn -server: +shared: name: isVehicleTaxiLightOn description: This function will get the taxi light state of a taxi (vehicle IDs 420 and 438\) - parameters: [] + parameters: + - name: taxi + type: vehicle + description: The vehicle element of the taxi that you wish to get the light state + of. examples: - path: examples/isVehicleTaxiLightOn-1.lua description: This example binds the 'o' key to a function that toggles the taxi's light on and off, if you're in a taxi. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the light is on, false otherwise. + oop: + element: vehicle + method: isTaxiLightOn + variable: taxiLightOn + static: false pair: setVehicleTaxiLightOn - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleWheelOnGround.yaml b/functions/Vehicle/isVehicleWheelOnGround.yaml index bd89b294..84a6a63c 100644 --- a/functions/Vehicle/isVehicleWheelOnGround.yaml +++ b/functions/Vehicle/isVehicleWheelOnGround.yaml @@ -1,16 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleWheelOnGround -client: +shared: name: isVehicleWheelOnGround description: This function returns a [boolean](/wiki/Boolean "Boolean") whether the [vehicle](/wiki/Vehicle "Vehicle")'s wheel is on ground (true) or in air (false). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' + - name: wheel + type: string/int + description: '"front_left" or 0 "rear_left" or 1 "front_right" or 2 "rear_right" + or 3' examples: - path: examples/isVehicleWheelOnGround-1.lua description: This example displays four colored rectangles on the screen. If the wheel is colliding, the rectangle will be green, otherwise it will be red. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle wheel is on ground/collided, false otherwise. + oop: + element: vehicle + method: isWheelOnGround + static: false notes: - type: info content: In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - "front_left" and "rear_left" - incomplete: true + requires_review: true diff --git a/functions/Vehicle/isVehicleWindowOpen.yaml b/functions/Vehicle/isVehicleWindowOpen.yaml index 528f82e3..47457845 100644 --- a/functions/Vehicle/isVehicleWindowOpen.yaml +++ b/functions/Vehicle/isVehicleWindowOpen.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVehicleWindowOpen -client: +shared: name: isVehicleWindowOpen description: This function gets the vehicle window state. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to get the window state. + - name: window + type: int + description: 'An integer representing a vehicle window. It can be: 0: motorbike + shield 1: rear window 2: right front window 3: right back window 4: left front + (driver) window 5: left back window 6: windshield' examples: - path: examples/isVehicleWindowOpen-1.lua description: This example opens the vehicle windows when the local player use /openwindow . side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns a boolean which represents window open state. + requires_review: true diff --git a/functions/Vehicle/removeVehicleSirens.yaml b/functions/Vehicle/removeVehicleSirens.yaml index 17739104..c26f9b26 100644 --- a/functions/Vehicle/removeVehicleSirens.yaml +++ b/functions/Vehicle/removeVehicleSirens.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveVehicleSirens -server: +shared: name: removeVehicleSirens description: This function removes sirens from a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to remove the sirens of examples: - path: examples/removeVehicleSirens-1.lua description: This example adds a vehicle siren on entering a vehicle and removes a vehicle siren on exiting. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sirens were successfully removed from the vehicle, + false otherwise. + requires_review: true diff --git a/functions/Vehicle/removeVehicleUpgrade.yaml b/functions/Vehicle/removeVehicleUpgrade.yaml index 1cd079c0..c9accfe2 100644 --- a/functions/Vehicle/removeVehicleUpgrade.yaml +++ b/functions/Vehicle/removeVehicleUpgrade.yaml @@ -1,9 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveVehicleUpgrade -server: +shared: name: removeVehicleUpgrade description: 'This function removes an already existing upgrade from the specified vehicle, eg: nos, hydraulics. Defined in San Andreas\\data\\maps\\veh\_mods\\veh\_mods.ide.' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The element representing the vehicle you wish to remove the upgrade + from + - name: upgrade + type: int + description: The ID of the upgrade you wish to remove. examples: - path: examples/removeVehicleUpgrade-1.lua description: This script defines a 'nos' console command that adds a NOS upgrade @@ -16,4 +23,10 @@ server: adds a 'removenos' command which allows removal of a player's nos. This example is clientside and may cause desync. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the upgrade was successfully removed from the vehicle, + otherwise false . + requires_review: true diff --git a/functions/Vehicle/resetVehicleComponentPosition.yaml b/functions/Vehicle/resetVehicleComponentPosition.yaml index 8331ec0f..8ec330c2 100644 --- a/functions/Vehicle/resetVehicleComponentPosition.yaml +++ b/functions/Vehicle/resetVehicleComponentPosition.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleComponentPosition -client: +shared: name: resetVehicleComponentPosition description: This function reset to default component position for [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to reset component position. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) examples: - path: examples/resetVehicleComponentPosition-1.lua description: Example 1:This example would change the position of the component when the player enters a vehicle and resets it when he exit. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the position of the component was reset, false otherwise. + oop: + element: vehicle + method: resetComponentPosition + static: false + requires_review: true diff --git a/functions/Vehicle/resetVehicleComponentRotation.yaml b/functions/Vehicle/resetVehicleComponentRotation.yaml index 3ea96ed4..c2b5ab78 100644 --- a/functions/Vehicle/resetVehicleComponentRotation.yaml +++ b/functions/Vehicle/resetVehicleComponentRotation.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleComponentRotation -client: +shared: name: resetVehicleComponentRotation description: This function reset to default component rotation for [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to reset component rotation. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) examples: - path: examples/resetVehicleComponentRotation-1.lua description: Example 1:This example would change the roatation of the component when the player enters a vehicle and resets it when you type /reset. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the rotation of the component was reset, false otherwise. + oop: + element: vehicle + method: resetComponentRotation + static: false + requires_review: true diff --git a/functions/Vehicle/resetVehicleComponentScale.yaml b/functions/Vehicle/resetVehicleComponentScale.yaml index 3f1512d6..d217802b 100644 --- a/functions/Vehicle/resetVehicleComponentScale.yaml +++ b/functions/Vehicle/resetVehicleComponentScale.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleComponentScale -client: +shared: name: resetVehicleComponentScale description: This function reset to default component scale for [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to reset component scale. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) examples: - path: examples/resetVehicleComponentScale-1.lua description: Example 1:This example would change the scale of the component when the player enters a vehicle and resets it when he exit. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the scale of the component was reset, false otherwise. + oop: + element: vehicle + method: resetComponentScale + static: false + requires_review: true diff --git a/functions/Vehicle/resetVehicleDummyPositions.yaml b/functions/Vehicle/resetVehicleDummyPositions.yaml index 37ed64c5..d4de950c 100644 --- a/functions/Vehicle/resetVehicleDummyPositions.yaml +++ b/functions/Vehicle/resetVehicleDummyPositions.yaml @@ -1,8 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleDummyPositions -client: +shared: name: resetVehicleDummyPositions description: This function resets the [vehicle](/wiki/Vehicle "Vehicle") dependent dummy positions to the vehicle's current model dummy positions. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to reset the dummy positions. examples: [] - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the dummy positions have been reset, false otherwise. + oop: + element: vehicle + method: resetDummyPositions + static: false + requires_review: true diff --git a/functions/Vehicle/resetVehicleExplosionTime.yaml b/functions/Vehicle/resetVehicleExplosionTime.yaml index 33631c85..f61083ce 100644 --- a/functions/Vehicle/resetVehicleExplosionTime.yaml +++ b/functions/Vehicle/resetVehicleExplosionTime.yaml @@ -1,13 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleExplosionTime -server: +shared: name: resetVehicleExplosionTime description: 'Resets the vehicle explosion time. This is the point in time at which the vehicle last exploded: at this time plus the vehicle''s respawn delay, the vehicle is respawned. You can use this function to prevent the vehicle from respawning.' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to reset the explosion time from. examples: - path: examples/resetVehicleExplosionTime-1.lua description: This example resets every vehicle's explosion time when the resource is stopped. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle explosion time has been reset, false + if it failed to reset the explosion time. + requires_review: true diff --git a/functions/Vehicle/resetVehicleIdleTime.yaml b/functions/Vehicle/resetVehicleIdleTime.yaml index c23e2047..7c2e2052 100644 --- a/functions/Vehicle/resetVehicleIdleTime.yaml +++ b/functions/Vehicle/resetVehicleIdleTime.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehicleIdleTime -server: +shared: name: resetVehicleIdleTime description: Resets the vehicle idle time - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to reset the idle time from. examples: - path: examples/resetVehicleIdleTime-1.lua description: This example resets every vehicle's idle time when the resource is stopped. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle idle time has been reset, false if it + failed to reset the idle time. + requires_review: true diff --git a/functions/Vehicle/respawnVehicle.yaml b/functions/Vehicle/respawnVehicle.yaml index 58f20a4d..91a1f3f9 100644 --- a/functions/Vehicle/respawnVehicle.yaml +++ b/functions/Vehicle/respawnVehicle.yaml @@ -1,13 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RespawnVehicle -server: +shared: name: respawnVehicle description: This function respawns a vehicle according to its set respawn position, set by [setVehicleRespawnPosition](/wiki/SetVehicleRespawnPosition "SetVehicleRespawnPosition") or the position and rotation it was created on. To spawn a vehicle to a specific location just once, [spawnVehicle](/wiki/SpawnVehicle "SpawnVehicle") can be used. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to respawn examples: - path: examples/respawnVehicle-1.lua description: This example makes an exploded vehicle re-spawn after 5 seconds. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle respawned successfully, false if the + passed argument does not exist or is not a vehicle. + oop: + element: vehicle + method: respawn + static: false + requires_review: true diff --git a/functions/Vehicle/setHeliBladeCollisionsEnabled.yaml b/functions/Vehicle/setHeliBladeCollisionsEnabled.yaml index 0a1fa574..314cbf08 100644 --- a/functions/Vehicle/setHeliBladeCollisionsEnabled.yaml +++ b/functions/Vehicle/setHeliBladeCollisionsEnabled.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetHeliBladeCollisionsEnabled -client: +shared: name: setHeliBladeCollisionsEnabled description: This function changes the state of the helicopter blades collisions on the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The helicopter that will have the blades collisions set. + - name: collisions + type: bool + description: The state of the helicopter blades collisions. examples: - path: examples/setHeliBladeCollisionsEnabled-1.lua description: This example disables blades collisions when a player enters a helicopter as a driver. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the collisions are set for the specified vehicle, + false if the collisions can't be set for the specified vehicle, if the vehicle + is not a helicopter or if invalid arguments are specified. + oop: + element: vehicle + method: setHeliBladeCollisionsEnabled + variable: heliBladeCollisionsEnabled + static: false pair: getHeliBladeCollisionsEnabled - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setModelHandling.yaml b/functions/Vehicle/setModelHandling.yaml index 1fa3b99e..954316d7 100644 --- a/functions/Vehicle/setModelHandling.yaml +++ b/functions/Vehicle/setModelHandling.yaml @@ -1,20 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetModelHandling -server: +shared: name: setModelHandling description: This function is used to change the handling data of all vehicles of a specified model. - parameters: [] + parameters: + - name: modelId + type: int + description: The vehicle model you wish to set the handling of. + - name: property + type: string + description: The property you wish to set the handling of the vehicle to, or nil + if you want to reset the all the handling properties. + - name: value + type: var + description: The value of the models's handling property you wish to set, or nil + if you want to reset the handling property to its default value. examples: - path: examples/setModelHandling-1.lua description: This example script changes the handling of all Bullet. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the handling was set successfully, false otherwise. issues: - - id: '553' + - id: 553 description: setModelHandling doesn't work with already created vehicles - - id: '1198' + - id: 1198 description: '"setModelHandling" function doesn''t affect vehicles that have been changed using "setElementModel"' - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -22,3 +37,4 @@ server: - Missing section: Handling Properties ' + requires_review: true diff --git a/functions/Vehicle/setTrainDerailable.yaml b/functions/Vehicle/setTrainDerailable.yaml index 45d756d9..ee6bb335 100644 --- a/functions/Vehicle/setTrainDerailable.yaml +++ b/functions/Vehicle/setTrainDerailable.yaml @@ -1,9 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrainDerailable -server: +shared: name: setTrainDerailable description: This function will set a train or tram as derailable. This is, if it can derail when it goes above the maximum speed. - parameters: [] + parameters: + - name: derailableVehicle + type: vehicle + description: The vehicle that you wish to set derailable. + - name: derailable + type: bool + description: whether the train or tram is derailable. True as derailable, False + as non-derailable. examples: - path: examples/setTrainDerailable-1.lua description: This example will allow players to toggle derailability of the train @@ -13,5 +20,15 @@ server: description: This example will make a train east of LS station which can not be derailed, and start moving it. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the state was successfully set, false otherwise. + oop: + element: vehicle + method: setDerailable + variable: derailable + static: false pair: isTrainDerailable - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setTrainDerailed.yaml b/functions/Vehicle/setTrainDerailed.yaml index d98f7ada..924645cd 100644 --- a/functions/Vehicle/setTrainDerailed.yaml +++ b/functions/Vehicle/setTrainDerailed.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrainDerailed -server: +shared: name: setTrainDerailed description: This function will set a train or tram as derailed. - parameters: [] + parameters: + - name: vehicleToDerail + type: vehicle + description: The vehicle that you wish to derail. + - name: derailed + type: bool + description: whether the train is derailed. examples: - path: examples/setTrainDerailed-1.lua description: This example creates an underailable train, and allows it to be derailed when you want side: server + returns: + values: + - type: bool + name: value + description: Returns true if the state was successfully set + oop: + element: vehicle + method: setDerailed + variable: derailed + static: false pair: isTrainDerailed - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setTrainDirection.yaml b/functions/Vehicle/setTrainDirection.yaml index d2994cc8..4bdf1fdc 100644 --- a/functions/Vehicle/setTrainDirection.yaml +++ b/functions/Vehicle/setTrainDirection.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrainDirection -server: +shared: name: setTrainDirection description: Sets the direction in which a train or tram drives over the rails (clockwise or counterclockwise). - parameters: [] + parameters: + - name: train + type: vehicle + description: the train whose direction to change. + - name: clockwise + type: bool + description: if true , will make the train go clockwise. If false , makes it go + counterclockwise. examples: - path: examples/setTrainDirection-1.lua description: This function will make a train driving clockwise. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: vehicle + method: setDirection + variable: direction + static: false pair: getTrainDirection - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setTrainPosition.yaml b/functions/Vehicle/setTrainPosition.yaml index 2224cb74..7531e99e 100644 --- a/functions/Vehicle/setTrainPosition.yaml +++ b/functions/Vehicle/setTrainPosition.yaml @@ -1,12 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrainPosition -server: +shared: name: setTrainPosition description: Sets the position the train is currently on the track - parameters: [] + parameters: + - name: train + type: vehicle + description: the train of which to set the track + - name: position + type: float + description: the position along the track (0 - 18107 a complete way round) examples: - path: examples/setTrainPosition-1.lua description: This example adds a command called "/settrainpos", allowing you to set the position of the train. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the train position was set, false otherwise. + oop: + element: vehicle + method: setTrainPosition + variable: trainPosition + static: false pair: getTrainPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setTrainSpeed.yaml b/functions/Vehicle/setTrainSpeed.yaml index fb5fb15c..e8eb58f6 100644 --- a/functions/Vehicle/setTrainSpeed.yaml +++ b/functions/Vehicle/setTrainSpeed.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrainSpeed -server: +shared: name: setTrainSpeed description: Sets the on\-track speed of a train. - parameters: [] + parameters: + - name: train + type: vehicle + description: the train whose speed to change. + - name: speed + type: float + description: the new on-track speed of the train. A positive value will make it + go clockwise, a negative value counter clockwise. examples: - path: examples/setTrainSpeed-1.lua description: This example will make a train east of LS station which can not be derailed, and start moving it. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: vehicle + method: setTrainSpeed + variable: trainSpeed + static: false pair: getTrainSpeed - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleAdjustableProperty.yaml b/functions/Vehicle/setVehicleAdjustableProperty.yaml index d2f0c3a5..f5796a58 100644 --- a/functions/Vehicle/setVehicleAdjustableProperty.yaml +++ b/functions/Vehicle/setVehicleAdjustableProperty.yaml @@ -1,14 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleAdjustableProperty -client: +shared: name: setVehicleAdjustableProperty description: 'This function is used for adjusting the movable parts of a model, for example hydra jets or dump truck tray. This function only works on vehicles with adjustable properties.' - parameters: [] + parameters: + - name: theVehicle + type: element + description: The vehicle you wish to change the adjustable property of. + - name: value + type: int + description: A value from 0 betweenΒ ?. (Set the adjustable value between 0 and + N. 0 is the default value. It is possible to force the setting beyond default + maximum, for example setting above 5000 on the dump truck (normal max 2500) + will cause the tray to be fully vertical.) examples: - path: examples/setVehicleAdjustableProperty-1.lua description: 'This clientside function allows the user to set the vehicle adjustable property of a vehicle that the user is in by typing a command:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the adjustable property was set, false otherwise. + requires_review: true diff --git a/functions/Vehicle/setVehicleColor.yaml b/functions/Vehicle/setVehicleColor.yaml index c5206303..78878deb 100644 --- a/functions/Vehicle/setVehicleColor.yaml +++ b/functions/Vehicle/setVehicleColor.yaml @@ -1,10 +1,49 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleColor -server: +shared: name: setVehicleColor description: This function will set the color of a vehicle using either a RGB format, or the [standard San Andreas color IDs.](/wiki/Vehicle_Colors "Vehicle Colors") Vehicles can have up to 3 colors, most of the vehicles have 2 colors only. - parameters: [] + parameters: + - name: veh + type: vehicle + description: MISSING_PARAM_DESC + - name: r1 + type: int + description: MISSING_PARAM_DESC + - name: g1 + type: int + description: MISSING_PARAM_DESC + - name: b1 + type: int + description: MISSING_PARAM_DESC + - name: r2 + type: int + description: MISSING_PARAM_DESC + - name: g2 + type: int + description: MISSING_PARAM_DESC + - name: b2 + type: int + description: MISSING_PARAM_DESC + - name: r3 + type: int + description: MISSING_PARAM_DESC + - name: g3 + type: int + description: MISSING_PARAM_DESC + - name: b3 + type: int + description: MISSING_PARAM_DESC + - name: r4 + type: int + description: MISSING_PARAM_DESC + - name: g4 + type: int + description: MISSING_PARAM_DESC + - name: b4 + type: int + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleColor-1.lua description: This example implements a serversiderandom_colorconsole command. @@ -13,7 +52,16 @@ server: description: This example implements a serverside command for the player to spawn a red and white Banshee, using the palette colors. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if vehicle's color was set, false if an invalid vehicle + or invalid colors were specified. + oop: + element: vehicle + method: setColor + static: false meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -21,3 +69,4 @@ server: - Missing section: Optional Arguments (RGB format only) ' + requires_review: true diff --git a/functions/Vehicle/setVehicleComponentPosition.yaml b/functions/Vehicle/setVehicleComponentPosition.yaml index 17ad6929..a6f7946e 100644 --- a/functions/Vehicle/setVehicleComponentPosition.yaml +++ b/functions/Vehicle/setVehicleComponentPosition.yaml @@ -1,12 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleComponentPosition -client: +shared: name: setVehicleComponentPosition description: This function sets the component position of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to set component position. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: posX + type: float + description: The new x position of this component. + - name: posY + type: float + description: The new y position of this component. + - name: posZ + type: float + description: The new z position of this component. + - name: base + type: string + description: 'A string representing what the supplied position ( posX , posY , + posZ ) is relative to. It can be one of the following values: parent : The position + is relative to the parent component. root (default if not specified): The position + is relative to the root component. world : The position is a world position, + relative to the world''s center of coordinates.' + default: '"root"' examples: - path: examples/setVehicleComponentPosition-1.lua description: Example 1:This example would set the position of the component. side: client + returns: + values: + - type: bool + name: value + description: Returns true if component position was set successfully, false otherwise. + oop: + element: vehicle + method: setComponentPosition + static: false pair: getVehicleComponentPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleComponentRotation.yaml b/functions/Vehicle/setVehicleComponentRotation.yaml index c763fbcf..f3893d9c 100644 --- a/functions/Vehicle/setVehicleComponentRotation.yaml +++ b/functions/Vehicle/setVehicleComponentRotation.yaml @@ -1,18 +1,52 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleComponentRotation -client: +shared: name: setVehicleComponentRotation description: This function sets the component rotation of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to set component rotation of. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: rotX + type: float + description: The component's rotation around the x axis in degrees. + - name: rotY + type: float + description: The component's rotation around the y axis in degrees. + - name: rotZ + type: float + description: The component's rotation around the z axis in degrees. + - name: base + type: string + description: 'A string representing what the supplied rotation ( rotX , rotY , + rotZ ) is relative to. It can be one of the following values: parent: The rotation + is relative to the parent component. root: The rotation is relative to the root + component. world: The rotation is a world rotation, relative to the world''s + coordinates axes.' + default: '"parent"' examples: - path: examples/setVehicleComponentRotation-1.lua description: Example 1:This example would change the roatation of the component when the player enters a vehicle. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the component rotation was set successfully, false + otherwise. + oop: + element: vehicle + method: setComponentRotation + static: false pair: getVehicleComponentRotation notes: - type: info content: Before r6974 the component rotations went the wrong way (i.e. opposite to the vehicle rotations). This has been corrected, so you'll have to modify any scripts written before r6974 that use this function. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleComponentScale.yaml b/functions/Vehicle/setVehicleComponentScale.yaml index 6c482f9f..39cd1063 100644 --- a/functions/Vehicle/setVehicleComponentScale.yaml +++ b/functions/Vehicle/setVehicleComponentScale.yaml @@ -1,12 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleComponentScale -client: +shared: name: setVehicleComponentScale description: This function sets the component scale of a [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to set component scale. + - name: theComponent + type: string + description: A vehicle component (this is the frame name from the model file of + the component you wish to modify) + - name: scaleX + type: float + description: The new x scale of this component. + - name: scaleY + type: float + description: The new y scale of this component. + - name: scaleZ + type: float + description: The new z scale of this component. + - name: base + type: string + description: 'A string representing what the supplied scale ( scaleX , scaleY + , scaleZ ) is relative to. It can be one of the following values: parent : The + scale is relative to the parent component. root : The scale is relative to the + root component. world : The scale is a world scale, relative to the world''s + center of coordinates.' + default: '"parent"' examples: - path: examples/setVehicleComponentScale-1.lua description: Example 1:This example would set the scale of the component. side: client + returns: + values: + - type: bool + name: value + description: Returns true if component scale was set successfully, false otherwise. + oop: + element: vehicle + method: setComponentScale + static: false pair: getVehicleComponentScale - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleComponentVisible.yaml b/functions/Vehicle/setVehicleComponentVisible.yaml index dc4c6773..9a52bf93 100644 --- a/functions/Vehicle/setVehicleComponentVisible.yaml +++ b/functions/Vehicle/setVehicleComponentVisible.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleComponentVisible -client: +shared: name: setVehicleComponentVisible description: This function sets component visibility for [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to set component visibility of. + - name: theComponent + type: string + description: A vehicle component (this is the component's frame name (also called + 'dummy') from the vehicle model's DFF file of which you want to manipulate components) + - name: visible + type: bool + description: a bool which determines if the component should be visible examples: - path: examples/setVehicleComponentVisible-1.lua description: Example 1:This example hide all components when you enter a vehicle. side: client + returns: + values: + - type: bool + name: value + description: Returns a bool indicating if the visiblity was changed successfully. + oop: + element: vehicle + method: setComponentVisible + static: false pair: getVehicleComponentVisible - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleDamageProof.yaml b/functions/Vehicle/setVehicleDamageProof.yaml index caf73f5b..26de4f8b 100644 --- a/functions/Vehicle/setVehicleDamageProof.yaml +++ b/functions/Vehicle/setVehicleDamageProof.yaml @@ -1,14 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleDamageProof -server: +shared: name: setVehicleDamageProof description: This functions makes a vehicle damage proof, so it won't take damage from bullets, hits, explosions or fire. A damage proof's vehicle health can still be changed via script. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to make damage proof. + - name: damageProof + type: bool + description: true is damage proof, false is damageable. examples: - path: examples/setVehicleDamageProof-1.lua description: This example spawns a vehicle and sets it damage proof immediately. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was set damage proof succesfully, false + if the arguments are invalid or it failed. + oop: + element: vehicle + method: setDamageProof + variable: damageProof + static: false pair: isVehicleDamageProof notes: - type: info @@ -16,4 +33,4 @@ server: able to get knocked off anymore, even if setPedCanBeKnockedOffBike is set to true. Consider using and cancelling the onVehicleDamage / onClientVehicleDamage events instead. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleDoorOpenRatio.yaml b/functions/Vehicle/setVehicleDoorOpenRatio.yaml index f18b8943..68b208de 100644 --- a/functions/Vehicle/setVehicleDoorOpenRatio.yaml +++ b/functions/Vehicle/setVehicleDoorOpenRatio.yaml @@ -1,13 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleDoorOpenRatio -server: +shared: name: setVehicleDoorOpenRatio description: This function sets how much a vehicle's door is open. Doors include the boot/trunk and the bonnet of the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: door + type: int + description: MISSING_PARAM_DESC + - name: ratio + type: float + description: MISSING_PARAM_DESC + - name: time + type: int + description: MISSING_PARAM_DESC + default: '0' examples: - path: examples/setVehicleDoorOpenRatio-1.lua description: This example opens all the doors of the vehicle gradually over 2.5 seconds. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the door open ratio was successfully set, false if + invalid arguments are passed. + oop: + element: vehicle + method: setDoorOpenRatio + static: false pair: getVehicleDoorOpenRatio - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleDoorState.yaml b/functions/Vehicle/setVehicleDoorState.yaml index 8619663b..6ecfcc66 100644 --- a/functions/Vehicle/setVehicleDoorState.yaml +++ b/functions/Vehicle/setVehicleDoorState.yaml @@ -1,15 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleDoorState -server: +shared: name: setVehicleDoorState description: This function sets the state of the specified door on a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: door + type: int + description: MISSING_PARAM_DESC + - name: state + type: int + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleDoorState-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the door state was successfully set, false otherwise. + oop: + element: vehicle + method: setDoorState + static: false pair: getVehicleDoorState notes: - type: info content: This parameter doesn't work during the vehicle creation. You need a SetTimer if you need to create the vehicle using this parameter. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleDoorsUndamageable.yaml b/functions/Vehicle/setVehicleDoorsUndamageable.yaml index 4ce620a8..7ed27aa3 100644 --- a/functions/Vehicle/setVehicleDoorsUndamageable.yaml +++ b/functions/Vehicle/setVehicleDoorsUndamageable.yaml @@ -1,13 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleDoorsUndamageable -server: +shared: name: setVehicleDoorsUndamageable description: This function makes a vehicle's doors undamageable, so they won't fall off when they're hit. Note that the vehicle **has** to be locked using [setVehicleLocked](/wiki/SetVehicleLocked "SetVehicleLocked") for this setting to have any effect. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle of which you wish to set the car door damageability. + - name: state + type: bool + description: A boolean denoting whether the vehicle's doors are undamageable ( + true ) or damageable ( false ). examples: - path: examples/setVehicleDoorsUndamageable-1.lua description: Here you can disable all vehicles doors damage with /nodamage, and enable it with /adddamage. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the damageability state was successfully changed, + false if invalid arguments were passed. + oop: + element: vehicle + method: setDoorsUndamageable + variable: doorsUndamageable + static: false + requires_review: true diff --git a/functions/Vehicle/setVehicleDummyPosition.yaml b/functions/Vehicle/setVehicleDummyPosition.yaml index 926303cb..087220d1 100644 --- a/functions/Vehicle/setVehicleDummyPosition.yaml +++ b/functions/Vehicle/setVehicleDummyPosition.yaml @@ -1,12 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleDummyPosition -client: +shared: name: setVehicleDummyPosition description: This function sets the position of the dummy for the given [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you want to set the dummy position for. + - name: dummy + type: string + description: The dummy whose position you want to set. + - name: x + type: float + description: '' + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the dummy position has been successfully set, false + otherwise. + oop: + element: vehicle + method: setDummyPosition + static: false pair: getVehicleDummyPosition - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -14,3 +38,4 @@ client: - Missing section: Allowed Dummies ' + requires_review: true diff --git a/functions/Vehicle/setVehicleEngineState.yaml b/functions/Vehicle/setVehicleEngineState.yaml index 9b774595..a91fa59c 100644 --- a/functions/Vehicle/setVehicleEngineState.yaml +++ b/functions/Vehicle/setVehicleEngineState.yaml @@ -1,10 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleEngineState -server: +shared: name: setVehicleEngineState description: This function turns a vehicle's engine on or off. Note that the engine will always be turned on when someone enters the driver seat, unless you override that behaviour with scripts. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the engine state of. + - name: engineState + type: bool + description: A boolean value representing whether the engine will be turned on + ( true ) or off ( false ). examples: - path: examples/setVehicleEngineState-1.lua description: This example lets the driver toggle vehicle engine on/off. @@ -13,5 +20,16 @@ server: description: This example will turn off a vehicle's engine when the driver gets out of the car. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's engine state was successfully changed, + false otherwise. + oop: + element: vehicle + method: setEngineState + variable: engineState + static: false pair: getVehicleEngineState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleFuelTankExplodable.yaml b/functions/Vehicle/setVehicleFuelTankExplodable.yaml index 8f11212c..ee24d575 100644 --- a/functions/Vehicle/setVehicleFuelTankExplodable.yaml +++ b/functions/Vehicle/setVehicleFuelTankExplodable.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleFuelTankExplodable -server: +shared: name: setVehicleFuelTankExplodable description: This function changes the 'explodable state' of a vehicle's fuel tank, which toggles the ability to blow the vehicle up by shooting the tank. This function will have no effect on vehicles with tanks that cannot be shot in single player. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the fuel tank explodable state of. + - name: explodable + type: bool + description: A boolean value representing whether or not the fuel tank will be + explodable. examples: - path: examples/setVehicleFuelTankExplodable-1.lua description: This example will make vehicles' fuel tanks explodable for 10 seconds after they're entered. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's fuel tank explodable state was successfully + changed, false otherwise. + oop: + element: vehicle + method: setFuelTankExplodable + static: false + requires_review: true diff --git a/functions/Vehicle/setVehicleGravity.yaml b/functions/Vehicle/setVehicleGravity.yaml index 48a59d96..9d19079e 100644 --- a/functions/Vehicle/setVehicleGravity.yaml +++ b/functions/Vehicle/setVehicleGravity.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleGravity -client: +shared: name: setVehicleGravity description: Sets the gravity vector of a vehicle. The vehicle will fall in this direction, and the camera of any occupants will also be rotated to match it. Can be used for e.g. driving on walls or upside down on ceilings. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle of which to change the gravity. + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleGravity-1.lua description: This example will set 0 gravity to the vehicle if a local player enters it side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/Vehicle/setVehicleHandling.yaml b/functions/Vehicle/setVehicleHandling.yaml index 8c5cf695..4e182d18 100644 --- a/functions/Vehicle/setVehicleHandling.yaml +++ b/functions/Vehicle/setVehicleHandling.yaml @@ -1,8 +1,17 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleHandling -server: +shared: name: setVehicleHandling description: This function is used to change the handling data of a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: element + description: The vehicle you wish to set the handling of. + - name: property + type: string + description: The property you wish to set the handling of the vehicle to. + - name: value + type: var + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleHandling-1.lua description: '' @@ -13,6 +22,12 @@ server: - path: examples/setVehicleHandling-3.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: 'Returns true if the handling was set successfully, false otherwise. + See below a list of valid properties and their required values:' notes: - type: info content: For functionality reasons, suspension modification is disabled on monster @@ -22,4 +37,4 @@ server: - type: warning content: To change handling values of aircraft like maxVelocity , you must first set setAircraftMaxVelocity . - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleHeadLightColor.yaml b/functions/Vehicle/setVehicleHeadLightColor.yaml index 9c7fb0a8..465c0d2e 100644 --- a/functions/Vehicle/setVehicleHeadLightColor.yaml +++ b/functions/Vehicle/setVehicleHeadLightColor.yaml @@ -1,13 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleHeadLightColor -server: +shared: name: setVehicleHeadLightColor description: This function will set the headlight color of a vehicle. valid Red Green and Blue arguments range from 0\-255 - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to set the headlight color of. + - name: red + type: int + description: An integer indicating the amount of red for the vehicle's headlights + - name: green + type: int + description: An integer indicating the amount of green for the vehicle's headlights + - name: blue + type: int + description: An integer indicating the amount of blue for the vehicle's headlights examples: - path: examples/setVehicleHeadLightColor-1.lua description: It shows error if player isn't in vehicle or color failed to change. It shows a message if color changed successful. side: server + returns: + values: + - type: bool + name: value + description: Returns true if vehicle's headlight color was set, false if an invalid + vehicle or invalid color ranges were specified for red,green or blue. + oop: + element: vehicle + method: setHeadLightColor + static: false pair: getVehicleHeadLightColor - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleIdleRespawnDelay.yaml b/functions/Vehicle/setVehicleIdleRespawnDelay.yaml index b9b55de6..be516329 100644 --- a/functions/Vehicle/setVehicleIdleRespawnDelay.yaml +++ b/functions/Vehicle/setVehicleIdleRespawnDelay.yaml @@ -1,16 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleIdleRespawnDelay -server: +shared: name: setVehicleIdleRespawnDelay description: This function sets the time delay (in milliseconds) the vehicle will remain at its position while empty. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the respawn delay of. + - name: timeDelay + type: int + description: The number of milliseconds the vehicle will be allowed to remain + unused until it respawns. examples: - path: examples/setVehicleIdleRespawnDelay-1.lua description: This example creates a vehicle and sets its respawn delay to 20 seconds. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was found and edited. + oop: + element: vehicle + method: setIdleRespawnDelay + variable: idleRespawnDelay + static: false pair: getVehicleIdleRespawnDelay notes: - type: important content: toggleVehicleRespawn must be set to true for this function to have any effect - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleLandingGearDown.yaml b/functions/Vehicle/setVehicleLandingGearDown.yaml index afae7f70..11c10617 100644 --- a/functions/Vehicle/setVehicleLandingGearDown.yaml +++ b/functions/Vehicle/setVehicleLandingGearDown.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleLandingGearDown -server: +shared: name: setVehicleLandingGearDown description: This function is used to set the landing gear state of certain vehicles. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle of which you wish to set the landing gear state. + - name: gearState + type: bool + description: A bool representing the state of the landing gear. true represents + a collapsed landing gear, while false represents a disabled landing gear. examples: - path: examples/setVehicleLandingGearDown-1.lua description: This example sets the landing gear up and outputs to the player to pull up side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the landing gear was set successfully, false otherwise. + requires_review: true diff --git a/functions/Vehicle/setVehicleLightState.yaml b/functions/Vehicle/setVehicleLightState.yaml index 5ee1a0ae..147cabde 100644 --- a/functions/Vehicle/setVehicleLightState.yaml +++ b/functions/Vehicle/setVehicleLightState.yaml @@ -1,11 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleLightState -server: +shared: name: setVehicleLightState description: This function sets the state of the light on the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: light + type: int + description: MISSING_PARAM_DESC + - name: state + type: int + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleLightState-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the light state was set successfully, false if invalid + arguments were passed to the function. + oop: + element: vehicle + method: setLightState + static: false pair: getVehicleLightState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleLocked.yaml b/functions/Vehicle/setVehicleLocked.yaml index 4cd671db..916c690a 100644 --- a/functions/Vehicle/setVehicleLocked.yaml +++ b/functions/Vehicle/setVehicleLocked.yaml @@ -1,18 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleLocked -server: +shared: name: setVehicleLocked description: This function can be used to set the vehicle's doors to be locked or unlocked. Locking a vehicle restricts access to the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle which you wish to change the lock status of + - name: locked + type: bool + description: Boolean for the status you wish to set. Set true to lock, false to + unlock examples: - path: examples/setVehicleLocked-1.lua description: This example allows a player to lock his vehicle when he is inside it. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the operation was successful, false otherwise. + oop: + element: vehicle + method: setLocked + variable: locked + static: false pair: isVehicleLocked notes: - type: warning content: This function only prevents the player from opening the vehicle doors. It means that a player can still access a locked vehicle if there's an opened door. Also, vehicles that doesn't have doors can still be accessed aswell. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleModelDummyPosition.yaml b/functions/Vehicle/setVehicleModelDummyPosition.yaml index 4ad688ef..33128927 100644 --- a/functions/Vehicle/setVehicleModelDummyPosition.yaml +++ b/functions/Vehicle/setVehicleModelDummyPosition.yaml @@ -1,17 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleModelDummyPosition -client: +shared: name: setVehicleModelDummyPosition description: This function sets the position of the dummies contained in a vehicle model. Use [setVehicleComponentPosition](/wiki/SetVehicleComponentPosition "SetVehicleComponentPosition") to adjust the vehicle component positions. - parameters: [] + parameters: + - name: modelID + type: int + description: The model ID which you want to apply the change to + - name: dummy + type: string + description: The dummy whose position you want to change + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleModelDummyPosition-1.lua description: Given example will move all the dummies in vehicle that player is sitting in up and down, after he uses /move command. side: client + returns: + values: + - type: bool + name: value + description: Returns true if everything went fine, false otherwise. + oop: + element: Vehicle + method: ) + static: true pair: getVehicleModelDummyPosition - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -19,3 +42,4 @@ client: - Missing section: Allowed dummies ' + requires_review: true diff --git a/functions/Vehicle/setVehicleModelExhaustFumesPosition.yaml b/functions/Vehicle/setVehicleModelExhaustFumesPosition.yaml index bf2c8ae9..1fda1af3 100644 --- a/functions/Vehicle/setVehicleModelExhaustFumesPosition.yaml +++ b/functions/Vehicle/setVehicleModelExhaustFumesPosition.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleModelExhaustFumesPosition -client: +shared: name: setVehicleModelExhaustFumesPosition description: This function sets the position of the exhaust fumes the vehicle model emits. Use [setVehicleComponentPosition](/wiki/SetVehicleComponentPosition "SetVehicleComponentPosition") to adjust the exhaust position. - parameters: [] + parameters: + - name: modelID + type: int + description: The model ID which you want to apply the change to + - name: posX + type: float + description: The desired position + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setVehicleModelExhaustFumesPosition-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if everything went fine, false otherwise. + oop: + element: Vehicle + method: ) + static: true pair: getVehicleModelExhaustFumesPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleModelWheelSize.yaml b/functions/Vehicle/setVehicleModelWheelSize.yaml index b833911c..45b013db 100644 --- a/functions/Vehicle/setVehicleModelWheelSize.yaml +++ b/functions/Vehicle/setVehicleModelWheelSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleModelWheelSize -client: +shared: name: setVehicleModelWheelSize description: This function sets the size of a group of wheels for a [vehicle model](/wiki/Vehicle_IDs "Vehicle IDs"). The wheel size mainly determines their width, collision box (used @@ -8,7 +8,23 @@ client: to the ground). It also changes the visual scale and rotation of the wheels, if not all the wheel groups have equal size. The visual scaling is applied before the per\-vehicle [wheel scale](/wiki/SetVehicleWheelScale "SetVehicleWheelScale"). - parameters: [] + parameters: + - name: vehicleModel + type: int + description: The vehicle model ID. + - name: wheelGroup + type: string + description: 'The group of wheels of the vehicle model that will have its size + set by this function. The following values are supported: front_axle : Represents + the wheels in the front axle. The default value for this group is read by GTA + from the WheelScale_Front field of the vehicles.ide data file. rear_axle : Represents + the wheels in the rear axle. The default value for this group is read by GTA + from the WheelScale_Rear field of the vehicles.ide data file. all_wheels : Convenience + group that contains the other wheel groups: front_axle and rear_axle .' + - name: wheelSize + type: float + description: The wheel size value to set. Default GTA values for automobiles usually + are around 0.7. It must be greater than 0. examples: - path: examples/setVehicleModelWheelSize-1.lua description: This example replaces the Infernus model with a Huntley model and @@ -19,5 +35,15 @@ client: description: This example sets the rear axle size of the Bandito to a high value, to showcase its effect and make it more funky. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the size for the specified wheel group and vehicle + model has been set successfully, or an error if some parameter is invalid. + oop: + element: Vehicle + method: ) + static: true pair: getVehicleModelWheelSize - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleNitroActivated.yaml b/functions/Vehicle/setVehicleNitroActivated.yaml index 24c9d72c..fd361e0e 100644 --- a/functions/Vehicle/setVehicleNitroActivated.yaml +++ b/functions/Vehicle/setVehicleNitroActivated.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleNitroActivated -server: +shared: name: setVehicleNitroActivated description: This function activates or deactivates the nitro on the specified [vehicle](/wiki/Vehicle "Vehicle"), like if a player pressed the button for activating nitro. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' + - name: state + type: bool + description: '' examples: - path: examples/setVehicleNitroActivated-1.lua description: This example adds and activates nitro in the vehicle the player enters. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the nitro activation state was modified successfully, + false otherwise. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleNitroCount.yaml b/functions/Vehicle/setVehicleNitroCount.yaml index 0e55497a..5dbdaba8 100644 --- a/functions/Vehicle/setVehicleNitroCount.yaml +++ b/functions/Vehicle/setVehicleNitroCount.yaml @@ -1,15 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleNitroCount -client: +shared: name: setVehicleNitroCount description: This function sets how many times a player can activate the nitro on a specified [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle which you want to modify how many times a player can + use its nitro. + - name: count + type: int + description: how many times should the player be able to use the nitro of this + vehicle (from 0-100 times; 0 means that it can't be used and 101 means that + it can be used infinite times). examples: - path: examples/setVehicleNitroCount-1.lua description: This function installs nitro in the vehicle a player enters and then makes it usable only twice. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the nitro count was set successfully to the vehicle, + false otherwise. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleNitroLevel.yaml b/functions/Vehicle/setVehicleNitroLevel.yaml index fad35bcd..75cac6b0 100644 --- a/functions/Vehicle/setVehicleNitroLevel.yaml +++ b/functions/Vehicle/setVehicleNitroLevel.yaml @@ -1,14 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleNitroLevel -client: +shared: name: setVehicleNitroLevel description: This function sets the nitro level of the [vehicle](/wiki/Vehicle "Vehicle"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: '' + - name: level + type: float + description: '' examples: - path: examples/setVehicleNitroLevel-1.lua description: This function installs nitrous to the vehicle and sets the level of it to 0.1 when a player enters the vehicle. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the nitro level was set successfully to the vehicle, + false otherwise. notes: - type: warning content: Only works if the vehicle is streamed in. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleOverrideLights.yaml b/functions/Vehicle/setVehicleOverrideLights.yaml index 86b263c5..cc107638 100644 --- a/functions/Vehicle/setVehicleOverrideLights.yaml +++ b/functions/Vehicle/setVehicleOverrideLights.yaml @@ -1,8 +1,16 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleOverrideLights -server: +shared: name: setVehicleOverrideLights description: This function changes the light overriding setting on a vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the override lights setting of. + - name: value + type: int + description: 'A whole number representing the state of the lights: 0 : No override, + lights are set to default. 1 : Lights are forced off. 2 : Lights are forced + on.' examples: - path: examples/setVehicleOverrideLights-1.lua description: This example will toggle the car lights on and off for a player's @@ -12,5 +20,16 @@ server: description: This example will toggle the car lights on and off for a player's vehicle by using a "vehiclelights" command. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's lights setting was changed. Otherwise + false . + oop: + element: vehicle + method: setOverrideLights + variable: overrideLights + static: false pair: getVehicleOverrideLights - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehiclePaintjob.yaml b/functions/Vehicle/setVehiclePaintjob.yaml index 60ef496f..3edeb249 100644 --- a/functions/Vehicle/setVehiclePaintjob.yaml +++ b/functions/Vehicle/setVehiclePaintjob.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehiclePaintjob -server: +shared: name: setVehiclePaintjob description: "This function changes the paintjob on the specified vehicle. \n\n\ See [paintjob](/wiki/Paintjob \"Paintjob\") for list of supported vehicles.\n\ To remove a paintjob from a vehicle, apply paintjob number **3** to it." - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the paintjob of. + - name: value + type: int + description: A whole number representing the new paintjob id. Ranges from 0 up + to 3. examples: - path: examples/setVehiclePaintjob-1.lua description: This example will set the paintjob of a new sultan to '2'. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle's paintjob was changed. Otherwise false + . + requires_review: true diff --git a/functions/Vehicle/setVehiclePanelState.yaml b/functions/Vehicle/setVehiclePanelState.yaml index 5bde76fe..c774be21 100644 --- a/functions/Vehicle/setVehiclePanelState.yaml +++ b/functions/Vehicle/setVehiclePanelState.yaml @@ -1,14 +1,40 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehiclePanelState -server: +shared: name: setVehiclePanelState description: This function allows you to change the state of one of the six panels vehicle's can have. When executed on the server\-side resources, the damage will be synched for all players, whereas the change is only client\-side if the function is used in a client resource. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: panelID + type: int + description: MISSING_PARAM_DESC + - name: state + type: int + description: MISSING_PARAM_DESC + - name: spawnFlyingComponent + type: bool + description: MISSING_PARAM_DESC + default: 'true' + - name: breakGlass + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setVehiclePanelState-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the panel state has been updated, false otherwise + oop: + element: vehicle + method: setPanelState + static: false pair: getVehiclePanelState - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehiclePlateText.yaml b/functions/Vehicle/setVehiclePlateText.yaml index a10d34f3..d132f221 100644 --- a/functions/Vehicle/setVehiclePlateText.yaml +++ b/functions/Vehicle/setVehiclePlateText.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehiclePlateText -server: +shared: name: setVehiclePlateText description: 'This function can be used to set the numberplate text of a vehicle. All non ascii characters will be replaced by spaces.' - parameters: [] + parameters: + - name: theVehicle + type: element + description: the vehicle whose numberplate you want to change. + - name: numberplate + type: string + description: a string that will go on the number plate of the vehicle (max 8 characters). examples: - path: examples/setVehiclePlateText-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the numberplate was changed successfully, or false + if invalid arguments were passed + oop: + element: vehicle + method: setPlateText + variable: plateText + static: false pair: getVehiclePlateText - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleRespawnDelay.yaml b/functions/Vehicle/setVehicleRespawnDelay.yaml index 08cbff38..51569443 100644 --- a/functions/Vehicle/setVehicleRespawnDelay.yaml +++ b/functions/Vehicle/setVehicleRespawnDelay.yaml @@ -1,17 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleRespawnDelay -server: +shared: name: setVehicleRespawnDelay description: This function sets the time delay (in milliseconds) the vehicle will remain wrecked before respawning. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the respawn delay of. + - name: timeDelay + type: int + description: The amount of milliseconds to delay. examples: - path: examples/setVehicleRespawnDelay-1.lua description: This example creates a vehicle and makes it so that it will respawn at its original position 20 seconds after it has blown up. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was found and edited. + oop: + element: vehicle + method: setRespawnDelay + variable: respawnDelay + static: false pair: getVehicleRespawnDelay notes: - type: important content: toggleVehicleRespawn must be set to true for this function to have any effect - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleRespawnPosition.yaml b/functions/Vehicle/setVehicleRespawnPosition.yaml index 399a44ef..f865d1d2 100644 --- a/functions/Vehicle/setVehicleRespawnPosition.yaml +++ b/functions/Vehicle/setVehicleRespawnPosition.yaml @@ -1,11 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleRespawnPosition -server: +shared: name: setVehicleRespawnPosition description: This function sets the position (and rotation) the vehicle will respawn to. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the respawn position of. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: rx + type: float + description: A floating point number representing the rotation about the X axis + in Degrees. + - name: ry + type: float + description: A floating point number representing the rotation about the Y axis + in Degrees. + - name: rz + type: float + description: A floating point number representing the rotation about the Z axis + in Degrees. examples: - path: examples/setVehicleRespawnPosition-1.lua description: This example creates a vehicle and changes its respawn position. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was found and edited, false otherwise. + oop: + element: vehicle + method: setRespawnPosition + variable: respawnPosition + static: false + requires_review: true diff --git a/functions/Vehicle/setVehicleRespawnRotation.yaml b/functions/Vehicle/setVehicleRespawnRotation.yaml index 0313cf5e..bf83234e 100644 --- a/functions/Vehicle/setVehicleRespawnRotation.yaml +++ b/functions/Vehicle/setVehicleRespawnRotation.yaml @@ -1,10 +1,33 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleRespawnRotation -server: +shared: name: setVehicleRespawnRotation description: This function sets the rotation the vehicle will respawn to. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to change the respawn position of. + - name: rx + type: float + description: A float representing the rotation about the X axis in degrees. + - name: ry + type: float + description: A float representing the rotation about the Y axis in degrees. + - name: rz + type: float + description: A float representing the rotation about the Z axis in degrees. examples: - path: examples/setVehicleRespawnRotation-1.lua description: This example creates a vehicle and changes its respawn rotation. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle respawn rotation was set successfully, + false otherwise. + oop: + element: vehicle + method: setRespawnRotation + variable: respawnRotation + static: false + requires_review: true diff --git a/functions/Vehicle/setVehicleRotorSpeed.yaml b/functions/Vehicle/setVehicleRotorSpeed.yaml index 7386966c..492ae54e 100644 --- a/functions/Vehicle/setVehicleRotorSpeed.yaml +++ b/functions/Vehicle/setVehicleRotorSpeed.yaml @@ -1,15 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleRotorSpeed -client: +shared: name: setVehicleRotorSpeed description: Sets the rotor speed of a helicopter or plane. This function now applies to both helicopters and planes. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle (helicopter or plane) to adjust the rotor of. + - name: speed + type: float + description: the new rotor speed. Usual values are 0 if the vehicle is stationary, + or 0.2 if the rotor is fully spun up. Higher values than normal will not affect + the vehicle's handling. Negative values are allowed and will make the rotor + spin in the opposite direction (for helicopters, this pushes it down). examples: - path: examples/setVehicleRotorSpeed-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: vehicle + method: setVehicleRotorSpeed + variable: vehicleRotorSpeed + static: false pair: getVehicleRotorSpeed notes: - type: info content: Setting higher values will cause problems to the client - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleRotorState.yaml b/functions/Vehicle/setVehicleRotorState.yaml index d9bef481..fc445f24 100644 --- a/functions/Vehicle/setVehicleRotorState.yaml +++ b/functions/Vehicle/setVehicleRotorState.yaml @@ -1,17 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleRotorState -client: +shared: name: setVehicleRotorState description: Turns the rotor on/off for an plane or helicopter. A vehicle with the rotor turned off cannot hover in the air. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle (helicopter or plane) whose rotor you want to toggle. + - name: state + type: bool + description: The rotor state, which determines whether it should be on ( true + ) or off ( false ). + - name: stopRotor + type: bool + description: Specifies whether the rotor should be stopped after being turned + off. If false, the rotor will continue spinning at a constant speed (it won't + slow down or accelerate). It will also not be able to lift off the ground. You + can also use setVehicleRotorSpeed to manage the rotor speed. + default: 'true' examples: - path: examples/setVehicleRotorState-1.lua description: This example code will add a command called '/rotorstart' that will either shut your vehicle's rotors off or start them up again. Do note that once rotors are stopped you will simply fall from the sky. side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: vehicle + method: setRotorState + variable: rotorState + static: false pair: getVehicleRotorState notes: - type: info content: The function should not be confused with setVehicleEngineState . - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleSirens.yaml b/functions/Vehicle/setVehicleSirens.yaml index 77b0de06..21f3800a 100644 --- a/functions/Vehicle/setVehicleSirens.yaml +++ b/functions/Vehicle/setVehicleSirens.yaml @@ -1,17 +1,59 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleSirens -server: +shared: name: setVehicleSirens description: This function changes the properties of a vehicles siren point. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle to modify + - name: sirenPoint + type: int + description: The siren point to modify + - name: posX + type: float + description: The x position of this siren point from the center of the vehicle + - name: posY + type: float + description: The y position of this siren point from the center of the vehicle + - name: posZ + type: float + description: The z position of this siren point from the center of the vehicle + - name: red + type: float + description: The amount of red from 0 to 255 + - name: green + type: float + description: The amount of green from 0 to 255 + - name: blue + type: float + description: The amount of blue from 0 to 255 + - name: alpha + type: float + description: The alpha of the siren from 0 to 255 + default: '255' + - name: minAlpha + type: float + description: The minimum alpha of the light during day time + default: '0.0' examples: - path: examples/setVehicleSirens-1.lua description: This example adds a siren for the vehicle, then sets two custom sirens at the top of the vehicle. And then removes the siren when getting out the vehicle. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the siren point was successfully changed on the vehicle, + false otherwise. + oop: + element: vehicle + method: setSirens + static: false pair: getVehicleSirens notes: - type: info content: Although you may be able to add sirens to any vehice, this function may not work. This function fails on certain vehicle models ( https://wiki.multitheftauto.com/wiki/Vehicle_IDs#Lua_table_of_vehicles_that_doesn.27t_support_siren_lights ). - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleSirensOn.yaml b/functions/Vehicle/setVehicleSirensOn.yaml index 4126fb56..c66b46e0 100644 --- a/functions/Vehicle/setVehicleSirensOn.yaml +++ b/functions/Vehicle/setVehicleSirensOn.yaml @@ -1,12 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleSirensOn -server: +shared: name: setVehicleSirensOn description: This function changes the state of the sirens on the specified vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that will have the sirens set + - name: sirensOn + type: bool + description: The state to set the sirens to examples: - path: examples/setVehicleSirensOn-1.lua description: This example toggles siren state when a player enters a vehicle as a driver. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the sirens are set for the specified vehicle, false + if the sirens can't be set for the specified vehicle, if the vehicle doesn't + have sirens or if invalid arguments are specified. + oop: + element: vehicle + method: setSirensOn + variable: sirensOn + static: false pair: getVehicleSirensOn - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleSmokeTrailEnabled.yaml b/functions/Vehicle/setVehicleSmokeTrailEnabled.yaml index 109bb5b8..ff32c02b 100644 --- a/functions/Vehicle/setVehicleSmokeTrailEnabled.yaml +++ b/functions/Vehicle/setVehicleSmokeTrailEnabled.yaml @@ -1,14 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleSmokeTrailEnabled -client: +shared: name: setVehicleSmokeTrailEnabled description: This function used to set planes smoke trail enabled or disabled. - parameters: [] + parameters: + - name: veh + type: vehicle + description: The vehicle that you want to set the smoke trail. + - name: enable + type: bool + description: A boolean if set to true it will enabled the smoke trail. examples: - path: examples/setVehicleSmokeTrailEnabled-1.lua description: This example let you set the smoke trail. side: client + returns: + values: + - type: setVehicleSmokeTrailEnabled + name: value + description: If successful returns true , false otherwise. + oop: + element: vehicle + method: setSmokeTrailEnabled + static: false notes: - type: info content: The smoke trail is only supported to models 512 and 513, so this only going to works with that models - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleTaxiLightOn.yaml b/functions/Vehicle/setVehicleTaxiLightOn.yaml index 610c09b2..65053834 100644 --- a/functions/Vehicle/setVehicleTaxiLightOn.yaml +++ b/functions/Vehicle/setVehicleTaxiLightOn.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleTaxiLightOn -server: +shared: name: setVehicleTaxiLightOn description: This function will set the taxi light on in a taxi (vehicle ID's 420 and 438\) - parameters: [] + parameters: + - name: taxi + type: vehicle + description: The vehicle element of the taxi that you wish to turn the light on. + - name: LightState + type: bool + description: whether the light is on. True for on, False for off. examples: - path: examples/setVehicleTaxiLightOn-1.lua description: This example allows the driver of a taxi to toggle on/off taxi light with a command side: server + returns: + values: + - type: bool + name: value + description: Returns true if the state was successfully set, false otherwise. + oop: + element: vehicle + method: setTaxiLightOn + variable: taxiLightOn + static: false pair: isVehicleTaxiLightOn - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleTurretPosition.yaml b/functions/Vehicle/setVehicleTurretPosition.yaml index b5384bf3..e15a0287 100644 --- a/functions/Vehicle/setVehicleTurretPosition.yaml +++ b/functions/Vehicle/setVehicleTurretPosition.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleTurretPosition -server: +shared: name: setVehicleTurretPosition description: This function sets the position of a vehicle's turret, if it has one. This can be used to influence the turret's rotation, so it doesn't follow the camera. Vehicles with turrets include firetrucks and tanks. - parameters: [] + parameters: + - name: turretVehicle + type: vehicle + description: The vehicle whose turret position you want to retrieve. This should + be a vehicle with a turret. + - name: positionX + type: float + description: The horizontal position of the turret. In radians + - name: positionY + type: float + description: The vertical position of the turret. In radians examples: - path: examples/setVehicleTurretPosition-1.lua description: This example will force vehicle turrets to aim straight forwards. side: server + returns: + values: + - type: bool + name: value + description: Returns a true if a valid vehicle element and valid positions were + passed, false otherwise. + oop: + element: vehicle + method: setTurretPosition + variable: turretPosition + static: false pair: getVehicleTurretPosition - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleVariant.yaml b/functions/Vehicle/setVehicleVariant.yaml index ad1c230e..e8a65ba1 100644 --- a/functions/Vehicle/setVehicleVariant.yaml +++ b/functions/Vehicle/setVehicleVariant.yaml @@ -1,16 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleVariant -server: +shared: name: setVehicleVariant description: 'This function sets the variant of a specified vehicle. In GTA: San Andreas some vehicles are different; for example the labelling on trucks or the contents of a pick\-up truck and the varying types of a motor bike. For the default variant list see: [Vehicle variants](/wiki/Vehicle_variants "Vehicle variants").' - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you want to set the variant. + - name: variant1 + type: int + description: An integer for the first variant. See Vehicle variants . + - name: variant2 + type: int + description: An integer for the second variant. See Vehicle variants . examples: - path: examples/setVehicleVariant-1.lua description: 'This example lets the vehicle driver set their vehicle''s variant with a command:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle variants were successfully set, false + otherwise (the specified vehicle doesn't exist or the specified variants are + invalid). + oop: + element: vehicle + method: setVariant + static: false pair: getVehicleVariant notes: - type: info @@ -23,4 +43,4 @@ server: - type: tip content: If you only want one variant, set ' variant2' to 255 . If you want no variants, then set both ' variant1' and ' variant2' to 255 . - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleWheelScale.yaml b/functions/Vehicle/setVehicleWheelScale.yaml index 562a9c7f..86689c7f 100644 --- a/functions/Vehicle/setVehicleWheelScale.yaml +++ b/functions/Vehicle/setVehicleWheelScale.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleWheelScale -client: +shared: name: setVehicleWheelScale description: This function sets the scale of all the wheels of a [vehicle](/wiki/Vehicle "Vehicle"). The wheel scale multiplies the visible height and length (but not @@ -7,12 +7,29 @@ client: handling, similarly to [setVehicleComponentScale](/wiki/SetVehicleComponentScale "SetVehicleComponentScale"). The wheel scale is applied after the [model wheel size](/wiki/SetVehicleModelWheelSize "SetVehicleModelWheelSize"). - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle whose wheel scale you wish to modify. + - name: wheelScale + type: float + description: The wheel scale value to set. examples: - path: examples/setVehicleWheelScale-1.lua description: This example adds ashrinkwheelscommand that reduces the wheel scale of a vehicle in half each time it is invoked. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the wheel scale has been set successfully, or an + error if some parameter is invalid. + oop: + element: vehicle + method: setWheelScale + variable: wheelScale + static: false pair: getVehicleWheelScale notes: - type: info @@ -23,4 +40,4 @@ client: the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade is the size of the wheels in the front axle of the vehicle model. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/setVehicleWheelStates.yaml b/functions/Vehicle/setVehicleWheelStates.yaml index 65b1bf94..33a65af9 100644 --- a/functions/Vehicle/setVehicleWheelStates.yaml +++ b/functions/Vehicle/setVehicleWheelStates.yaml @@ -1,8 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleWheelStates -server: +shared: name: setVehicleWheelStates description: This function sets the state of wheels on the vehicle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: MISSING_PARAM_DESC + - name: frontLeft + type: int + description: MISSING_PARAM_DESC + - name: rearLeft + type: int + description: MISSING_PARAM_DESC + default: '-1' + - name: frontRight + type: int + description: MISSING_PARAM_DESC + default: '-1' + - name: rearRight + type: int + description: MISSING_PARAM_DESC + default: '-1' examples: - path: examples/setVehicleWheelStates-1.lua description: This example displays the states of the vehicle's wheels and changes @@ -12,8 +30,17 @@ server: description: This example displays the states of the vehicle's wheels and changes their states if any arguments were passed. side: client + returns: + values: + - type: bool + name: value + description: Returns a boolean value true or false that tells you if it was successful + or not. + oop: + element: vehicle + method: setWheelStates + static: false pair: getVehicleWheelStates - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -21,3 +48,4 @@ server: - Missing section: Wheel-State values ' + requires_review: true diff --git a/functions/Vehicle/setVehicleWheelsRotation.yaml b/functions/Vehicle/setVehicleWheelsRotation.yaml index 19391c33..65a2186a 100644 --- a/functions/Vehicle/setVehicleWheelsRotation.yaml +++ b/functions/Vehicle/setVehicleWheelsRotation.yaml @@ -1,11 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleWheelsRotation -client: +shared: name: setVehicleWheelsRotation description: This function is used to manipulate the wheel rotation of a vehicle. Cars, Bikes (including BMX) and Trailers are supported. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: the vehicle whose wheel rotation is to be set. + - name: rotation + type: float + description: the new wheel rotation value. examples: - path: examples/setVehicleWheelsRotation-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/Vehicle/setVehicleWindowOpen.yaml b/functions/Vehicle/setVehicleWindowOpen.yaml index 50d2bcd3..8fd4d7f2 100644 --- a/functions/Vehicle/setVehicleWindowOpen.yaml +++ b/functions/Vehicle/setVehicleWindowOpen.yaml @@ -1,10 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehicleWindowOpen -client: +shared: name: setVehicleWindowOpen description: This function sets the vehicle window state. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle that you wish to change the window state. + - name: window + type: int + description: 'An integer representing window. 0: motorbike shield 1: rear window + 2: right front window 3: right back window 4: left front (driver) window 5: + left back window 6: windshield' + - name: open + type: bool + description: Boolean which represent window open state. examples: - path: examples/setVehicleWindowOpen-1.lua description: Command which allow player to open window which near sits. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Command which allow player to open window which near sits. + requires_review: true diff --git a/functions/Vehicle/spawnVehicle.yaml b/functions/Vehicle/spawnVehicle.yaml index 3a1bdf4f..37a970cb 100644 --- a/functions/Vehicle/spawnVehicle.yaml +++ b/functions/Vehicle/spawnVehicle.yaml @@ -1,10 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SpawnVehicle -server: +shared: name: spawnVehicle description: Spawns a vehicle at any given position and rotation - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to spawn + - name: x + type: float + description: The x position you wish to spawn the vehicle at + - name: "y" + type: float + description: The x position you wish to spawn the vehicle at + - name: z + type: float + description: The x position you wish to spawn the vehicle at + - name: rx + type: float + description: The x rotation you wish to spawn the vehicle at + - name: ry + type: float + description: The y rotation you wish to spawn the vehicle at + - name: rz + type: float + description: The z rotation you wish to spawn the vehicle at examples: - path: examples/spawnVehicle-1.lua description: With this feature, we spawn vehicle side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle spawned successfully, false if the passed + argument does not exist or is not a vehicle. + oop: + element: vehicle + method: spawn + static: false + requires_review: true diff --git a/functions/Vehicle/spawnVehicleFlyingComponent.yaml b/functions/Vehicle/spawnVehicleFlyingComponent.yaml index 1f2798cf..090c8012 100644 --- a/functions/Vehicle/spawnVehicleFlyingComponent.yaml +++ b/functions/Vehicle/spawnVehicleFlyingComponent.yaml @@ -1,13 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SpawnVehicleFlyingComponent -server: +shared: name: spawnVehicleFlyingComponent description: This function creates a dynamic (motion\-dependent) falling vehicle component. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle whose component is to be created. + - name: nodeIndex + type: number + description: Specifies the component to be created (ranging from 1 to 24 ). Depending + on the vehicle, these can be different components such as wheels, fenders, bicycle + handlebars, helicopter propellers, train carriages, and many more. Check Nodes + list . + - name: collisionType + type: number + description: 'Specifies the type of collision for the component, by default it + is selected based on the nodeIndex. 0: COL_BUMPER 1: COL_WHEEL 2: COL_DOOR 3: + COL_BONNET 4: COL_BOOT 5: COL_PANEL' + - name: removalTime + type: number + description: The time in milliseconds after which the created component will be + removed (it must be removed as it is a temporary object). If not specified, + the default time depends on the number of created components. examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if the component was created, false otherwise. + oop: + element: element + method: spawnFlyingComponent + static: false notes: - type: info content: The maximum number of components that can be created simultaneously is 150. Beyond this limit, no new components will be created until an existing component is removed and the count drops below 150. - incomplete: true + requires_review: true diff --git a/functions/Vehicle/toggleVehicleRespawn.yaml b/functions/Vehicle/toggleVehicleRespawn.yaml index 8722ae5f..b13e146d 100644 --- a/functions/Vehicle/toggleVehicleRespawn.yaml +++ b/functions/Vehicle/toggleVehicleRespawn.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ToggleVehicleRespawn -server: +shared: name: toggleVehicleRespawn description: This function toggles whether or not the vehicle will be respawned after blown or idle. - parameters: [] + parameters: + - name: theVehicle + type: vehicle + description: The vehicle you wish to toggle the respawning of. + - name: Respawn + type: bool + description: A boolean determining if the vehicle will respawn or not. examples: - path: examples/toggleVehicleRespawn-1.lua description: This example defines a console command that will disable respawning for the vehicle that the player is currently in. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the vehicle was found and edited. + oop: + element: vehicle + method: toggleRespawn + variable: respawnable + static: false pair: isVehicleRespawnable - incomplete: true + requires_review: true diff --git a/functions/Water/createWater.yaml b/functions/Water/createWater.yaml index 735399af..ffea4fbd 100644 --- a/functions/Water/createWater.yaml +++ b/functions/Water/createWater.yaml @@ -1,8 +1,48 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateWater -server: +shared: name: createWater description: Creates an area of [water](/wiki/Water "Water"). - parameters: [] + parameters: + - name: x1 + type: float + description: MISSING_PARAM_DESC + - name: y1 + type: float + description: MISSING_PARAM_DESC + - name: z1 + type: float + description: MISSING_PARAM_DESC + - name: x2 + type: float + description: MISSING_PARAM_DESC + - name: y2 + type: float + description: MISSING_PARAM_DESC + - name: z2 + type: float + description: MISSING_PARAM_DESC + - name: x3 + type: float + description: MISSING_PARAM_DESC + - name: y3 + type: float + description: MISSING_PARAM_DESC + - name: z3 + type: float + description: MISSING_PARAM_DESC + - name: x4 + type: float + description: MISSING_PARAM_DESC + - name: y4 + type: float + description: MISSING_PARAM_DESC + - name: z4 + type: float + description: MISSING_PARAM_DESC + - name: bShallow + type: bool + description: gives the water a shallow water effect. + default: 'false' examples: - path: examples/createWater-1.lua description: Example code for creating a water area to cover the entire San Andreas @@ -16,6 +56,16 @@ server: - path: examples/createWater-3.lua description: This example fills the Easter Basin with water. side: server + returns: + values: + - type: water + name: value + description: Returns a water element if successful, false otherwise. The water + element can be repositioned with setElementPosition and destroyed with destroyElement + . + oop: + element: water + constructorclass: Water notes: - type: info content: X and Y positions will be changed to an even integer. i.e. -2, 0, 2, @@ -23,4 +73,4 @@ server: - type: important content: If you're working with dimensions, be sure to apply it by using setElementDimension . - incomplete: true + requires_review: true diff --git a/functions/Water/getWaterColor.yaml b/functions/Water/getWaterColor.yaml index 4c0aae95..6fea39df 100644 --- a/functions/Water/getWaterColor.yaml +++ b/functions/Water/getWaterColor.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWaterColor -server: +shared: name: getWaterColor description: This function returns the water color of the GTA world. parameters: [] @@ -10,5 +10,20 @@ server: - path: examples/getWaterColor-2.lua description: '' side: server + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + description: Returns 4 ints , indicating the color of the water. (RGBA) + oop: + element: water + method: getColor + static: false pair: setWaterColor - incomplete: true + requires_review: true diff --git a/functions/Water/getWaterLevel.yaml b/functions/Water/getWaterLevel.yaml index a87c5fd0..7b94d256 100644 --- a/functions/Water/getWaterLevel.yaml +++ b/functions/Water/getWaterLevel.yaml @@ -1,18 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWaterLevel -client: +shared: name: getWaterLevel description: This function allows you to retrieve the water level from a certain location. The water level is 0 in most places though it can vary (e.g. it's higher near the dam). - parameters: [] + parameters: + - name: posX + type: float + description: MISSING_PARAM_DESC + - name: posY + type: float + description: MISSING_PARAM_DESC + - name: posZ + type: float + description: MISSING_PARAM_DESC + - name: ignoreDistanceToWaterThreshold + type: bool + description: If set to false, this function returns false, if the difference between + water level (without waves) and posZ is greater than 3.0 + default: 'false' examples: - path: examples/getWaterLevel-1.lua description: This example will tell you what's the water level where the specified player is located. side: client + returns: + values: + - type: float + name: value + description: Returns an integer of the water level if the localPlayer /position + is near the water (-3 to 20 on the Z coordinate) else false if there's no water + near the localPlayer /position. notes: - type: info content: Some small water areas within parts of the city do not count as water to be used with this function. For example, the shallow water area in Northwest San Fierro. - incomplete: true + requires_review: true diff --git a/functions/Water/getWaterVertexPosition.yaml b/functions/Water/getWaterVertexPosition.yaml index 756b2d37..23df023f 100644 --- a/functions/Water/getWaterVertexPosition.yaml +++ b/functions/Water/getWaterVertexPosition.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWaterVertexPosition -server: +shared: name: getWaterVertexPosition description: Gets the world position of a vertex (i.e. corner) of a [water](/wiki/Water "Water") area. Each water area is either a triangle or quad (rectangle) so each has 3 or 4 corners. - parameters: [] + parameters: + - name: theWater + type: water + description: the water element to get the vertex of + - name: vertexIndex + type: int + description: the index of the vertex whose position to get. Values range from + 1 to 4 for a water quad, or 1 to 3 for a triangle. examples: - path: examples/getWaterVertexPosition-1.lua description: '' side: server + returns: + values: + - type: int int float + name: value + description: Returns the x, y and z coordinates of the specified vertex if successful, + false otherwise. + oop: + element: water + method: getVertexPosition + static: false pair: setWaterVertexPosition - incomplete: true + requires_review: true diff --git a/functions/Water/getWaveHeight.yaml b/functions/Water/getWaveHeight.yaml index 5075a57b..6d4e6f99 100644 --- a/functions/Water/getWaveHeight.yaml +++ b/functions/Water/getWaveHeight.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWaveHeight -server: +shared: name: getWaveHeight description: This function returns the current wave height. parameters: [] @@ -7,5 +7,14 @@ server: - path: examples/getWaveHeight-1.lua description: This example changes the wave height to the given amount. side: server + returns: + values: + - type: float + name: value + description: Returns the height as a float , false otherwise. + oop: + element: Water + method: ) + static: true pair: setWaveHeight - incomplete: true + requires_review: true diff --git a/functions/Water/isWaterDrawnLast.yaml b/functions/Water/isWaterDrawnLast.yaml index 7fe5647f..76afcdbf 100644 --- a/functions/Water/isWaterDrawnLast.yaml +++ b/functions/Water/isWaterDrawnLast.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsWaterDrawnLast -client: +shared: name: isWaterDrawnLast description: This function determines whether [water](/wiki/Water "Water") is drawn last in the rendering order. @@ -8,4 +8,10 @@ client: - path: examples/isWaterDrawnLast-1.lua description: This example toggles water to be drawn last. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if water is drawn last in the rendering order, false + otherwise. + requires_review: true diff --git a/functions/Water/resetWaterColor.yaml b/functions/Water/resetWaterColor.yaml index b86b61a8..fca25e36 100644 --- a/functions/Water/resetWaterColor.yaml +++ b/functions/Water/resetWaterColor.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWaterColor -server: +shared: name: resetWaterColor description: This function reset the water color of the GTA world to default. parameters: [] @@ -8,4 +8,13 @@ server: description: This example adds a commandresetwatercolorwith which a player can reset the water colour. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if water color was reset correctly, false otherwise. + oop: + element: Water + method: ) + static: true + requires_review: true diff --git a/functions/Water/resetWaterLevel.yaml b/functions/Water/resetWaterLevel.yaml index 7ff56759..517724f8 100644 --- a/functions/Water/resetWaterLevel.yaml +++ b/functions/Water/resetWaterLevel.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWaterLevel -server: +shared: name: resetWaterLevel description: This function resets the water of the GTA world back to its default level. [Water elements](/wiki/Water "Water") are not affected. @@ -9,4 +9,13 @@ server: description: This example adds a commandresetwaterlevelwith which a player can reset the water level. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if water level was reset correctly, false otherwise. + oop: + element: Water + method: ) + static: true + requires_review: true diff --git a/functions/Water/setWaterColor.yaml b/functions/Water/setWaterColor.yaml index 4b2202ae..60a7849e 100644 --- a/functions/Water/setWaterColor.yaml +++ b/functions/Water/setWaterColor.yaml @@ -1,12 +1,36 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWaterColor -server: +shared: name: setWaterColor description: This function changes the water color of the GTA world. - parameters: [] + parameters: + - name: red + type: int + description: The red value of the water, from 0 to 255. + - name: green + type: int + description: The green value of the water, from 0 to 255. + - name: blue + type: int + description: The blue value of the water, from 0 to 255. + - name: alpha + type: int + description: The alpha (visibility) value of the water, from 0 to 255. Defaults + to 200 if not declared. + default: '200' examples: - path: examples/setWaterColor-1.lua description: This example adds a commandwatercolorwith which a player can change the water colour. side: server + returns: + values: + - type: bool + name: value + description: Returns true if water color was set correctly, false if invalid values + were passed. + oop: + element: water + method: setColor + static: false pair: getWaterColor - incomplete: true + requires_review: true diff --git a/functions/Water/setWaterDrawnLast.yaml b/functions/Water/setWaterDrawnLast.yaml index 1f681a50..fee47653 100644 --- a/functions/Water/setWaterDrawnLast.yaml +++ b/functions/Water/setWaterDrawnLast.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWaterDrawnLast -client: +shared: name: setWaterDrawnLast description: This function changes the [water](/wiki/Water "Water") rendering order. - parameters: [] + parameters: + - name: bEnabled + type: bool + description: A boolean value determining whether water should be drawn last. examples: - path: examples/setWaterDrawnLast-1.lua description: This example toggles water to be drawn last. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the rendering order was changed successfully, false + otherwise. + requires_review: true diff --git a/functions/Water/setWaterLevel.yaml b/functions/Water/setWaterLevel.yaml index 7321cba4..d81ec53e 100644 --- a/functions/Water/setWaterLevel.yaml +++ b/functions/Water/setWaterLevel.yaml @@ -1,8 +1,15 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWaterLevel -server: +shared: name: setWaterLevel description: Sets the height of some or all the water in the game world. - parameters: [] + parameters: + - name: theWater + type: water + description: the water element to change. + - name: level + type: float + description: the new Z coordinate of the water surface. All water in the game + world is set to this height. examples: - path: examples/setWaterLevel-1.lua description: This example code will slowly drain away all rivers and seas. @@ -10,6 +17,16 @@ server: - path: examples/setWaterLevel-2.lua description: This example code will slowly drain away all rivers and seas. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false in case of failure. + oop: + element: water + method: setLevel + variable: level + static: false pair: getWaterLevel notes: - type: info @@ -19,7 +36,6 @@ server: of the water. Setting the water level to any non-zero value (i.e. setWaterLevel(0.001) ) forces alternative rendering and MTA custom objects placed underwater will be drawn correctly. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -27,3 +43,4 @@ server: - Missing section: Alternate client-only syntax ' + requires_review: true diff --git a/functions/Water/setWaterVertexPosition.yaml b/functions/Water/setWaterVertexPosition.yaml index ed00f276..822b655e 100644 --- a/functions/Water/setWaterVertexPosition.yaml +++ b/functions/Water/setWaterVertexPosition.yaml @@ -1,16 +1,41 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWaterVertexPosition -server: +shared: name: setWaterVertexPosition description: Sets the world position of a corner point of a water area. - parameters: [] + parameters: + - name: theWater + type: water + description: the water element of which to change a vertex. + - name: vertexIndex + type: int + description: the index of the vertex to move. Values range from 1 to 4 for water + quads, and 1 to 3 for triangles. + - name: x + type: int + description: the X coordinate to set for the vertex. + - name: "y" + type: int + description: the Y coordinate to set for the vertex. + - name: z + type: float + description: the Z coordinate to set for the vertex. examples: - path: examples/setWaterVertexPosition-1.lua description: This example creates a water whose vertices 2 and 4 go up and down when someone uses the '/water' command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + oop: + element: water + method: setVertexPosition + static: false pair: getWaterVertexPosition notes: - type: info content: X and Y positions will be changed to an even integer. i.e. -2, 0, 2, 4 etc. - incomplete: true + requires_review: true diff --git a/functions/Water/setWaveHeight.yaml b/functions/Water/setWaveHeight.yaml index 5205278a..7d4da624 100644 --- a/functions/Water/setWaveHeight.yaml +++ b/functions/Water/setWaveHeight.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWaveHeight -server: +shared: name: setWaveHeight description: This function sets the wave height to the desired value, the default is 0\. - parameters: [] + parameters: + - name: height + type: float + description: A float between 0 and 100. examples: - path: examples/setWaveHeight-1.lua description: This example changes the wave height to the given amount. side: server + returns: + values: + - type: bool + name: value + description: Returns a boolean value true or false that tells you if it was successful + or not. + oop: + element: Water + method: ) + static: true pair: getWaveHeight - incomplete: true + requires_review: true diff --git a/functions/Weapon/getOriginalWeaponProperty.yaml b/functions/Weapon/getOriginalWeaponProperty.yaml index e66e373b..559790f6 100644 --- a/functions/Weapon/getOriginalWeaponProperty.yaml +++ b/functions/Weapon/getOriginalWeaponProperty.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetOriginalWeaponProperty -server: +shared: name: getOriginalWeaponProperty description: This function gets the original weapon property of the specified weapons specified weapon type. - parameters: [] + parameters: + - name: weaponID/string weaponName + type: int + description: MISSING_PARAM_DESC + - name: weaponSkill + type: string + description: MISSING_PARAM_DESC + - name: property + type: string + description: MISSING_PARAM_DESC examples: - path: examples/getOriginalWeaponProperty-1.lua description: This example gets the default weapon range of the M4 at poor skill level side: server - incomplete: true + returns: + values: + - type: int + name: value + description: 'On success:' + requires_review: true diff --git a/functions/Weapon/getSlotFromWeapon.yaml b/functions/Weapon/getSlotFromWeapon.yaml index bfca3662..4e4d22e5 100644 --- a/functions/Weapon/getSlotFromWeapon.yaml +++ b/functions/Weapon/getSlotFromWeapon.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSlotFromWeapon -server: +shared: name: getSlotFromWeapon description: This function allows you to identify the weapon slot that a weapon belongs to. - parameters: [] + parameters: + - name: weaponid + type: int + description: Weapon to find the weapon slot of. examples: - path: examples/getSlotFromWeapon-1.lua description: This will output to the chatbox what weapon slot a given weapon number belongs to when entered into the console (i.e. 'getWeaponSlot 10'). side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an integer representing the given weapon ID's associated + weapon slot, false if the ID was invalid. + requires_review: true diff --git a/functions/Weapon/getWeaponIDFromName.yaml b/functions/Weapon/getWeaponIDFromName.yaml index 28652fc7..27fc812b 100644 --- a/functions/Weapon/getWeaponIDFromName.yaml +++ b/functions/Weapon/getWeaponIDFromName.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponIDFromName -server: +shared: name: getWeaponIDFromName description: This function will obtain the ID of a particular weapon from its name. - parameters: [] + parameters: + - name: name + type: string + description: 'A string containing the name of the weapon. Names can be: (Case + is ignored)' examples: - path: examples/getWeaponIDFromName-1.lua description: This example will give the player the weapon they specify 20 ammo whenever they type "weaponname" into the console. side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns an int if the name matches that of a weapon, false otherwise. + requires_review: true diff --git a/functions/Weapon/getWeaponNameFromID.yaml b/functions/Weapon/getWeaponNameFromID.yaml index 8bf33c34..d61e5850 100644 --- a/functions/Weapon/getWeaponNameFromID.yaml +++ b/functions/Weapon/getWeaponNameFromID.yaml @@ -1,17 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponNameFromID -server: +shared: name: getWeaponNameFromID description: This function allows you to retrieve the name of a weapon from an ID. - parameters: [] + parameters: + - name: id + type: int + description: The ID you wish to retrieve the name of examples: - path: examples/getWeaponNameFromID-1.lua description: This example displays a death message in the format of "*Killerkilleddead(Weapon)" side: server + returns: + values: + - type: string + name: value + description: 'Returns a string of the name of the weapon or death type, false + otherwise. Names will be like these: (Ignoring case)' notes: - type: info content: You can also retrieve the name of other methods of death, such as Fall and Rammed. issues: - - id: '514' + - id: 514 description: getWeaponNameFromID() returns duplicate ID's for 10/11 and 12/13 - incomplete: true + requires_review: true diff --git a/functions/Weapon/getWeaponProperty.yaml b/functions/Weapon/getWeaponProperty.yaml index 0e620105..efb08948 100644 --- a/functions/Weapon/getWeaponProperty.yaml +++ b/functions/Weapon/getWeaponProperty.yaml @@ -1,13 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponProperty -server: +shared: name: getWeaponProperty description: This function gets a weapon property of the specified [custom weapon](/wiki/Element/Weapon "Element/Weapon") (clientside only) or specified [player\-held weapon](/wiki/Weapons "Weapons") (both client and server). - parameters: [] + parameters: + - name: weaponID/string weaponName + type: int + description: MISSING_PARAM_DESC + - name: weaponSkill + type: string + description: MISSING_PARAM_DESC + - name: property + type: string + description: MISSING_PARAM_DESC examples: - path: examples/getWeaponProperty-1.lua description: This example gets the weapon range of the M4 at poor skill level side: server + returns: + values: + - type: int + name: value + description: 'On success:' + oop: + element: weapon + note: This OOP syntax is forcustom weaponsonly. + method: getProperty + static: false pair: setWeaponProperty - incomplete: true + requires_review: true diff --git a/functions/Weapon/giveWeapon.yaml b/functions/Weapon/giveWeapon.yaml index 96788a76..e6236478 100644 --- a/functions/Weapon/giveWeapon.yaml +++ b/functions/Weapon/giveWeapon.yaml @@ -1,10 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GiveWeapon -server: +shared: name: giveWeapon description: giveWeapon gives a specified weapon to a certain player or ped. There is an optional argument to specify ammunition. For example, a melee weapon doesn't need an ammo argument. - parameters: [] + parameters: + - name: thePlayer + type: ped + description: A player or ped object referencing the specified player (or ped ) + - name: weapon + type: int + description: A whole number integer that refers to a Weapon ID. + - name: ammo + type: int + description: A whole number integer serving as the ammo amount for the given weapon. For + weapons that do not require ammo, such as melee, this should be at least 1. + default: '30' + - name: setAsCurrent + type: bool + description: A boolean value determining whether or not the weapon will be set + as the players current. + default: 'false' examples: - path: examples/giveWeapon-1.lua description: Example 1:This example gives a player an M4 with 200 ammo whenever @@ -18,10 +34,15 @@ server: description: Example 3:This example creates a ped in certain coordinates. You can give him a weapon with "give " command in console. side: server + returns: + values: + - type: bool + name: value + description: Returns true if weapon was successfully acquired, false otherwise. notes: - type: info content: When setting ammo for weapons in slot 0,1,10,11 or 12, the ammo max is 1 When setting ammo for weapons in slot 3,4,5, the ammo is added When setting ammo for weapons in slot 2,6,7,8,9 and the slot weapon is changing, the ammo is replaced - incomplete: true + requires_review: true diff --git a/functions/Weapon/isWeaponRenderEnabled.yaml b/functions/Weapon/isWeaponRenderEnabled.yaml index 3e4bdb88..0a1dbbe1 100644 --- a/functions/Weapon/isWeaponRenderEnabled.yaml +++ b/functions/Weapon/isWeaponRenderEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsWeaponRenderEnabled -client: +shared: name: isWeaponRenderEnabled description: This function checks whether GTA weapon rendering is enabled for [ped](/wiki/Ped "Ped") and [player](/wiki/Player "Player"). @@ -8,4 +8,10 @@ client: - path: examples/isWeaponRenderEnabled-1.lua description: This example allows you to disable/enable weapon rendering by using/weaponrendercommand. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if weapon rendering is enabled, otherwise returns false + . + requires_review: true diff --git a/functions/Weapon/setWeaponAmmo.yaml b/functions/Weapon/setWeaponAmmo.yaml index 704ed968..e7e72ed1 100644 --- a/functions/Weapon/setWeaponAmmo.yaml +++ b/functions/Weapon/setWeaponAmmo.yaml @@ -1,12 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponAmmo -server: +shared: name: setWeaponAmmo description: Sets the ammo to a certain amount for a specified weapon (if they already have it), regardless of current ammo. - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player + - name: weapon + type: int + description: A whole number integer that refers to a weapon ID. + - name: totalAmmo + type: int + description: A whole number integer serving as the total ammo amount for the given + weapon (including ammo in clip). + - name: ammoInClip + type: int + description: The amount of ammo to set in the player's clip. This will be taken + from the main ammo. If left unspecified or set to 0, the current clip will + remain. + default: '0' examples: - path: examples/setWeaponAmmo-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns a boolean value true or false that tells you if it was successful + or not. + oop: + element: weapon + method: setAmmo + variable: ammo + static: false pair: getWeaponAmmo - incomplete: true + requires_review: true diff --git a/functions/Weapon/setWeaponProperty.yaml b/functions/Weapon/setWeaponProperty.yaml index 7d332de4..3b109e4e 100644 --- a/functions/Weapon/setWeaponProperty.yaml +++ b/functions/Weapon/setWeaponProperty.yaml @@ -1,13 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponProperty -server: +shared: name: setWeaponProperty description: This function sets the weapon property of the specified weapons specified weapon type. See lower down the page for documentation related to weapon creation. - parameters: [] + parameters: + - name: weaponID/string weaponName + type: int + description: MISSING_PARAM_DESC + - name: weaponSkill + type: string + description: MISSING_PARAM_DESC + - name: property + type: string + description: MISSING_PARAM_DESC + - name: theValue + type: int/float + description: MISSING_PARAM_DESC examples: - path: examples/setWeaponProperty-1.lua description: This example sets the weapon range of the M4 at poor skill level to 75 side: server + returns: + values: + - type: bool + name: value + description: 'On success:' + oop: + element: weapon + method: setProperty + static: false pair: getWeaponProperty - incomplete: true + requires_review: true diff --git a/functions/Weapon/setWeaponRenderEnabled.yaml b/functions/Weapon/setWeaponRenderEnabled.yaml index e0b38239..4d599944 100644 --- a/functions/Weapon/setWeaponRenderEnabled.yaml +++ b/functions/Weapon/setWeaponRenderEnabled.yaml @@ -1,16 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponRenderEnabled -client: +shared: name: setWeaponRenderEnabled description: This function allows you to completely disable/enable GTA weapon rendering for [ped](/wiki/Ped "Ped") and [player](/wiki/Player "Player"). It is particularly useful for creating custom weapon systems, where singular weapon ID could have many different models/variations, or to simply get rid of one frame delay when switching weapons. - parameters: [] + parameters: + - name: enabled + type: bool + description: Whether weapon render should be enabled. examples: - path: examples/setWeaponRenderEnabled-1.lua description: This example disables weapon rendering once resource has started. side: client + returns: + values: + - type: bool + name: value + description: Always returns true . notes: - type: info content: If you want to selectively hide weapons use engineSetModelLODDistance @@ -20,4 +28,4 @@ client: - type: tip content: You can use it for example with optimized bone_attach resource called pAttach . - incomplete: true + requires_review: true diff --git a/functions/Weapon/takeAllWeapons.yaml b/functions/Weapon/takeAllWeapons.yaml index bfddee7a..92573888 100644 --- a/functions/Weapon/takeAllWeapons.yaml +++ b/functions/Weapon/takeAllWeapons.yaml @@ -1,15 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TakeAllWeapons -server: +shared: name: takeAllWeapons description: This function removes every weapons from a specified [ped](/wiki/Ped "Ped"), rendering it unarmed. - parameters: [] + parameters: + - name: thePed + type: ped + description: A ped element referencing the specified ped examples: - path: examples/takeAllWeapons-1.lua description: This example removes all weapons from every player side: server + returns: + values: + - type: bool + name: value + description: Returns true if the function succeeded, false otherwise. notes: - type: info content: Weapons are removed when a ped dies by default. This means that it is only appropriate to use this function while a ped is alive. - incomplete: true + requires_review: true diff --git a/functions/Weapon/takeWeapon.yaml b/functions/Weapon/takeWeapon.yaml index c7e4fbd8..f8a2631e 100644 --- a/functions/Weapon/takeWeapon.yaml +++ b/functions/Weapon/takeWeapon.yaml @@ -1,11 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TakeWeapon -server: +shared: name: takeWeapon description: This function removes a specified weapon or ammo from a certain player's inventory. - parameters: [] + parameters: + - name: thePlayer + type: player + description: A player object referencing the specified player. + - name: weaponId + type: int + description: An integer that refers to a weapon that you wish to remove. + - name: ammo + type: int + description: If used, this amount of ammo will be taken instead and the weapon + will not be removed. examples: - path: examples/takeWeapon-1.lua description: This example removes teargas from player. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns a true if the weapon/ammo was removed successfully, false + otherwise. + requires_review: true diff --git a/functions/Weapon_creation/createWeapon.yaml b/functions/Weapon_creation/createWeapon.yaml index 237a6b88..388df7b7 100644 --- a/functions/Weapon_creation/createWeapon.yaml +++ b/functions/Weapon_creation/createWeapon.yaml @@ -1,17 +1,38 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateWeapon -client: +shared: name: createWeapon description: Creates a [custom weapon](/wiki/Element/Weapon "Element/Weapon") that can fire bullets. **Do not confuse this with player held weapons**. - parameters: [] + parameters: + - name: theType + type: string + description: 'The weapon type which can be:' + - name: x + type: float + description: MISSING_PARAM_DESC + - name: "y" + type: float + description: MISSING_PARAM_DESC + - name: z + type: float + description: MISSING_PARAM_DESC examples: - path: examples/createWeapon-1.lua description: This example adds a/createminiguncommand to create a weapon that is always firing. side: client + returns: + values: + - type: weapon + name: value + description: Returns a custom weapon element, which represents a weapon floating + at that position. + oop: + element: element + constructorclass: Weapon notes: - type: tip content: Some weapons (such as the minigun) visually point to a slightly different direction to where they fire. To adjust this, use setWeaponProperty with 'fire_rotation'. See the example below. - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/fireWeapon.yaml b/functions/Weapon_creation/fireWeapon.yaml index 0ad229b2..efac203a 100644 --- a/functions/Weapon_creation/fireWeapon.yaml +++ b/functions/Weapon_creation/fireWeapon.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/FireWeapon -client: +shared: name: fireWeapon description: Fires one shot from a [custom weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to be fired. examples: - path: examples/fireWeapon-1.lua description: This function creates and fires a weapon. @@ -12,4 +15,14 @@ client: fire it every frame. Be aware that neither the weapon nor the shots are synced between players and that normally weapons don't fire every frame. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the shot weapon is valid and therefore the shot was + fired, false otherwise. + oop: + element: weapon + method: fire + static: false + requires_review: true diff --git a/functions/Weapon_creation/getWeaponAmmo.yaml b/functions/Weapon_creation/getWeaponAmmo.yaml index d9e9e911..9d7e99a5 100644 --- a/functions/Weapon_creation/getWeaponAmmo.yaml +++ b/functions/Weapon_creation/getWeaponAmmo.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponAmmo -client: +shared: name: getWeaponAmmo description: This function gets the total ammo a [custom weapon](/wiki/Element/Weapon "Element/Weapon") has. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to get the ammo of. examples: - path: examples/getWeaponAmmo-1.lua description: This example gets the ammo of the custom weapon and outputs it to the chatbox. side: client + returns: + values: + - type: int + name: value + description: Returns an integer containing how many ammo left has the weapon. + Returns false if an error occured. + oop: + element: weapon + method: getAmmo + variable: ammo + static: false pair: setWeaponAmmo - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/getWeaponClipAmmo.yaml b/functions/Weapon_creation/getWeaponClipAmmo.yaml index f3dd10fa..f8f5c6fe 100644 --- a/functions/Weapon_creation/getWeaponClipAmmo.yaml +++ b/functions/Weapon_creation/getWeaponClipAmmo.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponClipAmmo -client: +shared: name: getWeaponClipAmmo description: This function gets the amount of ammo left in a [custom weapon](/wiki/Element/Weapon "Element/Weapon")'s magazine/clip. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon to get the clip ammo of. examples: - path: examples/getWeaponClipAmmo-1.lua description: This function outputs the remaining ammo in clip of a specific weapon using the command/getammoinclip. side: client + returns: + values: + - type: int + name: value + description: Returns the amount of ammo in the custom weapon 's clip, false if + an error occured. + oop: + element: weapon + method: getClipAmmo + variable: clipAmmo + static: false pair: setWeaponClipAmmo - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/getWeaponFiringRate.yaml b/functions/Weapon_creation/getWeaponFiringRate.yaml index d39be0e5..e5cf61f3 100644 --- a/functions/Weapon_creation/getWeaponFiringRate.yaml +++ b/functions/Weapon_creation/getWeaponFiringRate.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponFiringRate -client: +shared: name: getWeaponFiringRate description: This gets the firing rate to be used when a [custom weapon](/wiki/Element/Weapon "Element/Weapon") opens fire. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to modify the firing rate of. examples: - path: examples/getWeaponFiringRate-1.lua description: This example creates a minigun at the center of the map and creates a/fireratecommand that outputs its firerate to the player who types it. side: client + returns: + values: + - type: int + name: value + description: Returns an integer with the firing rate of the custom weapon, false + otherwise. + oop: + element: weapon + method: getFiringRate + variable: firingRate + static: false pair: setWeaponFiringRate - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/getWeaponFlags.yaml b/functions/Weapon_creation/getWeaponFlags.yaml index 8b0daf58..65bc0e16 100644 --- a/functions/Weapon_creation/getWeaponFlags.yaml +++ b/functions/Weapon_creation/getWeaponFlags.yaml @@ -1,13 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponFlags -client: +shared: name: getWeaponFlags description: This function gets the flags of a [custom weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon to get the flag of. + - name: theFlag + type: string + description: 'the weapon flag to get: disable_model : makes the weapon and muzzle + effect invisible or not. flags : returns the flags used to get where the gun + shoots at. These flags are (by order): checkBuildings : allows the shoot to + be blocked by GTA''s internally placed buildings, i.e. the world map. checkCarTires + : allows the shoot to be blocked by vehicle tires. checkDummies : allows the + shoot to be blocked by GTA''s internal dummies. These are not used in the current + MTA version so this argument can be set to false . checkObjects : allows the + shoot to be blocked by objects . checkPeds : allows the shoot to be blocked + by peds and players . checkVehicles : allows the shoot to be blocked by vehicles + . checkSeeThroughStuff : allows the shoot to be blocked by translucent game + objects, e.g. glass. checkShootThroughStuff : allows the shoot to be blocked + by things that can be shot through. instant_reload : if enabled, the weapon + reloads instantly rather than waiting the reload time until shooting again. + shoot_if_out_of_range : if enabled, the weapon still fires its target beyond + the weapon range distance. shoot_if_blocked : if enabled, the weapon still fires + its target even if it''s blocked by something.' examples: - path: examples/getWeaponFlags-1.lua description: This example checks whether the instant_reload flag is enabled or disabled. side: client + returns: + values: + - type: bool + name: value + description: Returns the true or false on success ( flags flag returns 8 values) + if the flag is enabled or not. Returns false if the weapon element isn't valid + or an error occured. + oop: + element: weapon + method: getFlags + static: false pair: setWeaponFlags - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/getWeaponState.yaml b/functions/Weapon_creation/getWeaponState.yaml index 3010e52f..3c3dd758 100644 --- a/functions/Weapon_creation/getWeaponState.yaml +++ b/functions/Weapon_creation/getWeaponState.yaml @@ -1,13 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponState -client: +shared: name: getWeaponState description: This function gets the state of a [custom weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon to get the state of. examples: - path: examples/getWeaponState-1.lua description: This example creates a gun where the local player is and informs any player about its state. side: client + returns: + values: + - type: string + name: value + description: This example creates a gun where the local player is and informs + any player about its state. + oop: + element: weapon + method: getState + variable: state + static: false pair: setWeaponState - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/getWeaponTarget.yaml b/functions/Weapon_creation/getWeaponTarget.yaml index 137d7940..6f1e0799 100644 --- a/functions/Weapon_creation/getWeaponTarget.yaml +++ b/functions/Weapon_creation/getWeaponTarget.yaml @@ -1,13 +1,28 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeaponTarget -client: +shared: name: getWeaponTarget description: This functions gets the target of a [custom weapon](/wiki/Element/Weapon "Element/Weapon"). - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to get the target of. examples: - path: examples/getWeaponTarget-1.lua description: This example gets the weapon target when the player hit the colshape and outputs it to the chatbox. side: client + returns: + values: + - type: nil/element/float + name: value + description: This example gets the weapon target when the player hit the colshape + and outputs it to the chatbox. + oop: + element: weapon + note: Variable is read only. + method: getTarget + variable: target + static: false pair: setWeaponTarget - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/resetWeaponFiringRate.yaml b/functions/Weapon_creation/resetWeaponFiringRate.yaml index 9580c58a..3acf2b2c 100644 --- a/functions/Weapon_creation/resetWeaponFiringRate.yaml +++ b/functions/Weapon_creation/resetWeaponFiringRate.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWeaponFiringRate -client: +shared: name: resetWeaponFiringRate description: This function resets the firing rate of a [custom weapon](/wiki/Element/Weapon "Element/Weapon") to the default one. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon to reset the firing rate of. examples: - path: examples/resetWeaponFiringRate-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: weapon + method: resetFiringRate + static: false + requires_review: true diff --git a/functions/Weapon_creation/setWeaponClipAmmo.yaml b/functions/Weapon_creation/setWeaponClipAmmo.yaml index 4f69bc45..a2a5add7 100644 --- a/functions/Weapon_creation/setWeaponClipAmmo.yaml +++ b/functions/Weapon_creation/setWeaponClipAmmo.yaml @@ -1,13 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponClipAmmo -client: +shared: name: setWeaponClipAmmo description: This function sets the ammo left in a [custom weapon](/wiki/Element/Weapon "Element/Weapon")'s magazine/clip. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to set the clip ammo of. + - name: clipAmmo + type: int + description: The amount of ammo in the clip. examples: - path: examples/setWeaponClipAmmo-1.lua description: This example adds a/weaponcommand that creates a M4 where the player uses it, and gives 1 clip ammo to it. side: client + returns: + values: + - type: bool + name: value + description: This function returns true if the arguments are valid and the weapon + clip ammo could be changed; false otherwise. + oop: + element: weapon + method: setClipAmmo + variable: clipAmmo + static: false pair: getWeaponClipAmmo - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/setWeaponFiringRate.yaml b/functions/Weapon_creation/setWeaponFiringRate.yaml index 71a6bf5d..c4c0ceb7 100644 --- a/functions/Weapon_creation/setWeaponFiringRate.yaml +++ b/functions/Weapon_creation/setWeaponFiringRate.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponFiringRate -client: +shared: name: setWeaponFiringRate description: This function sets the firing rate to be used when a [custom weapon](/wiki/Element/Weapon "Element/Weapon") is in *firing* state. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: The weapon to modify the firing rate of. + - name: firingRate + type: int + description: The weapon firing rate. It seems to be a kind of frecuency value, + so the lower the quicker the custom weapon will shoot. examples: - path: examples/setWeaponFiringRate-1.lua description: This example makes the Desert Eagle gun fire faster. side: client + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: weapon + method: setFiringRate + variable: firingRate + static: false pair: getWeaponFiringRate - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/setWeaponFlags.yaml b/functions/Weapon_creation/setWeaponFlags.yaml index 11124cde..03368e28 100644 --- a/functions/Weapon_creation/setWeaponFlags.yaml +++ b/functions/Weapon_creation/setWeaponFlags.yaml @@ -1,14 +1,49 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponFlags -client: +shared: name: setWeaponFlags description: This function sets a [custom weapon](/wiki/Element/Weapon "Element/Weapon") flags, used to change how it behaves or finds a possible target to shoot. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon element to set the flag of. + - name: theFlag + type: string + description: 'the weapon flag to change (all of them can be true or false ): disable_model + : makes the weapon and muzzle effect invisible or not. flags : configures the + flags used to get where the gun shoots at. They are based on processLineOfSight + ''s. You have to specify all the eight flags for the function to succeed. These + flags are (by order): checkBuildings : allows the shoot to be blocked by GTA''s + internally placed buildings, i.e. the world map. checkCarTires : allows the + shoot to be blocked by vehicle tires. checkDummies : allows the shoot to be + blocked by GTA''s internal dummies. These are not used in the current MTA version + so this argument can be set to false . checkObjects : allows the shoot to be + blocked by objects . checkPeds : allows the shoot to be blocked by peds and + players . checkVehicles : allows the shoot to be blocked by vehicles . checkSeeThroughStuff + : allows the shoot to be blocked by translucent game objects, e.g. glass. checkShootThroughStuff + : allows the shoot to be blocked by things that can be shot through. instant_reload + : if enabled, the weapon will reload instantly rather than waiting the reload + time until shooting again. shoot_if_out_of_range : if enabled, the weapon will + still fire its target beyond the weapon range distance. shoot_if_blocked : if + enabled, the weapon will still fire its target even if it''s blocked by something.' + - name: enable + type: bool + description: whether to enable or disable the specified flag. examples: - path: examples/setWeaponFlags-1.lua description: This example creates a minigun that will kill any player who approaches the center of the map, no matter if he takes cover or not. side: client + returns: + values: + - type: bool + name: value + description: Returns true if all arguments are valid and the flags where changed; + false otherwise. + oop: + element: weapon + method: setFlags + static: false pair: getWeaponFlags notes: - type: info @@ -16,7 +51,7 @@ client: works with player-held weapons and custom weapons (in a limited extent), this function does not work with player-held weapons. issues: - - id: '8686' + - id: 8686 description: setWeaponFlags(weapon, "flags") always returns false, but getWeaponFlags(weapon, "flags") works correctly - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/setWeaponState.yaml b/functions/Weapon_creation/setWeaponState.yaml index 402db8d1..fb649a0b 100644 --- a/functions/Weapon_creation/setWeaponState.yaml +++ b/functions/Weapon_creation/setWeaponState.yaml @@ -1,12 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeaponState -client: +shared: name: setWeaponState description: This function sets a [custom weapon](/wiki/Element/Weapon "Element/Weapon")'s state. - parameters: [] + parameters: + - name: theWeapon + type: weapon + description: the weapon you wish to set the state of. + - name: theState + type: string + description: 'the state you wish to set: reloading : makes the weapon reload. + firing : makes the weapon constantly fire its target (unless any shooting blocking + flags are set) according to its assigned firing rate. ready : makes the weapon + stop reloading or firing.' examples: - path: examples/setWeaponState-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true on success, false otherwise. + oop: + element: weapon + method: setState + variable: state + static: false pair: getWeaponState - incomplete: true + requires_review: true diff --git a/functions/Weapon_creation/setWeaponTarget.yaml b/functions/Weapon_creation/setWeaponTarget.yaml index 74598d0b..7e2b6e20 100644 --- a/functions/Weapon_creation/setWeaponTarget.yaml +++ b/functions/Weapon_creation/setWeaponTarget.yaml @@ -11,13 +11,18 @@ client: map when the resource which contains it starts and makes the weapon fire the new ped's head non-stop. side: client + oop: + element: weapon + note: Variable is read only. + method: setTarget + variable: target + static: false pair: getWeaponTarget notes: - type: info content: Custom weapons fire targets with no recoil (so they never miss a shot). If you want a custom weapon to take into account recoil, you will have to script it by firing at fixed coordinates. - incomplete: true meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -29,3 +34,4 @@ client: - Missing section: Syntax (rotational target) ' + requires_review: true diff --git a/functions/World/areTrafficLightsLocked.yaml b/functions/World/areTrafficLightsLocked.yaml index 48c8d7bd..d8843409 100644 --- a/functions/World/areTrafficLightsLocked.yaml +++ b/functions/World/areTrafficLightsLocked.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/AreTrafficLightsLocked -server: +shared: name: areTrafficLightsLocked description: Gets whether the traffic lights are currently locked or not. If the lights are locked, it means they won't change unless you do [setTrafficLightState](/wiki/SetTrafficLightState @@ -9,4 +9,9 @@ server: - path: examples/areTrafficLightsLocked-1.lua description: This example toggles traffic lights between 'locked' and 'unlocked'. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true the traffic lights are currently locked, false otherwise. + requires_review: true diff --git a/functions/World/createSWATRope.yaml b/functions/World/createSWATRope.yaml index d18e4df8..9c68d43d 100644 --- a/functions/World/createSWATRope.yaml +++ b/functions/World/createSWATRope.yaml @@ -1,12 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/CreateSWATRope -client: +shared: name: createSWATRope description: Creates a SWAT rope like that of the rope in single player used by SWAT Teams abseiling from the Police Maverick. - parameters: [] + parameters: + - name: fx + type: float + description: MISSING_PARAM_DESC + - name: fy + type: float + description: MISSING_PARAM_DESC + - name: fZ + type: float + description: MISSING_PARAM_DESC + - name: duration + type: int + description: the amount in miliseconds the rope will be there before falling to + the ground. examples: - path: examples/createSWATRope-1.lua description: This example creates a Swat rope in police maverick when you use the command /createrope side: client - incomplete: true + returns: + values: + - type: bool + name: value + requires_review: true diff --git a/functions/World/getAircraftMaxHeight.yaml b/functions/World/getAircraftMaxHeight.yaml index d48047fc..467bec2c 100644 --- a/functions/World/getAircraftMaxHeight.yaml +++ b/functions/World/getAircraftMaxHeight.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAircraftMaxHeight -server: +shared: name: getAircraftMaxHeight description: This function gets the maximum height at which aircraft can fly without their engines turning off. @@ -9,4 +9,9 @@ server: description: This example returns the max aircraft height to a player if they use the command 'aircraftmaxheight'. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float containing the max aircraft height. + requires_review: true diff --git a/functions/World/getAircraftMaxVelocity.yaml b/functions/World/getAircraftMaxVelocity.yaml index b185ac74..e54d47f0 100644 --- a/functions/World/getAircraftMaxVelocity.yaml +++ b/functions/World/getAircraftMaxVelocity.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetAircraftMaxVelocity -server: +shared: name: getAircraftMaxVelocity description: This function returns the maximum velocity at which aircrafts could fly. Using this function server\-side will return the server\-side value, not @@ -14,4 +14,10 @@ server: description: This example will tell the max velocity to everyone when the resource is started. side: server - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float being the max velocity that is currently set, depending + on which side it is used. + requires_review: true diff --git a/functions/World/getBirdsEnabled.yaml b/functions/World/getBirdsEnabled.yaml index 90af8ad9..0775caf2 100644 --- a/functions/World/getBirdsEnabled.yaml +++ b/functions/World/getBirdsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetBirdsEnabled -client: +shared: name: getBirdsEnabled description: This function will tell you if the birds are enabled or disabled. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/getBirdsEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the birds are enabled or false if the birds are disabled. + requires_review: true diff --git a/functions/World/getCloudsEnabled.yaml b/functions/World/getCloudsEnabled.yaml index bfaeee82..03dda260 100644 --- a/functions/World/getCloudsEnabled.yaml +++ b/functions/World/getCloudsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCloudsEnabled -server: +shared: name: getCloudsEnabled description: This function will tell you if clouds are enabled or disabled. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/getCloudsEnabled-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the clouds are enabled or false if clouds are disabled. + requires_review: true diff --git a/functions/World/getColorFilter.yaml b/functions/World/getColorFilter.yaml index adb6282b..37873339 100644 --- a/functions/World/getColorFilter.yaml +++ b/functions/World/getColorFilter.yaml @@ -1,8 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetColorFilter -client: +shared: name: getColorFilter description: This function is used to get the values of color filtering. - parameters: [] + parameters: + - name: isOriginal + type: bool + description: A bool indicates if the return values of color filter are GTASA original + or changed by setColorFilter . If this is set to false , the return values would + be the color filter that is currently being used. examples: - path: examples/getColorFilter-1.lua description: This example corrects color of dxDrawMaterialLine3D. But this method @@ -11,9 +16,30 @@ client: - path: examples/getColorFilter-2.lua description: This example corrects color of dxDrawMaterialLine3D using shader side: client + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + - type: int + name: value6 + - type: int + name: value7 + - type: int + name: value8 + description: Returns 8 integers , of which the first 4 indicate the color (R,G,B,A) + of color filter A, and the last 4 indicate the color (R,G,B,A) of color filter + B. notes: - type: tip content: Normally the game is adding these colors to a screen to simulate weather effects. Sometimes it can be important to disable these effects. You can get rid of the effects by calling setColorFilter with zero values. - incomplete: true + requires_review: true diff --git a/functions/World/getCoronaReflectionsEnabled.yaml b/functions/World/getCoronaReflectionsEnabled.yaml index 873cb9c4..dc080317 100644 --- a/functions/World/getCoronaReflectionsEnabled.yaml +++ b/functions/World/getCoronaReflectionsEnabled.yaml @@ -1,7 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetCoronaReflectionsEnabled -client: +shared: name: getCoronaReflectionsEnabled description: This function gets visibility of corona reflections. parameters: [] examples: [] - incomplete: true + returns: + values: + - type: int + name: value + description: 'One of the following integers will be returned:' + requires_review: true diff --git a/functions/World/getFarClipDistance.yaml b/functions/World/getFarClipDistance.yaml index fa124c71..4d8cfdf2 100644 --- a/functions/World/getFarClipDistance.yaml +++ b/functions/World/getFarClipDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetFarClipDistance -server: +shared: name: getFarClipDistance description: This function will tell you what is the current render distance. parameters: [] @@ -7,10 +7,16 @@ server: - path: examples/getFarClipDistance-1.lua description: This example will demonstrate basic functionality of the function. side: server + returns: + values: + - type: float + name: value + description: Returns a float with the current render distance, false if the operation + could not be completed. notes: - type: info content: The function will return false server-side if far clip distance has not been set before the function is called. - type: info content: Default far clip distance value is 800. - incomplete: true + requires_review: true diff --git a/functions/World/getFogDistance.yaml b/functions/World/getFogDistance.yaml index 07379b38..e3c3fdf1 100644 --- a/functions/World/getFogDistance.yaml +++ b/functions/World/getFogDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetFogDistance -server: +shared: name: getFogDistance description: This function will tell you what is the current fog render distance. parameters: [] @@ -7,8 +7,14 @@ server: - path: examples/getFogDistance-1.lua description: This example will demonstrate basic functionality of the function. side: server + returns: + values: + - type: float + name: value + description: Returns a float with the current fog render distance, false if the + operation could not be completed. notes: - type: info content: The function will return false server-side if fog distance has not been set before the function is called. - incomplete: true + requires_review: true diff --git a/functions/World/getGameSpeed.yaml b/functions/World/getGameSpeed.yaml index 9e2cef0a..eb6a34db 100644 --- a/functions/World/getGameSpeed.yaml +++ b/functions/World/getGameSpeed.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGameSpeed -server: +shared: name: getGameSpeed description: This function gets the current game speed value. parameters: [] @@ -8,4 +8,9 @@ server: description: This example adds a 'gamespeed' console command that prints the game speed to the chatbox. side: server - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float representing the speed of the game. + requires_review: true diff --git a/functions/World/getGarageBoundingBox.yaml b/functions/World/getGarageBoundingBox.yaml index 7e94a607..76ce16ba 100644 --- a/functions/World/getGarageBoundingBox.yaml +++ b/functions/World/getGarageBoundingBox.yaml @@ -1,15 +1,31 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGarageBoundingBox -client: +shared: name: getGarageBoundingBox description: This function outputs the bounding box of a garage. - parameters: [] + parameters: + - name: garageID + type: int + description: The garage ID that represents the garage door that is being checked. examples: - path: examples/getGarageBoundingBox-1.lua description: Checks if the player is inside the bounding box of the garage and outputs the result to the chat side: client + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + - type: float + name: value3 + - type: float + name: value4 + description: Returns four float s indicating the bounding box of the garage. Western + X position, Eastern X position, Southern Y position, Northern Y position,, false + when invalid garageID was provided. notes: - type: tip content: You can use the useful function CreateGarageColShape to create the garage colshape. - incomplete: true + requires_review: true diff --git a/functions/World/getGaragePosition.yaml b/functions/World/getGaragePosition.yaml index a9960e4f..e0abe563 100644 --- a/functions/World/getGaragePosition.yaml +++ b/functions/World/getGaragePosition.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGaragePosition -client: +shared: name: getGaragePosition description: This function outputs X, Y and Z position of given garage. - parameters: [] + parameters: + - name: garageID + type: int + description: The garage ID that represents the garage door that is being checked. examples: - path: examples/getGaragePosition-1.lua description: This element has to create a blip at the nearest garage and removes it in 10 seconds. side: client - incomplete: true + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three float s indicating the position of the garage, x , + y and z respectively, false when garageID was invalid. + requires_review: true diff --git a/functions/World/getGarageSize.yaml b/functions/World/getGarageSize.yaml index 7d2745bc..471495f4 100644 --- a/functions/World/getGarageSize.yaml +++ b/functions/World/getGarageSize.yaml @@ -1,12 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGarageSize -client: +shared: name: getGarageSize description: This function outputs the size of garage. - parameters: [] + parameters: + - name: garageID + type: int + description: The garage ID that represents the garage door that is being checked. examples: - path: examples/getGarageSize-1.lua description: This example adds the command /garagesize side: client + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three float s indicating the size of the garage, false if + an invalid garageID has been provided. notes: - type: info content: The values returned by this function are sizeZ, sizeX and sizeY respectively. @@ -14,4 +27,4 @@ client: - type: tip content: You can use the useful function CreateGarageColShape to create the garage colshape. - incomplete: true + requires_review: true diff --git a/functions/World/getGravity.yaml b/functions/World/getGravity.yaml index 249295c2..9b30a525 100644 --- a/functions/World/getGravity.yaml +++ b/functions/World/getGravity.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGravity -server: +shared: name: getGravity description: This function returns the current gravity level for the context in which it is called (server or client). @@ -8,4 +8,10 @@ server: - path: examples/getGravity-1.lua description: This serverside command outputs the serverside gravity level. side: server - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float with the current server or client (depending on where + you call the function) gravity level. + requires_review: true diff --git a/functions/World/getGroundPosition.yaml b/functions/World/getGroundPosition.yaml index 7f5d248c..4c761b70 100644 --- a/functions/World/getGroundPosition.yaml +++ b/functions/World/getGroundPosition.yaml @@ -1,8 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetGroundPosition -client: +shared: name: getGroundPosition description: This function gets the Z level of the highest ground below a point. - parameters: [] + parameters: + - name: x + type: float + description: A floating point number representing the X world coordinate of the + point. + - name: "y" + type: float + description: A floating point number representing the Y world coordinate of the + point. + - name: z + type: float + description: A floating point number representing the Z world coordinate of the + point. examples: - path: examples/getGroundPosition-1.lua description: This clientside function determines if a player is under a ceiling @@ -12,4 +24,11 @@ client: description: This clientside function returns the distance between you and the ground (if there is) side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float with the highest ground-level Z coord if parameters + are valid, 0 if the point you tried to test is outside the loaded world map, + false otherwise. + requires_review: true diff --git a/functions/World/getHeatHaze.yaml b/functions/World/getHeatHaze.yaml index 3650ef60..d5205f5b 100644 --- a/functions/World/getHeatHaze.yaml +++ b/functions/World/getHeatHaze.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetHeatHaze -server: +shared: name: getHeatHaze description: This function will return the current heat haze effect settings. parameters: [] @@ -8,4 +8,26 @@ server: description: This example outputs current heat haze settings to the chat when player uses command 'get_haze'. side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + - type: int + name: value6 + - type: int + name: value7 + - type: int + name: value8 + - type: bool + name: value9 + description: 'Returns 9 values, which are the same used as arguments in SetHeatHaze + :' + requires_review: true diff --git a/functions/World/getInteriorFurnitureEnabled.yaml b/functions/World/getInteriorFurnitureEnabled.yaml index 314a71bd..39b666c1 100644 --- a/functions/World/getInteriorFurnitureEnabled.yaml +++ b/functions/World/getInteriorFurnitureEnabled.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetInteriorFurnitureEnabled -client: +shared: name: getInteriorFurnitureEnabled description: This function will tell you if interior furniture are enabled or disabled in a specified room ID. - parameters: [] + parameters: + - name: roomID + type: int + description: MISSING_PARAM_DESC examples: - path: examples/getInteriorFurnitureEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if interior furniture is enabled or false if interior + furniture is disabled. + requires_review: true diff --git a/functions/World/getInteriorSoundsEnabled.yaml b/functions/World/getInteriorSoundsEnabled.yaml index 542fa471..4b4e6a39 100644 --- a/functions/World/getInteriorSoundsEnabled.yaml +++ b/functions/World/getInteriorSoundsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetInteriorSoundsEnabled -server: +shared: name: getInteriorSoundsEnabled description: This function checks to see if the music played by default in clubs is disabled or not. @@ -8,4 +8,9 @@ server: - path: examples/getInteriorSoundsEnabled-1.lua description: Command check_sounds checks if the interior sounds enabled or not side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if music is playing, returns false if music is not playing. + requires_review: true diff --git a/functions/World/getJetpackMaxHeight.yaml b/functions/World/getJetpackMaxHeight.yaml index f0c761c1..623301e9 100644 --- a/functions/World/getJetpackMaxHeight.yaml +++ b/functions/World/getJetpackMaxHeight.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetJetpackMaxHeight -server: +shared: name: getJetpackMaxHeight description: This function gets the maximum height at which your jetpack can fly without failing to go higher. @@ -9,4 +9,9 @@ server: description: This example returns the max jetpack height to a player if they use the command 'jetpackmaxheight'. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float containing the max jetpack height. + requires_review: true diff --git a/functions/World/getJetpackWeaponEnabled.yaml b/functions/World/getJetpackWeaponEnabled.yaml index d15681c6..6dd9b9d1 100644 --- a/functions/World/getJetpackWeaponEnabled.yaml +++ b/functions/World/getJetpackWeaponEnabled.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetJetpackWeaponEnabled -server: +shared: name: getJetpackWeaponEnabled description: This function checks if a weapon is usable while on a Jetpack. - parameters: [] + parameters: + - name: weapon + type: string + description: The weapon that's being checked if it's usable on a Jetpack. examples: - path: examples/getJetpackWeaponEnabled-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the weapon is enabled, else false if the weapon isn't + or invalid arguments are passed. + requires_review: true diff --git a/functions/World/getMinuteDuration.yaml b/functions/World/getMinuteDuration.yaml index f68f6147..5c2e6d98 100644 --- a/functions/World/getMinuteDuration.yaml +++ b/functions/World/getMinuteDuration.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMinuteDuration -server: +shared: name: getMinuteDuration description: Tells you how long an ingame minute takes in real\-world milliseconds. The default GTA value is 1000\. @@ -8,4 +8,10 @@ server: - path: examples/getMinuteDuration-1.lua description: This example prints the server's minute duration side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the number of real-world milliseconds that go in an ingame + minute. + requires_review: true diff --git a/functions/World/getMoonSize.yaml b/functions/World/getMoonSize.yaml index f29dbcce..65b7629e 100644 --- a/functions/World/getMoonSize.yaml +++ b/functions/World/getMoonSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetMoonSize -server: +shared: name: getMoonSize description: This function returns the moon size. parameters: [] @@ -8,8 +8,14 @@ server: description: This example will tell the moon size to everyone when the resource is started. side: server + returns: + values: + - type: int + name: value + description: Returns a integer being the moon size that is currently set, depending + on which side it is used. notes: - type: info content: The function will return false server-side if moon size has not been set before the function is called. - incomplete: true + requires_review: true diff --git a/functions/World/getNearClipDistance.yaml b/functions/World/getNearClipDistance.yaml index 532ef83e..bfcaf204 100644 --- a/functions/World/getNearClipDistance.yaml +++ b/functions/World/getNearClipDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetNearClipDistance -client: +shared: name: getNearClipDistance description: This function gets the distance from the [camera](/wiki/Camera "Camera") at which the world starts rendering. For more information about this please refer @@ -10,4 +10,9 @@ client: description: This example adds a/testmynearclipdistancecommand which outputs different things deppending of the current near clip distance. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: This function returns a float containing the actual near clip distance. + requires_review: true diff --git a/functions/World/getOcclusionsEnabled.yaml b/functions/World/getOcclusionsEnabled.yaml index b0bb0822..4167d3d1 100644 --- a/functions/World/getOcclusionsEnabled.yaml +++ b/functions/World/getOcclusionsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetOcclusionsEnabled -server: +shared: name: getOcclusionsEnabled description: This function is used to get "occlusions enabled" state. parameters: [] @@ -8,10 +8,15 @@ server: description: 'This example shows how to disable occlusions after the whole map has been cleared:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if occlusions are enabled, or false otherwise. notes: - type: info content: Occlusions are used by GTA to enhance performance by hiding objects that are (normally) obscured by certain large buildings. However when removeWorldModel is used they may also have the undesired effect of making parts of the map disappear. Disabling occlusions will fix that. - incomplete: true + requires_review: true diff --git a/functions/World/getPedsLODDistance.yaml b/functions/World/getPedsLODDistance.yaml index 5fe202c4..f804aa76 100644 --- a/functions/World/getPedsLODDistance.yaml +++ b/functions/World/getPedsLODDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetPedsLODDistance -client: +shared: name: getPedsLODDistance description: This function gets the peds LOD distance. parameters: [] @@ -8,4 +8,9 @@ client: description: This example adds a/getpedsloddistancecommand which outputs the peds LOD distance to the chatbox. side: client - incomplete: true + returns: + values: + - type: float + name: value + description: This function returns a float containing the peds LOD distance. + requires_review: true diff --git a/functions/World/getRainLevel.yaml b/functions/World/getRainLevel.yaml index 7bdc08ef..d433825c 100644 --- a/functions/World/getRainLevel.yaml +++ b/functions/World/getRainLevel.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRainLevel -server: +shared: name: getRainLevel description: This function is used to get the current rain level. parameters: [] @@ -12,8 +12,13 @@ server: description: Example:Sets the rain (So it can detect it) before returning it. (In this case, when resource starts.) side: server + returns: + values: + - type: float + name: value + description: Returns the rain level as a number. notes: - type: info content: The function will return false server-side if rain level has not been set before the function is called. - incomplete: true + requires_review: true diff --git a/functions/World/getRoofPosition.yaml b/functions/World/getRoofPosition.yaml index 7c353815..9364fa30 100644 --- a/functions/World/getRoofPosition.yaml +++ b/functions/World/getRoofPosition.yaml @@ -1,13 +1,29 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetRoofPosition -client: +shared: name: getRoofPosition description: This function gets the Z level of the lowest roof above a point. It is required that the point is near enough to the local player so that it's within the area where collision data is loaded. - parameters: [] + parameters: + - name: x + type: float + description: A float representing the X world coordinate of the point. + - name: "y" + type: float + description: A float representing the Y world coordinate of the point. + - name: z + type: float + description: A float representing the Z world coordinate of the point. examples: - path: examples/getRoofPosition-1.lua description: 'This example starts to shake the player''s camera if there is no roof over him:' side: client - incomplete: true + returns: + values: + - type: float + name: value + description: Returns a float with the lowest roof-level Z coord if parameters + are valid, false if the point you tried to test is outside the loaded world + map. + requires_review: true diff --git a/functions/World/getScreenFromWorldPosition.yaml b/functions/World/getScreenFromWorldPosition.yaml index 9ccb7f54..69b2bae9 100644 --- a/functions/World/getScreenFromWorldPosition.yaml +++ b/functions/World/getScreenFromWorldPosition.yaml @@ -1,14 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition -client: +shared: name: getScreenFromWorldPosition description: This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [processLineOfSight](/wiki/ProcessLineOfSight "ProcessLineOfSight") for that). - parameters: [] + parameters: + - name: x + type: float + description: A float value indicating the x position in the world. + - name: "y" + type: float + description: A float value indicating the y position in the world. + - name: z + type: float + description: A float value indicating the z position in the world. + - name: edgeTolerance + type: float + description: 'A float value indicating the distance the position can be off screen + before the function returns false. Note: it''s clamped down on both axies to + the size of screen at the given axis*10' + default: '0.0' + - name: relative + type: bool + description: A boolean value that indicates if edgeTolerance is in pixels [false], + or relative to the screen size [true]. + default: 'true' examples: - path: examples/getScreenFromWorldPosition-1.lua description: This example add a '3d' text at coordinates 0, 0, 0 (center of map). side: client - incomplete: true + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns two x , y floats indicating the screen position and float + distance between screen and given position if successful, false otherwise. + requires_review: true diff --git a/functions/World/getSkyGradient.yaml b/functions/World/getSkyGradient.yaml index e3074cae..4419402f 100644 --- a/functions/World/getSkyGradient.yaml +++ b/functions/World/getSkyGradient.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSkyGradient -server: +shared: name: getSkyGradient description: This function will return the current sky color. parameters: [] @@ -7,4 +7,20 @@ server: - path: examples/getSkyGradient-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + - type: int + name: value6 + description: Returns 6 ints , of which the first 3 represent the sky's "top" color, + (in RGB) and the last 3 represent the bottom colors. + requires_review: true diff --git a/functions/World/getSunColor.yaml b/functions/World/getSunColor.yaml index 4c5c81ca..8135f8b0 100644 --- a/functions/World/getSunColor.yaml +++ b/functions/World/getSunColor.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSunColor -server: +shared: name: getSunColor description: This function is used to get the color of the sun. parameters: [] @@ -7,4 +7,19 @@ server: - path: examples/getSunColor-1.lua description: This example lets any player get the color of the sun like /getsuncolor side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + - type: int + name: value4 + - type: int + name: value5 + - type: int + name: value6 + description: Returns the color of the sun as six numbers, false if its default. + requires_review: true diff --git a/functions/World/getSunSize.yaml b/functions/World/getSunSize.yaml index bc82e3d6..f8c2c78d 100644 --- a/functions/World/getSunSize.yaml +++ b/functions/World/getSunSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetSunSize -server: +shared: name: getSunSize description: This function is used to get the size of the sun. parameters: [] @@ -7,8 +7,14 @@ server: - path: examples/getSunSize-1.lua description: This example lets any player get the size of the sun like /getsunsize side: server + returns: + values: + - type: float + name: value + description: Returns the size of the sun as a number, false if the size of the + sun is at its default. notes: - type: info content: The function will return false server-side if sun size has not been set before the function is called. - incomplete: true + requires_review: true diff --git a/functions/World/getTime.yaml b/functions/World/getTime.yaml index 71fd6a33..e6855eab 100644 --- a/functions/World/getTime.yaml +++ b/functions/World/getTime.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTime -server: +shared: name: getTime description: This function is used to get the current time in the game. If you want to get the real server time, use [getRealTime](/wiki/GetRealTime "GetRealTime"). @@ -11,4 +11,11 @@ server: - path: examples/getTime-2.lua description: '' side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns two ints that represent hours and minutes. + requires_review: true diff --git a/functions/World/getTrafficLightState.yaml b/functions/World/getTrafficLightState.yaml index c4cca44e..87d33ad6 100644 --- a/functions/World/getTrafficLightState.yaml +++ b/functions/World/getTrafficLightState.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetTrafficLightState -server: +shared: name: getTrafficLightState description: Gets the current traffic light state. This state controls the traffic light colors. For instance, state **1** will cause the north and south traffic @@ -10,4 +10,9 @@ server: description: This example causes all traffic lights to be out of order. (flashing amber) side: server - incomplete: true + returns: + values: + - type: int + name: value + description: Returns the current state of the traffic lights. + requires_review: true diff --git a/functions/World/getVehiclesLODDistance.yaml b/functions/World/getVehiclesLODDistance.yaml index dc98c063..fb504479 100644 --- a/functions/World/getVehiclesLODDistance.yaml +++ b/functions/World/getVehiclesLODDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetVehiclesLODDistance -client: +shared: name: getVehiclesLODDistance description: Returns the distance of vehicles LOD. parameters: [] @@ -7,4 +7,11 @@ client: - path: examples/getVehiclesLODDistance-1.lua description: This example shows the lod distance of vehicles side: client - incomplete: true + returns: + values: + - type: float + name: value1 + - type: float + name: value2 + description: This example shows the lod distance of vehicles + requires_review: true diff --git a/functions/World/getWeather.yaml b/functions/World/getWeather.yaml index cd684ce2..5e7b4af5 100644 --- a/functions/World/getWeather.yaml +++ b/functions/World/getWeather.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWeather -server: +shared: name: getWeather description: This function returns the current [Weather](/wiki/Weather "Weather") ID. @@ -8,4 +8,14 @@ server: - path: examples/getWeather-1.lua description: This example outputs the current weather ID in that chat box. side: server - incomplete: true + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + description: Returns two integers indicating the weather type that is currently + active. The first integer says what weather is currently considered to be active. + The second integer is the weather id that is being blended into if any, otherwise + it is nil . + requires_review: true diff --git a/functions/World/getWindVelocity.yaml b/functions/World/getWindVelocity.yaml index 4e189a58..6068840a 100644 --- a/functions/World/getWindVelocity.yaml +++ b/functions/World/getWindVelocity.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWindVelocity -server: +shared: name: getWindVelocity description: This function gets the wind velocity in San Andreas. parameters: [] @@ -8,8 +8,18 @@ server: description: This example returns the wind velocity to a player if they use the command 'getwindvelocity'. side: server + returns: + values: + - type: int + name: value1 + - type: int + name: value2 + - type: int + name: value3 + description: This example returns the wind velocity to a player if they use the + command 'getwindvelocity'. notes: - type: info content: The function will return false server-side if wind velocity has not been set before the function is called. - incomplete: true + requires_review: true diff --git a/functions/World/getWorldFromScreenPosition.yaml b/functions/World/getWorldFromScreenPosition.yaml index bbf78a26..ff112ef7 100644 --- a/functions/World/getWorldFromScreenPosition.yaml +++ b/functions/World/getWorldFromScreenPosition.yaml @@ -1,12 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWorldFromScreenPosition -client: +shared: name: getWorldFromScreenPosition description: This function allows you to retrieve the world position corresponding to a 2D position on the screen, at a certain depth. - parameters: [] + parameters: + - name: x + type: float + description: A float value indicating the x position on the screen, in pixels. + - name: "y" + type: float + description: A float value indicating the y position on the screen, in pixels. + - name: depth + type: float + description: A float value indicating the distance from the camera of the point + whose coordinates we are retrieving, in units. examples: - path: examples/getWorldFromScreenPosition-1.lua description: This example binds the local player's "i" key to a function that creates an explosion in the middle of the screen. side: client - incomplete: true + returns: + values: + - type: float + name: x + - type: float + name: "y" + - type: float + name: z + description: Returns three x , y , z floats indicating the world position if successful, + false otherwise. + requires_review: true diff --git a/functions/World/getWorldProperty.yaml b/functions/World/getWorldProperty.yaml index c0c4665f..b8a5acf4 100644 --- a/functions/World/getWorldProperty.yaml +++ b/functions/World/getWorldProperty.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetWorldProperty -client: +shared: name: getWorldProperty description: This function is used to get the values of time cycle and weather related properties. - parameters: [] + parameters: + - name: property + type: string + description: The property you wish to retrieve. examples: - path: examples/getWorldProperty-1.lua description: 'This example prints the value of AmbientColor:' side: client + returns: + values: + - type: mixed + name: value + description: Returns the value of property represented by either 1 or 3 numbers + (RGB, FLOAT, INT) if successful, false otherwise. pair: setWorldProperty - incomplete: true + requires_review: true diff --git a/functions/World/getZoneName.yaml b/functions/World/getZoneName.yaml index d694d83a..a88209ef 100644 --- a/functions/World/getZoneName.yaml +++ b/functions/World/getZoneName.yaml @@ -1,10 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/GetZoneName -server: +shared: name: getZoneName description: This function allows you to retrieve the zone name of a certain location. - parameters: [] + parameters: + - name: x + type: float + description: The X axis position + - name: "y" + type: float + description: The Y axis position + - name: z + type: float + description: The Z axis position + - name: citiesonly + type: bool + description: 'An optional argument to choose if you want to return one of the + following city names: Tierra Robada Bone County Las Venturas San Fierro Red + County Whetstone Flint County Los Santos' + default: 'false' examples: - path: examples/getZoneName-1.lua description: Example 1:This example returns the player's City & Zone. side: server - incomplete: true + returns: + values: + - type: string + name: value + description: Returns the string of the zone name. + requires_review: true diff --git a/functions/World/isAmbientSoundEnabled.yaml b/functions/World/isAmbientSoundEnabled.yaml index 95e41157..10ee42a5 100644 --- a/functions/World/isAmbientSoundEnabled.yaml +++ b/functions/World/isAmbientSoundEnabled.yaml @@ -1,9 +1,12 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsAmbientSoundEnabled -client: +shared: name: isAmbientSoundEnabled description: This function allows you to check if some background sound effects are enabled. - parameters: [] + parameters: + - name: theType + type: string + description: The type of ambient sound to test. Can be either "gunfire" or "general". examples: - path: examples/isAmbientSoundEnabled-1.lua description: 'This command checks if the type of ambient sound is enabled or @@ -11,4 +14,10 @@ client: /check ' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ambient sound is enabled, false if it is disabled + or invalid values were passed. + requires_review: true diff --git a/functions/World/isGarageOpen.yaml b/functions/World/isGarageOpen.yaml index fb8b3005..6f01ce5e 100644 --- a/functions/World/isGarageOpen.yaml +++ b/functions/World/isGarageOpen.yaml @@ -1,11 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsGarageOpen -server: +shared: name: isGarageOpen description: This function checks whether or not a specific garage door is open. - parameters: [] + parameters: + - name: garageID + type: int + description: The garage ID that represents the garage door that is being checked. examples: - path: examples/isGarageOpen-1.lua description: 'This example opens a garage door when a player enters a collision shape near it, and closes it when they leave:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the garage is open, false if it is closed or an invalid + garage ID was given. + requires_review: true diff --git a/functions/World/isLineOfSightClear.yaml b/functions/World/isLineOfSightClear.yaml index 4374e6b2..03829e14 100644 --- a/functions/World/isLineOfSightClear.yaml +++ b/functions/World/isLineOfSightClear.yaml @@ -1,10 +1,68 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsLineOfSightClear -client: +shared: name: isLineOfSightClear description: This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements. Use [processLineOfSight](/wiki/ProcessLineOfSight "ProcessLineOfSight") if you want more information about what the ray hits. - parameters: [] + parameters: + - name: startX + type: float + description: The first point's world X coordinate. + - name: startY + type: float + description: The first point's world Y coordinate. + - name: startZ + type: float + description: The first point's world Z coordinate. + - name: endX + type: float + description: The second point's world X coordinate. + - name: endY + type: float + description: The second point's world Y coordinate. + - name: endZ + type: float + description: The second point's world Z coordinate. + - name: checkBuildings + type: bool + description: Allow the line of sight to be blocked by GTA's internally placed + buildings, i.e. the world map. + default: 'true' + - name: checkVehicles + type: bool + description: Allow the line of sight to be blocked by vehicles . + default: 'true' + - name: checkPeds + type: bool + description: Allow the line of sight to be blocked by peds, i.e. players . + default: 'true' + - name: checkObjects + type: bool + description: Allow the line of sight to be blocked by objects . + default: 'true' + - name: checkDummies + type: bool + description: Allow the line of sight to be blocked by GTA's internal dummies. These + are not used in the current MTA version so this argument can be set to false + . + default: 'true' + - name: seeThroughStuff + type: bool + description: Allow the line of sight to pass through collision materials that + have this flag enabled (By default material IDs 52, 55 and 66 which are some + fences). This flag originally allows some objects to be walked on but you can + shoot throug them. + default: 'false' + - name: ignoreSomeObjectsForCamera + type: bool + description: Allow the line of sight to pass through objects that have (K) property + enabled in "object.dat" data file. (i.e. Most dynamic objects like boxes or + barrels) + default: 'false' + - name: ignoredElement + type: element + description: Allow the line of sight to pass through a certain specified element. + default: nil examples: - path: examples/isLineOfSightClear-1.lua description: "isLineOfSightClear is the economical way to cast a ray in the world.\ @@ -12,10 +70,16 @@ client: \ such as jumping obstacles. A 3D line is drawn connecting the two points in\ \ the ray." side: client + returns: + values: + - type: bool + name: value + description: Returns true if the line between the specified points is clear, false + if there's an obstacle or if invalid parameters are passed. notes: - type: info content: 'This function does currently NOT support collisions with the "shootthrough" flag enabled. That means: isLineOfSightClear will never collide with such collisions and this can lead to unreliabilities. The "shootthrough" flag is used by many beach/sand/underwater objects.' - incomplete: true + requires_review: true diff --git a/functions/World/isTimeFrozen.yaml b/functions/World/isTimeFrozen.yaml index 99b2481b..392a601e 100644 --- a/functions/World/isTimeFrozen.yaml +++ b/functions/World/isTimeFrozen.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsTimeFrozen -client: +shared: name: isTimeFrozen description: This function allows you to check whether time has been frozen using [setTimeFrozen](/wiki/SetTimeFrozen "SetTimeFrozen"). @@ -8,4 +8,9 @@ client: - path: examples/isTimeFrozen-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if time is frozen, false otherwise. + requires_review: true diff --git a/functions/World/isVolumetricShadowsEnabled.yaml b/functions/World/isVolumetricShadowsEnabled.yaml index 58e7c33a..ac29cb71 100644 --- a/functions/World/isVolumetricShadowsEnabled.yaml +++ b/functions/World/isVolumetricShadowsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsVolumetricShadowsEnabled -client: +shared: name: isVolumetricShadowsEnabled description: This function is used to check whether the shadow enabled or not. parameters: [] @@ -8,4 +8,9 @@ client: description: This example used a command to check if volumetric shadows enabled or not. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if enabled, false otherwise. + requires_review: true diff --git a/functions/World/isWorldSoundEnabled.yaml b/functions/World/isWorldSoundEnabled.yaml index ef5d1cb5..704b86bf 100644 --- a/functions/World/isWorldSoundEnabled.yaml +++ b/functions/World/isWorldSoundEnabled.yaml @@ -1,15 +1,27 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsWorldSoundEnabled -client: +shared: name: isWorldSoundEnabled description: This function allows you to check if certain world sound effects have not been disabled by [setWorldSoundEnabled](/wiki/SetWorldSoundEnabled "SetWorldSoundEnabled") - parameters: [] + parameters: + - name: group + type: int + description: MISSING_PARAM_DESC + - name: index + type: int + description: MISSING_PARAM_DESC + default: '-1' examples: - path: examples/isWorldSoundEnabled-1.lua description: This is a simplified example that lets the client toggle their weapon sounds. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the world sounds are enabled, false if they are disabled + or invalid values were passed. meta: - needs_checking: 'This function was partially migrated from the old wiki. Please review manually: @@ -17,3 +29,4 @@ client: - Missing section: OptionalArguments ' + requires_review: true diff --git a/functions/World/isWorldSpecialPropertyEnabled.yaml b/functions/World/isWorldSpecialPropertyEnabled.yaml index c5562105..29bf8349 100644 --- a/functions/World/isWorldSpecialPropertyEnabled.yaml +++ b/functions/World/isWorldSpecialPropertyEnabled.yaml @@ -1,12 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/IsWorldSpecialPropertyEnabled -server: +shared: name: isWorldSpecialPropertyEnabled description: Checks if a special world property (cheat) is enabled or not. - parameters: [] + parameters: + - name: propname + type: string + description: the name of the property to retrieve. Possible values are listed + on SetWorldSpecialPropertyEnabled . examples: - path: examples/isWorldSpecialPropertyEnabled-1.lua description: This code allows you to enable/disable aircars world property using /toggleAirCars command. side: server + returns: + values: + - type: bool + name: value + description: Returns true if the property is enabled, false if it is disabled + or the specified property name is invalid. pair: setWorldSpecialPropertyEnabled - incomplete: true + requires_review: true diff --git a/functions/World/processLineAgainstMesh.yaml b/functions/World/processLineAgainstMesh.yaml index 24313022..4f03df02 100644 --- a/functions/World/processLineAgainstMesh.yaml +++ b/functions/World/processLineAgainstMesh.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ProcessLineAgainstMesh -client: +shared: name: processLineAgainstMesh description: 'Does a raycast against an element''s renderable mesh model \[not the collision model!]. @@ -12,6 +12,45 @@ client: Also, when one is interested in a specific element the overhead is a lot smaller \[as we can skip all the collision detection done by the before\-mentioned function].' - parameters: [] + parameters: + - name: toTest + type: element + description: MISSING_PARAM_DESC + - name: startX + type: float + description: MISSING_PARAM_DESC + - name: startY + type: float + description: MISSING_PARAM_DESC + - name: startZ + type: float + description: MISSING_PARAM_DESC + - name: endX + type: float + description: MISSING_PARAM_DESC + - name: endY + type: float + description: MISSING_PARAM_DESC + - name: endZ + type: float + description: MISSING_PARAM_DESC examples: [] - incomplete: true + returns: + values: + - type: bool + name: value1 + - type: float + name: value2 + - type: float + name: value3 + - type: string + name: value4 + - type: string + name: value5 + - type: float + name: value6 + - type: float + name: value7 + - type: float + name: value8 + requires_review: true diff --git a/functions/World/processLineOfSight.yaml b/functions/World/processLineOfSight.yaml index fb114d9e..ffb8774b 100644 --- a/functions/World/processLineOfSight.yaml +++ b/functions/World/processLineOfSight.yaml @@ -1,11 +1,89 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight -client: +shared: name: processLineOfSight description: This function casts a ray between two points in the world, and tells you information about the point that was hit, if any. The two positions **must** be within the local player's draw distance as the collision data is not loaded outside this area, and the call will just fail as if the ray didn't hit. - parameters: [] + parameters: + - name: startX + type: float + description: The start x position + - name: startY + type: float + description: The start y position + - name: startZ + type: float + description: The start z position + - name: endX + type: float + description: The end x position + - name: endY + type: float + description: The end y position + - name: endZ + type: float + description: The end z position + - name: checkBuildings + type: bool + description: Allow the line of sight to be blocked by GTA's internally placed + buildings, i.e. the world map. + default: 'true' + - name: checkVehicles + type: bool + description: Allow the line of sight to be blocked by vehicles . + default: 'true' + - name: checkPlayers + type: bool + description: Allow the line of sight to be blocked by players . + default: 'true' + - name: checkObjects + type: bool + description: Allow the line of sight to be blocked by objects . + default: 'true' + - name: checkDummies + type: bool + description: Allow the line of sight to be blocked by GTA's internal dummies. These + are not used in the current MTA version so this argument can be set to false + . + default: 'true' + - name: seeThroughStuff + type: bool + description: Allow the line of sight pass through collision materials that have + this flag enabled (By default material IDs 52, 55 and 66 which are some fences + that you can shoot throug but still walk on them). + default: 'false' + - name: ignoreSomeObjectsForCamera + type: bool + description: Allow the line of sight to pass through objects that have (K) property + enabled in "object.dat" data file. (i.e. Most dynamic objects like boxes or + barrels) + default: 'false' + - name: shootThroughStuff + type: bool + description: Allow the line of sight to pass through collision materials that + have this flag enabled (By default material IDs 28, 29, 31, 32, 33, 74, 75, + 76, 77, 78, 79, 96, 97, 98, 99, 100 which are exclusively sand / beach or underwater + objects). + default: 'false' + - name: ignoredElement + type: element + description: Allow the line of sight to pass through a certain specified element. + This is usually set to the object you are tracing from so it does not interfere + with the results. + default: nil + - name: includeWorldModelInformation + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: bIncludeCarTyres + type: bool + description: MISSING_PARAM_DESC + default: 'false' + - name: bIncludeExtraMateriaInfo + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/processLineOfSight-1.lua description: This example shows how you can tell what position and element the @@ -17,6 +95,62 @@ client: note that this function doesn't count if the vehicle is streamed in or not, so expect this function to fail or return incorrect values on unloaded vehicles. side: client + returns: + values: + - type: 'bool -- hit + + float float float -- hitX' + name: value1 + - type: hitY + name: value2 + - type: 'hitZ + + element -- hitElement + + float float float -- normalX' + name: value3 + - type: normalY + name: value4 + - type: 'normalZ + + int -- material + + float -- lighting + + int -- piece + + int -- worldModelID + + float float float -- worldModelPositionX' + name: value5 + - type: "Y" + name: value6 + - type: 'Z + + float float float -- worldModelRotationX' + name: value7 + - type: "Y" + name: value8 + - type: 'Z + + int -- worldLODModelID + + float float -- uvX' + name: value9 + - type: 'uvY + + string -- textureName' + name: value10 + - type: string -- frameName + name: value11 + - type: float float float -- modelHitX + name: value12 + - type: modelHitY + name: value13 + - type: modelHitZ + name: value14 + description: The other values are only filled if there is a collision, they contain + nil otherwise notes: - type: info content: Due to a bug, shootThroughStuff argument does currently check for seeThroughStuff! @@ -24,4 +158,4 @@ client: content: Due to a bug, seeThroughStuff argument has no effect. It mistakenly checks for "shootThrough" surfaces and will always behave as if the argument is set to FALSE (It will never hit). - incomplete: true + requires_review: true diff --git a/functions/World/removeGameWorld.yaml b/functions/World/removeGameWorld.yaml index cb6858d0..f17efe33 100644 --- a/functions/World/removeGameWorld.yaml +++ b/functions/World/removeGameWorld.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveGameWorld -server: +shared: name: removeGameWorld description: This function removes the entire game world and also clears the dummies pool. @@ -8,4 +8,9 @@ server: - path: examples/removeGameWorld-1.lua description: This example removes game world. side: server - incomplete: true + returns: + values: + - type: nil + name: value + description: This function does not return any value. + requires_review: true diff --git a/functions/World/removeWorldModel.yaml b/functions/World/removeWorldModel.yaml index cdbe1261..39cec9fa 100644 --- a/functions/World/removeWorldModel.yaml +++ b/functions/World/removeWorldModel.yaml @@ -1,9 +1,30 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RemoveWorldModel -server: +shared: name: removeWorldModel description: This function is used to remove a world object. Use [restoreWorldModel](/wiki/RestoreWorldModel "RestoreWorldModel") to reverse this action. - parameters: [] + parameters: + - name: modelID + type: int + description: A whole integer specifying the GTASA object model ID. + - name: radius + type: float + description: A floating point number representing the radius that will be eliminated. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: interior + type: int + description: The interior ID to apply the removal to. Some objects in interior + 13 show in all interiors so if you want to remove everything in interior 0 also + remove everything in interior 13. A value of -1 here will affect all interiors. + default: '-1' examples: - path: examples/removeWorldModel-1.lua description: 'This example will removes buildings on BigEar:' @@ -14,8 +35,14 @@ server: - path: examples/removeWorldModel-3.lua description: 'This server script example removes all models, everywhere:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if the world object was removed, false if invalid arguments + were passed. notes: - type: info content: Removing world models doesn't remove their occlusions. This may cause nearby map parts to disappear. Use setOcclusionsEnabled (false) to fix it. - incomplete: true + requires_review: true diff --git a/functions/World/resetAmbientSounds.yaml b/functions/World/resetAmbientSounds.yaml index d4f231df..b3756cdf 100644 --- a/functions/World/resetAmbientSounds.yaml +++ b/functions/World/resetAmbientSounds.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetAmbientSounds -client: +shared: name: resetAmbientSounds description: This function is used to reset the background sounds to the default setting. @@ -8,4 +8,9 @@ client: - path: examples/resetAmbientSounds-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ambient sounds were reset, false otherwise. + requires_review: true diff --git a/functions/World/resetBlurLevel.yaml b/functions/World/resetBlurLevel.yaml index 0396dbe7..26044da6 100644 --- a/functions/World/resetBlurLevel.yaml +++ b/functions/World/resetBlurLevel.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetBlurLevel -client: +shared: name: resetBlurLevel description: Resets the motion blur level on the client's screen to default value (36\). @@ -9,4 +9,9 @@ client: description: 'This example allows the player to reset their blur level with a command:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the blur level was reset successfully, false otherwise. + requires_review: true diff --git a/functions/World/resetColorFilter.yaml b/functions/World/resetColorFilter.yaml index 3920cb13..56fc78af 100644 --- a/functions/World/resetColorFilter.yaml +++ b/functions/World/resetColorFilter.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetColorFilter -client: +shared: name: resetColorFilter description: This function is used to reset the color filtering to its default values. parameters: [] @@ -7,4 +7,9 @@ client: - path: examples/resetColorFilter-1.lua description: 'This example lets any player reset the color filtering:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the color filtering was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetCoronaReflectionsEnabled.yaml b/functions/World/resetCoronaReflectionsEnabled.yaml index b800bcac..fdeb04e1 100644 --- a/functions/World/resetCoronaReflectionsEnabled.yaml +++ b/functions/World/resetCoronaReflectionsEnabled.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetCoronaReflectionsEnabled -client: +shared: name: resetCoronaReflectionsEnabled description: This function resets visibility of corona reflections. Default value depends on client setting. If client has enabled *corona rain reflections* in @@ -7,9 +7,14 @@ client: value of this option using [dxGetStatus](/wiki/DxGetStatus "DxGetStatus") (*SettingCoronaReflections*). parameters: [] examples: [] + returns: + values: + - type: bool + name: value + description: Returns true . issues: - - id: '2755' + - id: 2755 description: Corona reflections do not render on custom placed objects - - id: '2750' + - id: 2750 description: Corona reflections do not render on all roads - incomplete: true + requires_review: true diff --git a/functions/World/resetFarClipDistance.yaml b/functions/World/resetFarClipDistance.yaml index 954db4c2..b6666107 100644 --- a/functions/World/resetFarClipDistance.yaml +++ b/functions/World/resetFarClipDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetFarClipDistance -server: +shared: name: resetFarClipDistance description: This function resets the far clip distance to its default state. parameters: [] @@ -7,6 +7,11 @@ server: - path: examples/resetFarClipDistance-1.lua description: This example will demonstrate basic functionality of the function. side: server + returns: + values: + - type: bool + name: value + description: Returns true if operation was successful, false otherwise. notes: - type: info content: The function will not reset far clip distance client-side, unless it @@ -14,4 +19,4 @@ server: - type: info content: The function will reset the far clip distance to false server-side, as there is no default value to begin with. - incomplete: true + requires_review: true diff --git a/functions/World/resetFogDistance.yaml b/functions/World/resetFogDistance.yaml index 377bbafd..bdbe004f 100644 --- a/functions/World/resetFogDistance.yaml +++ b/functions/World/resetFogDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetFogDistance -server: +shared: name: resetFogDistance description: This function resets the fog render distance to its default state. parameters: [] @@ -7,8 +7,13 @@ server: - path: examples/resetFogDistance-1.lua description: This example will demonstrate basic functionality of the function. side: server + returns: + values: + - type: bool + name: value + description: Returns true if operation was successful, false otherwise. notes: - type: info content: The function will reset the fog render distance to false server-side, as there is no default value to begin with. - incomplete: true + requires_review: true diff --git a/functions/World/resetHeatHaze.yaml b/functions/World/resetHeatHaze.yaml index 9a24200c..001ae1cf 100644 --- a/functions/World/resetHeatHaze.yaml +++ b/functions/World/resetHeatHaze.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetHeatHaze -server: +shared: name: resetHeatHaze description: This function restores the default heat haze. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/resetHeatHaze-1.lua description: This example resets the heat haze. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the heat haze was reset correctly, false otherwise. + requires_review: true diff --git a/functions/World/resetMoonSize.yaml b/functions/World/resetMoonSize.yaml index 797cef84..d177d361 100644 --- a/functions/World/resetMoonSize.yaml +++ b/functions/World/resetMoonSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetMoonSize -server: +shared: name: resetMoonSize description: This function is used to reset the size of the moon to its normal size. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/resetMoonSize-1.lua description: This example lets any player reset the size of the moon like /resetmoonsize side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the size of the moon was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetNearClipDistance.yaml b/functions/World/resetNearClipDistance.yaml index e82e5035..f77dee0a 100644 --- a/functions/World/resetNearClipDistance.yaml +++ b/functions/World/resetNearClipDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetNearClipDistance -client: +shared: name: resetNearClipDistance description: This function resets near clip distance set by [setNearClipDistance](/wiki/SetNearClipDistance "SetNearClipDistance"). @@ -8,4 +8,9 @@ client: - path: examples/resetNearClipDistance-1.lua description: This example will reset near clip distance. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: This example will reset near clip distance. + requires_review: true diff --git a/functions/World/resetPedsLODDistance.yaml b/functions/World/resetPedsLODDistance.yaml index 775db77b..03308cec 100644 --- a/functions/World/resetPedsLODDistance.yaml +++ b/functions/World/resetPedsLODDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetPedsLODDistance -client: +shared: name: resetPedsLODDistance description: Resets the distance of peds LOD to default. Default values depends on client setting. If client has enabled *high detail peds* in video options, @@ -9,4 +9,9 @@ client: - path: examples/resetPedsLODDistance-1.lua description: This adds a command "resetlod", which resets the peds LOD distance. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the peds LOD distance was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetRainLevel.yaml b/functions/World/resetRainLevel.yaml index 8a11dc5e..a3dcf6e1 100644 --- a/functions/World/resetRainLevel.yaml +++ b/functions/World/resetRainLevel.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetRainLevel -server: +shared: name: resetRainLevel description: This function resets the rain level of the current weather to its default. parameters: [] @@ -8,4 +8,9 @@ server: description: This example will make it rain when player or ped enters a vehicle, and stop once it leaves. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the rain level was reset. + requires_review: true diff --git a/functions/World/resetSkyGradient.yaml b/functions/World/resetSkyGradient.yaml index 71b66a6d..407c1801 100644 --- a/functions/World/resetSkyGradient.yaml +++ b/functions/World/resetSkyGradient.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetSkyGradient -server: +shared: name: resetSkyGradient description: This function allows restoring of a changed sky gradient as a result of [setSkyGradient](/wiki/SetSkyGradient "SetSkyGradient"). @@ -8,4 +8,9 @@ server: - path: examples/resetSkyGradient-1.lua description: This example reset the sky gradient. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sky color was reset correctly, false otherwise. + requires_review: true diff --git a/functions/World/resetSunColor.yaml b/functions/World/resetSunColor.yaml index 1f42f402..0d760bfa 100644 --- a/functions/World/resetSunColor.yaml +++ b/functions/World/resetSunColor.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetSunColor -server: +shared: name: resetSunColor description: This function is used to reset the color of the sun to its normal color. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/resetSunColor-1.lua description: This example lets any player reset the color of the sun like /resetsuncolor side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the color of the sun was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetSunSize.yaml b/functions/World/resetSunSize.yaml index c638593c..8439dd55 100644 --- a/functions/World/resetSunSize.yaml +++ b/functions/World/resetSunSize.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetSunSize -server: +shared: name: resetSunSize description: This function is used to reset the size of the sun to its normal size. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/resetSunSize-1.lua description: This example lets any player reset the size of the sun like /resetsunsize side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the size of the sun was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetTimeFrozen.yaml b/functions/World/resetTimeFrozen.yaml index bf691ebd..463fdac1 100644 --- a/functions/World/resetTimeFrozen.yaml +++ b/functions/World/resetTimeFrozen.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetTimeFrozen -client: +shared: name: resetTimeFrozen description: This function unfreezes time frozen using [setTimeFrozen](/wiki/SetTimeFrozen "SetTimeFrozen"). This is equivalent to using [setTimeFrozen](/wiki/SetTimeFrozen @@ -9,4 +9,9 @@ client: - path: examples/resetTimeFrozen-1.lua description: This example let you to unfreeze time side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/World/resetVehiclesLODDistance.yaml b/functions/World/resetVehiclesLODDistance.yaml index 82cdabdb..999e77cf 100644 --- a/functions/World/resetVehiclesLODDistance.yaml +++ b/functions/World/resetVehiclesLODDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVehiclesLODDistance -client: +shared: name: resetVehiclesLODDistance description: Resets the distance of vehicles LOD to default. Default values depends on client setting. If client has enabled *high detail vehicles* in video options, @@ -10,4 +10,9 @@ client: - path: examples/resetVehiclesLODDistance-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the vehicles LOD distance was reset, false otherwise. + requires_review: true diff --git a/functions/World/resetVolumetricShadows.yaml b/functions/World/resetVolumetricShadows.yaml index f6aea6c4..7b5aedac 100644 --- a/functions/World/resetVolumetricShadows.yaml +++ b/functions/World/resetVolumetricShadows.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetVolumetricShadows -client: +shared: name: resetVolumetricShadows description: This function is used to reset the volumetric shadows to the game video setting. @@ -8,4 +8,9 @@ client: - path: examples/resetVolumetricShadows-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/World/resetWindVelocity.yaml b/functions/World/resetWindVelocity.yaml index f58f7080..ba13abce 100644 --- a/functions/World/resetWindVelocity.yaml +++ b/functions/World/resetWindVelocity.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWindVelocity -server: +shared: name: resetWindVelocity description: This function resets the wind velocity in San Andreas to its default state. @@ -13,4 +13,9 @@ server: description: This example returns the wind velocity for all players if they use the command 'resetwindvelocity'. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/World/resetWorldProperties.yaml b/functions/World/resetWorldProperties.yaml index 07709c67..6f137013 100644 --- a/functions/World/resetWorldProperties.yaml +++ b/functions/World/resetWorldProperties.yaml @@ -1,11 +1,46 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWorldProperties -server: +shared: name: resetWorldProperties description: 'Regardless of the value of the arguments, the following properties are reset:' - parameters: [] + parameters: + - name: resetSpecialProperties + type: bool + description: Restores all special world properties changed by setWorldSpecialPropertyEnabled + to default. + default: 'true' + - name: resetWorldProperties + type: bool + description: Reset all world properties changed by setWorldProperty . + default: 'true' + - name: resetWeatherProperties + type: bool + description: Reset all weather properties like heat haze, rain level, sun color + etc. + default: 'true' + - name: resetLODs + type: bool + description: Reset vehicles and peds lod distance. + default: 'true' + - name: resetSounds + type: bool + description: Restore interior sounds, world sounds and ambient sounds. + default: 'true' + - name: resetGlitches + type: bool + description: MISSING_PARAM_DESC + default: 'true' + - name: resetJetpackWeapons + type: bool + description: MISSING_PARAM_DESC + default: 'true' examples: - path: examples/resetWorldProperties-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: nil + name: value + description: This function returns nothing ( nil ). + requires_review: true diff --git a/functions/World/resetWorldProperty.yaml b/functions/World/resetWorldProperty.yaml index f8ab6596..406ff56b 100644 --- a/functions/World/resetWorldProperty.yaml +++ b/functions/World/resetWorldProperty.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWorldProperty -client: +shared: name: resetWorldProperty description: This function is used to reset the values of time cycle and weather related properties. - parameters: [] + parameters: + - name: property + type: string + description: The property you wish to retrieve. examples: [] + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. notes: - type: info content: Some properties (like RainFog and Sandstorm ) are not reset immediately. The game resets it smoothly over small period of time. - incomplete: true + requires_review: true diff --git a/functions/World/resetWorldSounds.yaml b/functions/World/resetWorldSounds.yaml index 094933c9..fd16e2de 100644 --- a/functions/World/resetWorldSounds.yaml +++ b/functions/World/resetWorldSounds.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/ResetWorldSounds -client: +shared: name: resetWorldSounds description: This function is used to reset the world sounds to the default setting. parameters: [] @@ -8,4 +8,9 @@ client: description: By this command player can choose to reset world sounds to the default setting if it has been changed before usingsetWorldSoundEnabled side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the world sounds were reset, false otherwise. + requires_review: true diff --git a/functions/World/restoreAllWorldModels.yaml b/functions/World/restoreAllWorldModels.yaml index ec1d0beb..94b798cc 100644 --- a/functions/World/restoreAllWorldModels.yaml +++ b/functions/World/restoreAllWorldModels.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RestoreAllWorldModels -server: +shared: name: restoreAllWorldModels description: This function allows restoring of all world objects, which were removed with [removeWorldModel](/wiki/RemoveWorldModel "RemoveWorldModel"). @@ -9,4 +9,9 @@ server: description: This example adds command"restoreallworldobjects"that restores all world objects. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the world objects were restored, false otherwise. + requires_review: true diff --git a/functions/World/restoreGameWorld.yaml b/functions/World/restoreGameWorld.yaml index e2f855b9..bd4cb54a 100644 --- a/functions/World/restoreGameWorld.yaml +++ b/functions/World/restoreGameWorld.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RestoreGameWorld -server: +shared: name: restoreGameWorld description: This function restores the entire game world. parameters: [] @@ -7,4 +7,9 @@ server: - path: examples/restoreGameWorld-1.lua description: This example restores game world. side: server - incomplete: true + returns: + values: + - type: nil + name: value + description: This function does not return any value. + requires_review: true diff --git a/functions/World/restoreWorldModel.yaml b/functions/World/restoreWorldModel.yaml index 639cca2d..cb650f2d 100644 --- a/functions/World/restoreWorldModel.yaml +++ b/functions/World/restoreWorldModel.yaml @@ -1,11 +1,35 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/RestoreWorldModel -server: +shared: name: restoreWorldModel description: This function restoring a removed world object, reversing the effect of [removeWorldModel](/wiki/RemoveWorldModel "RemoveWorldModel"). - parameters: [] + parameters: + - name: modelID + type: int + description: A whole integer specifying the GTASA object model ID. + - name: radius + type: float + description: A floating point number representing the radius that will be eliminated. + - name: x + type: float + description: A floating point number representing the X coordinate on the map. + - name: "y" + type: float + description: A floating point number representing the Y coordinate on the map. + - name: z + type: float + description: A floating point number representing the Z coordinate on the map. + - name: iInterior + type: int + description: MISSING_PARAM_DESC + default: '-1' examples: - path: examples/restoreWorldModel-1.lua description: Remove every lamp post (object 1226) besides Grove Street. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the world object was restored, false otherwise. + requires_review: true diff --git a/functions/World/setAircraftMaxHeight.yaml b/functions/World/setAircraftMaxHeight.yaml index 8cf9a65b..cef1c730 100644 --- a/functions/World/setAircraftMaxHeight.yaml +++ b/functions/World/setAircraftMaxHeight.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetAircraftMaxHeight -server: +shared: name: setAircraftMaxHeight description: This function changes the maximum flying height of aircraft. - parameters: [] + parameters: + - name: Height + type: float + description: '' examples: - path: examples/setAircraftMaxHeight-1.lua description: This example shows you a command to set your maximum aircraft height. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/World/setAircraftMaxVelocity.yaml b/functions/World/setAircraftMaxVelocity.yaml index daf5d4d2..658fee3d 100644 --- a/functions/World/setAircraftMaxVelocity.yaml +++ b/functions/World/setAircraftMaxVelocity.yaml @@ -1,10 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetAircraftMaxVelocity -server: +shared: name: setAircraftMaxVelocity description: This function sets the maximum velocity at which aircrafts could fly. Using this function server\-side will overwrite the value that was previously set client\-side. - parameters: [] + parameters: + - name: velocity + type: float + description: The max velocity, can be 0 or any positive value. Default is 1.5 + . examples: - path: examples/setAircraftMaxVelocity-1.lua description: This example will increase or decrease the max velocity by pressing @@ -14,4 +18,9 @@ server: description: This example will double the max velocity for everyone when the resource is started. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the max velocity was set correctly, false otherwise. + requires_review: true diff --git a/functions/World/setAmbientSoundEnabled.yaml b/functions/World/setAmbientSoundEnabled.yaml index 96e76a3e..fc9b9e66 100644 --- a/functions/World/setAmbientSoundEnabled.yaml +++ b/functions/World/setAmbientSoundEnabled.yaml @@ -1,11 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetAmbientSoundEnabled -client: +shared: name: setAmbientSoundEnabled description: 'This function allows you to disable some background sound effects. See also: [setWorldSoundEnabled](/wiki/SetWorldSoundEnabled "SetWorldSoundEnabled").' - parameters: [] + parameters: + - name: theType + type: string + description: The type of ambient sound to toggle. Can be either "gunfire" or "general". + - name: enable + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setAmbientSoundEnabled-1.lua description: 'This example turns off the ambient water and gunfire sounds:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the ambient sound was set correctly, false if invalid + values were passed. + requires_review: true diff --git a/functions/World/setBirdsEnabled.yaml b/functions/World/setBirdsEnabled.yaml index 09ffa90c..4954ae13 100644 --- a/functions/World/setBirdsEnabled.yaml +++ b/functions/World/setBirdsEnabled.yaml @@ -1,10 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetBirdsEnabled -client: +shared: name: setBirdsEnabled description: This function allows you to disable the flying birds. - parameters: [] + parameters: + - name: enable + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setBirdsEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the birds state was changed succesfully, false if + an invalid argument was specified. + requires_review: true diff --git a/functions/World/setCloudsEnabled.yaml b/functions/World/setCloudsEnabled.yaml index a3fd15d6..3afd8d34 100644 --- a/functions/World/setCloudsEnabled.yaml +++ b/functions/World/setCloudsEnabled.yaml @@ -1,11 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCloudsEnabled -server: +shared: name: setCloudsEnabled description: This function will enable or disable clouds. This is useful for race maps which are placed high up as clouds can cause low FPS. - parameters: [] + parameters: + - name: enabled + type: bool + description: A boolean value determining if clouds should be shown. Use true to + show clouds and false to hide them. examples: - path: examples/setCloudsEnabled-1.lua description: This example disables clouds for all players when resource starts. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the cloud state was changed succesfully, false if + an invalid argument was specified. + requires_review: true diff --git a/functions/World/setColorFilter.yaml b/functions/World/setColorFilter.yaml index a5652958..38bfba1f 100644 --- a/functions/World/setColorFilter.yaml +++ b/functions/World/setColorFilter.yaml @@ -1,15 +1,44 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetColorFilter -client: +shared: name: setColorFilter description: This function is used to override the default color filtering values. - parameters: [] + parameters: + - name: aRed + type: int + description: The amount of red (0-255). + - name: aGreen + type: int + description: The amount of green (0-255). + - name: aBlue + type: int + description: The amount of blue (0-255). + - name: aAlpha + type: int + description: The amount of alpha (0-255). + - name: bRed + type: int + description: The amount of red (0-255). + - name: bGreen + type: int + description: The amount of green (0-255). + - name: bBlue + type: int + description: The amount of blue (0-255). + - name: bAlpha + type: int + description: The amount of alpha (0-255). examples: - path: examples/setColorFilter-1.lua description: 'This example lets any player disable the default color filtering:' side: client + returns: + values: + - type: bool + name: value + description: Returns true if the color filter was set, false otherwise. notes: - type: tip content: Normally the game is adding these colors to a screen to simulate weather effects. Sometimes it can be important to disable these effects. You can get rid of the effects by calling this function with zero values. - incomplete: true + requires_review: true diff --git a/functions/World/setCoronaReflectionsEnabled.yaml b/functions/World/setCoronaReflectionsEnabled.yaml index 951c6405..b703f7e2 100644 --- a/functions/World/setCoronaReflectionsEnabled.yaml +++ b/functions/World/setCoronaReflectionsEnabled.yaml @@ -1,15 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetCoronaReflectionsEnabled -client: +shared: name: setCoronaReflectionsEnabled description: This function sets visibility of corona reflections. - parameters: [] + parameters: + - name: enabled + type: int + description: '0 : disabled 1 : enabled (will be visible during rain) 2 : force + enabled (will be visible even if there is no rain)' examples: - path: examples/setCoronaReflectionsEnabled-1.lua description: '' side: client + returns: + values: + - type: bool + name: value + description: Returns true if passed arguments are correct, false otherwise. issues: - - id: '2755' + - id: 2755 description: Corona reflections do not render on custom placed objects - - id: '2750' + - id: 2750 description: Corona reflections do not render on all roads - incomplete: true + requires_review: true diff --git a/functions/World/setFarClipDistance.yaml b/functions/World/setFarClipDistance.yaml index 166bcb11..c1f75d9a 100644 --- a/functions/World/setFarClipDistance.yaml +++ b/functions/World/setFarClipDistance.yaml @@ -1,9 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetFarClipDistance -server: +shared: name: setFarClipDistance description: This function is used to set the distance of render. Areas beyond the specified distance will not be rendered. - parameters: [] + parameters: + - name: distance + type: float + description: A float specifying the distance of render. Setting this less than + 5 will cause problems to the client. examples: - path: examples/setFarClipDistance-1.lua description: This example adjusts the visibility range of the game world. @@ -11,4 +15,10 @@ server: - path: examples/setFarClipDistance-2.lua description: This example adjusts the visibility range of the game world. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the distance was set correctly, false if invalid + arguments were passed. + requires_review: true diff --git a/functions/World/setFogDistance.yaml b/functions/World/setFogDistance.yaml index 3be9d66a..1246a1a5 100644 --- a/functions/World/setFogDistance.yaml +++ b/functions/World/setFogDistance.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetFogDistance -server: +shared: name: setFogDistance description: This function changes the distance at which fog appears. Keep in mind that this function doesn't change the distance of render. - parameters: [] + parameters: + - name: distance + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setFogDistance-1.lua description: This example makes any weather very clear when the resource that contains it starts. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the distance changed successfully, false if bad arguments + were passed. + requires_review: true diff --git a/functions/World/setGameSpeed.yaml b/functions/World/setGameSpeed.yaml index 26c42599..38bcce1f 100644 --- a/functions/World/setGameSpeed.yaml +++ b/functions/World/setGameSpeed.yaml @@ -1,8 +1,11 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGameSpeed -server: +shared: name: setGameSpeed description: This function sets the game speed to the given value. - parameters: [] + parameters: + - name: value + type: float + description: The float value of the game speed (Range 0 - 10) examples: - path: examples/setGameSpeed-1.lua description: '' @@ -10,4 +13,11 @@ server: - path: examples/setGameSpeed-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: 'Returns true if the gamespeed was set successfully, false otherwise. + + The normal game speed is ''1''.' + requires_review: true diff --git a/functions/World/setGarageOpen.yaml b/functions/World/setGarageOpen.yaml index f3d31fd3..aded89de 100644 --- a/functions/World/setGarageOpen.yaml +++ b/functions/World/setGarageOpen.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGarageOpen -server: +shared: name: setGarageOpen description: This function opens or closes the specified garage door in the world. - parameters: [] + parameters: + - name: garageID + type: int + description: The garage ID that represents the garage door being opened or closed. + - name: open + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setGarageOpen-1.lua description: 'This example opens a garage door when a player enters a collision @@ -12,6 +18,11 @@ server: description: 'This example opens each garage door when a player enters a collision shape near it, and closes it when they leave:' side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false if an invalid garage id was given. notes: - type: info content: setGarageOpen does not work with ID 32 (Pay 'n' Spray near Royal Casino). @@ -19,4 +30,4 @@ server: (see TheJizzy's video "BETA Leftovers and Glitches" at 12:12 timestamp). You can remove the door by using removeWorldModel and recreating it for later with moveObject . - incomplete: true + requires_review: true diff --git a/functions/World/setGrainLevel.yaml b/functions/World/setGrainLevel.yaml index 594341d8..a20e2f46 100644 --- a/functions/World/setGrainLevel.yaml +++ b/functions/World/setGrainLevel.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGrainLevel -client: +shared: name: setGrainLevel description: This function sets a level of the overlay grain effect. The game will draw it on top of other grain effects. It can be used to imitate an effect of radiation or electromagnetic disturbances, for example. - parameters: [] + parameters: + - name: level + type: int + description: The amount of grain (0-255). examples: - path: examples/setGrainLevel-1.lua description: 'This example creates a radioactive zone at Missionary Hills:' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the grain level was set, false otherwise. + requires_review: true diff --git a/functions/World/setGrainMultiplier.yaml b/functions/World/setGrainMultiplier.yaml index c44f8fcd..032e4d09 100644 --- a/functions/World/setGrainMultiplier.yaml +++ b/functions/World/setGrainMultiplier.yaml @@ -1,12 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGrainMultiplier -client: +shared: name: setGrainMultiplier description: This function is used to adjust an intensity of the grain effect in different situations. It separately modulates an intensity of effect for infrared goggles, night vision goggles, rain and screen overlay. - parameters: [] + parameters: + - name: modifierName + type: string + description: MISSING_PARAM_DESC + - name: multiplier + type: float + description: MISSING_PARAM_DESC examples: - path: examples/setGrainMultiplier-1.lua description: This example disables a grain effect for the rain. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the grain multiplier was set, false otherwise. + requires_review: true diff --git a/functions/World/setGravity.yaml b/functions/World/setGravity.yaml index 40682d7f..3ef2b144 100644 --- a/functions/World/setGravity.yaml +++ b/functions/World/setGravity.yaml @@ -1,15 +1,23 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetGravity -server: +shared: name: setGravity description: This function sets the server's gravity level. - parameters: [] + parameters: + - name: level + type: float + description: The level of gravity (default is 0.008 ). examples: - path: examples/setGravity-1.lua description: '' side: server + returns: + values: + - type: bool + name: value + description: Returns true if gravity was changed, false otherwise. notes: - type: info content: This will override setPedGravity applied to peds/players. Setting the gravity level to different values on clients can cause animation bugs (players floating across ground because players see different fall animation.) - incomplete: true + requires_review: true diff --git a/functions/World/setHeatHaze.yaml b/functions/World/setHeatHaze.yaml index abf69c76..3c4e0a04 100644 --- a/functions/World/setHeatHaze.yaml +++ b/functions/World/setHeatHaze.yaml @@ -1,8 +1,47 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetHeatHaze -server: +shared: name: setHeatHaze description: This function changes the heat haze effect. - parameters: [] + parameters: + - name: intensity + type: int + description: The intensity of the effect, from 0 to 255. + - name: randomShift + type: int + description: Sets a random jitter, from 0 to 255. + default: '0' + - name: speedMin + type: int + description: The slowest effect speed, from 0 to 1000. + default: '12' + - name: speedMax + type: int + description: The fastest effect speed, from 0 to 1000. + default: '18' + - name: scanSizeX + type: int + description: The X size in pixels of the chunk grabbed from the screen, from -1000 + to 1000. + default: '75' + - name: scanSizeY + type: int + description: The Y size in pixels of the chunk grabbed from the screen, from -1000 + to 1000. + default: '80' + - name: renderSizeX + type: int + description: The X size in pixels the chunk will be when rendered back to the + screen, from 0 to 1000. + default: '80' + - name: renderSizeY + type: int + description: The Y size in pixels the chunk will be when rendered back to the + screen, from 0 to 1000. + default: '85' + - name: bShowInside + type: bool + description: Set to true to enable the heat haze effect when inside a building. + default: 'false' examples: - path: examples/setHeatHaze-1.lua description: 'Example 1:This example turns the heat haze effect off:' @@ -10,4 +49,10 @@ server: - path: examples/setHeatHaze-2.lua description: 'Example 2:This example will have an interesting effect:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the heat haze effect was set correctly, false if + invalid values were passed. + requires_review: true diff --git a/functions/World/setInteriorFurnitureEnabled.yaml b/functions/World/setInteriorFurnitureEnabled.yaml index 8158be0c..1c6af7ad 100644 --- a/functions/World/setInteriorFurnitureEnabled.yaml +++ b/functions/World/setInteriorFurnitureEnabled.yaml @@ -1,11 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetInteriorFurnitureEnabled -client: +shared: name: setInteriorFurnitureEnabled description: This function toggles furniture generation in interiors with the specified room ID. - parameters: [] + parameters: + - name: roomID + type: int + description: 'The room type which you want disable or enable the furniture in: + 0 : shop 1 : office 2 : lounge 3 : bedroom 4 : kitchen' + - name: enabled + type: bool + description: A bool representing whether the interior furniture is enabled or + disabled. examples: - path: examples/setInteriorFurnitureEnabled-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/World/setInteriorSoundsEnabled.yaml b/functions/World/setInteriorSoundsEnabled.yaml index 5794fd90..fdf9ef99 100644 --- a/functions/World/setInteriorSoundsEnabled.yaml +++ b/functions/World/setInteriorSoundsEnabled.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetInteriorSoundsEnabled -server: +shared: name: setInteriorSoundsEnabled description: This function disables or enables the ambient sounds played by GTA in most interiors, like restaurants, casinos, clubs, houses, etc. - parameters: [] + parameters: + - name: enabled + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setInteriorSoundsEnabled-1.lua description: This example disables the dancing club ambient music, without disabling other interiors' ambient sounds. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: If a boolean was passed to the function, it always succeeds and returns + true . + requires_review: true diff --git a/functions/World/setJetpackMaxHeight.yaml b/functions/World/setJetpackMaxHeight.yaml index 4ddcf8cf..bb94f583 100644 --- a/functions/World/setJetpackMaxHeight.yaml +++ b/functions/World/setJetpackMaxHeight.yaml @@ -1,10 +1,18 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetJetpackMaxHeight -server: +shared: name: setJetpackMaxHeight description: This function changes the maximum flying height of jetpack. - parameters: [] + parameters: + - name: Height + type: float + description: The max height starting at approximately -20. examples: - path: examples/setJetpackMaxHeight-1.lua description: This example shows you a command to set your maximum jetpack height. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/World/setJetpackWeaponEnabled.yaml b/functions/World/setJetpackWeaponEnabled.yaml index 260ff07d..91de4b6b 100644 --- a/functions/World/setJetpackWeaponEnabled.yaml +++ b/functions/World/setJetpackWeaponEnabled.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetJetpackWeaponEnabled -server: +shared: name: setJetpackWeaponEnabled description: This function sets a weapon usable while using the Jetpack. - parameters: [] + parameters: + - name: weaponID/string weaponName + type: int + description: MISSING_PARAM_DESC + - name: enabled + type: bool + description: MISSING_PARAM_DESC examples: - path: examples/setJetpackWeaponEnabled-1.lua description: This example enables the M4 to be fired while using a jetpack and @@ -12,8 +18,13 @@ server: description: This example enables the M4, sniper rifle and country rifle to be fired while using a jetpack and announces it in the chat. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, or false if invalid arguments are passed. notes: - type: info content: colt 45, sawed-off, tec-9 and uzi are always enabled for the Jetpack and are not affected by this function. - incomplete: true + requires_review: true diff --git a/functions/World/setMinuteDuration.yaml b/functions/World/setMinuteDuration.yaml index ae2beb39..8bdcf77d 100644 --- a/functions/World/setMinuteDuration.yaml +++ b/functions/World/setMinuteDuration.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMinuteDuration -server: +shared: name: setMinuteDuration description: Sets the real\-world duration of an ingame minute. The GTA default is 1000\. - parameters: [] + parameters: + - name: milliseconds + type: int + description: the new duration of an ingame minute, accepted values 0 - 2147483647. examples: - path: examples/setMinuteDuration-1.lua description: '' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. + requires_review: true diff --git a/functions/World/setMoonSize.yaml b/functions/World/setMoonSize.yaml index 1f8f95ff..cd573acb 100644 --- a/functions/World/setMoonSize.yaml +++ b/functions/World/setMoonSize.yaml @@ -1,12 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetMoonSize -server: +shared: name: setMoonSize description: This function sets the moon size. Using this function server\-side will overwrite the value that was previously set client\-side. - parameters: [] + parameters: + - name: size + type: int + description: The size, can be 0 or any positive value. Default is 3 . examples: - path: examples/setMoonSize-1.lua description: This example change moon size to looks more realistic for everyone when the resource is started. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the moon size was set correctly, false otherwise. + requires_review: true diff --git a/functions/World/setNearClipDistance.yaml b/functions/World/setNearClipDistance.yaml index 2e25a8c4..8fbc80da 100644 --- a/functions/World/setNearClipDistance.yaml +++ b/functions/World/setNearClipDistance.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetNearClipDistance -client: +shared: name: setNearClipDistance description: 'This function sets the distance from the [camera](/wiki/Camera "Camera") at which the world starts rendering. Do not use this function unless you have @@ -7,16 +7,26 @@ client: It can be used in many ways, including: reducing Z\-fighting, creating more sophisticated first person views, allowing the camera to fly closer to the ground without passing through it, etcetera.' - parameters: [] + parameters: + - name: distance + type: float + description: the new near clip distance. It must be between 0.1 and 20 for the + function to do any effect. Default value is 0.3 . examples: - path: examples/setNearClipDistance-1.lua description: This example allows the camera to be nearer to ground level without viewing what is under it. side: client + returns: + values: + - type: bool + name: value + description: This function returns true if the argument is valid. Returns false + otherwise. notes: - type: info content: setNearClipDistance should only be used when the camera orientation is controlled by setCameraMatrix , because GTA automatically adjusts this value for the optimum setting when the camera is attached to a player. Therefore ensure resetNearClipDistance is called when returning camera control back to GTA. - incomplete: true + requires_review: true diff --git a/functions/World/setOcclusionsEnabled.yaml b/functions/World/setOcclusionsEnabled.yaml index f436d5ad..4808fb63 100644 --- a/functions/World/setOcclusionsEnabled.yaml +++ b/functions/World/setOcclusionsEnabled.yaml @@ -1,15 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetOcclusionsEnabled -server: +shared: name: setOcclusionsEnabled description: This function is used to enable or disable occlusions. Occlusions are used by GTA to enhance performance by hiding objects that are (normally) obscured by certain large buildings. However when [removeWorldModel](/wiki/RemoveWorldModel "RemoveWorldModel") is used they may also have the undesired effect of making parts of the map disappear. Disabling occlusions will fix that. - parameters: [] + parameters: + - name: enabled + type: bool + description: A bool specifying if GTA occlusions should be enabled examples: - path: examples/setOcclusionsEnabled-1.lua description: 'This example shows occlusions being disabled after the whole map has been cleared:' side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the setting was set correctly, false if invalid arguments + were passed. + requires_review: true diff --git a/functions/World/setPedsLODDistance.yaml b/functions/World/setPedsLODDistance.yaml index fc90e6bf..f19bee75 100644 --- a/functions/World/setPedsLODDistance.yaml +++ b/functions/World/setPedsLODDistance.yaml @@ -1,10 +1,20 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetPedsLODDistance -client: +shared: name: setPedsLODDistance description: This function sets the peds LOD distance. - parameters: [] + parameters: + - name: distance + type: float + description: the new peds LOD distance. This value is clamped to 0 – 500 . (Default + for high_detail_peds on is 500 , when off, it is 60 ). examples: - path: examples/setPedsLODDistance-1.lua description: This example sets the peds LOD distance to 120. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns true if the argument is valid. Returns false + otherwise. + requires_review: true diff --git a/functions/World/setRainLevel.yaml b/functions/World/setRainLevel.yaml index 25d86ebe..00fc48c5 100644 --- a/functions/World/setRainLevel.yaml +++ b/functions/World/setRainLevel.yaml @@ -1,12 +1,22 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetRainLevel -server: +shared: name: setRainLevel description: This function sets the rain level to any weather available in GTA. Use [resetRainLevel](/wiki/ResetRainLevel "ResetRainLevel") to undo the changes. - parameters: [] + parameters: + - name: level + type: float + description: 'A floating point number representing the rain level. 1 represents + the maximum rain level usually available in GTA, but higher values are accepted. + Note: The level value is clamped between 0.0 and 10.0 to avoid gameplay issues.' examples: - path: examples/setRainLevel-1.lua description: This example will make it rain when player or ped enters a vehicle, and stop once it leaves. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the rain level was set, false otherwise. + requires_review: true diff --git a/functions/World/setSkyGradient.yaml b/functions/World/setSkyGradient.yaml index dd9ee9f4..0e46614f 100644 --- a/functions/World/setSkyGradient.yaml +++ b/functions/World/setSkyGradient.yaml @@ -1,8 +1,32 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSkyGradient -server: +shared: name: setSkyGradient description: This function changes the sky color to a two\-color gradient. - parameters: [] + parameters: + - name: topRed + type: int + description: The red value of the upper part of the sky, from 0 to 255. + default: '0' + - name: topGreen + type: int + description: The green value of the upper part of the sky, from 0 to 255. + default: '0' + - name: topBlue + type: int + description: The blue value of the upper part of the sky, from 0 to 255. + default: '0' + - name: bottomRed + type: int + description: The red value of the lower part of the sky, from 0 to 255. + default: '0' + - name: bottomGreen + type: int + description: The green value of the lower part of the sky, from 0 to 255. + default: '0' + - name: bottomBlue + type: int + description: The blue value of the lower part of the sky, from 0 to 255. + default: '0' examples: - path: examples/setSkyGradient-1.lua description: '' @@ -10,4 +34,10 @@ server: - path: examples/setSkyGradient-2.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if sky color was set correctly, false if invalid values + were passed. + requires_review: true diff --git a/functions/World/setSunColor.yaml b/functions/World/setSunColor.yaml index ce8cb492..60e6a5c7 100644 --- a/functions/World/setSunColor.yaml +++ b/functions/World/setSunColor.yaml @@ -1,11 +1,34 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSunColor -server: +shared: name: setSunColor description: This function is used to set the color of the sun. - parameters: [] + parameters: + - name: aRed + type: int + description: The amount of red (0-255) you want the sun to be. + - name: aGreen + type: int + description: The amount of green (0-255) you want the sun to be. + - name: aBlue + type: int + description: The amount of blue (0-255) you want the sun to be. + - name: bRed + type: int + description: The amount of red (0-255) you want the sun to be. + - name: bGreen + type: int + description: The amount of green (0-255) you want the sun to be. + - name: bBlue + type: int + description: The amount of blue (0-255) you want the sun to be. examples: - path: examples/setSunColor-1.lua description: This example lets any player set the color of the sun like /setsuncolor 255 0 0 side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the color of the sun was set, false otherwise. + requires_review: true diff --git a/functions/World/setSunSize.yaml b/functions/World/setSunSize.yaml index c789ad9a..d51b2a4f 100644 --- a/functions/World/setSunSize.yaml +++ b/functions/World/setSunSize.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetSunSize -server: +shared: name: setSunSize description: This function is used to set the size of the sun. - parameters: [] + parameters: + - name: Size + type: int + description: The size you want the sun to be in the sky. examples: - path: examples/setSunSize-1.lua description: This example lets any player set the size of the sun like /setsunsize 2 side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the size of the sun was set, false otherwise. + requires_review: true diff --git a/functions/World/setTime.yaml b/functions/World/setTime.yaml index eeb307b5..7033c717 100644 --- a/functions/World/setTime.yaml +++ b/functions/World/setTime.yaml @@ -1,8 +1,14 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTime -server: +shared: name: setTime description: This function sets the current GTA time to the given time. - parameters: [] + parameters: + - name: hour + type: int + description: The hour of the new time (range 0-23). + - name: minute + type: int + description: The minute of the new time (range 0-59). examples: - path: examples/setTime-1.lua description: This serverside function sets the time and notifies players. @@ -10,4 +16,9 @@ server: - path: examples/setTime-2.lua description: This example freeze the time. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the new time was successfully set, false otherwise. + requires_review: true diff --git a/functions/World/setTimeFrozen.yaml b/functions/World/setTimeFrozen.yaml index 6e7a105b..4fe1b943 100644 --- a/functions/World/setTimeFrozen.yaml +++ b/functions/World/setTimeFrozen.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTimeFrozen -client: +shared: name: setTimeFrozen description: This function will freeze the game time. It will affect the sky as well prevent it from changes. - parameters: [] + parameters: + - name: state + type: bool + description: if set to true it will freeze the time, false otherwise. examples: - path: examples/setTimeFrozen-1.lua description: This example let you freeze the time side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/World/setTrafficLightState.yaml b/functions/World/setTrafficLightState.yaml index 38e2734e..7ba27cbc 100644 --- a/functions/World/setTrafficLightState.yaml +++ b/functions/World/setTrafficLightState.yaml @@ -1,13 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrafficLightState -server: +shared: name: setTrafficLightState description: Sets the current traffic light state. This state controls the traffic light colors. For instance, state **1** will cause the north and south traffic lights to be amber, and the ones left and east will turn red. - parameters: [] + parameters: + - name: state + type: int + description: 'If an integer is provided, the state you wish to use (possible values: + 0-9). Else, one of the following strings: auto : Sets the traffic lights default + behavior (switches the colors automatically). disabled : Turns traffic lights + off.' examples: - path: examples/setTrafficLightState-1.lua description: This example causes all traffic lights to be out of order. (flashing amber) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the state was successfully set, false otherwise. + requires_review: true diff --git a/functions/World/setTrafficLightsLocked.yaml b/functions/World/setTrafficLightsLocked.yaml index 6090a6c6..eaa5eea3 100644 --- a/functions/World/setTrafficLightsLocked.yaml +++ b/functions/World/setTrafficLightsLocked.yaml @@ -1,12 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetTrafficLightsLocked -server: +shared: name: setTrafficLightsLocked description: Toggles whether you want the traffic lights to be locked. If the lights are locked, it means they won't change unless you do [setTrafficLightState](/wiki/SetTrafficLightState "SetTrafficLightState"). - parameters: [] + parameters: + - name: toggle + type: bool + description: A bool indicating whether you want the traffic lights to change automatically, + or not examples: - path: examples/setTrafficLightsLocked-1.lua description: This example toggles traffic lights between 'locked' and 'unlocked'. side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the successful, false otherwise. + requires_review: true diff --git a/functions/World/setVehiclesLODDistance.yaml b/functions/World/setVehiclesLODDistance.yaml index 996d51d4..27062e89 100644 --- a/functions/World/setVehiclesLODDistance.yaml +++ b/functions/World/setVehiclesLODDistance.yaml @@ -1,10 +1,25 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVehiclesLODDistance -client: +shared: name: setVehiclesLODDistance description: Sets the distance of vehicles LOD. - parameters: [] + parameters: + - name: vehiclesDistance + type: float + description: general distance used for most vehicles, this value is clamped to + 0 – 500 + - name: trainsAndPlanesDistance + type: float + description: distance used for trains and planes, this value is clamped to 0 – + 500 + default: vehiclesDistance * 2.14 examples: - path: examples/setVehiclesLODDistance-1.lua description: '' side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: This function returns true if arguments are valid. Returns false + otherwise. + requires_review: true diff --git a/functions/World/setVolumetricShadowsEnabled.yaml b/functions/World/setVolumetricShadowsEnabled.yaml index 1330c9b7..881f4d0a 100644 --- a/functions/World/setVolumetricShadowsEnabled.yaml +++ b/functions/World/setVolumetricShadowsEnabled.yaml @@ -1,11 +1,19 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetVolumetricShadowsEnabled -client: +shared: name: setVolumetricShadowsEnabled description: This function used to enable or disable volumetric shadows. - parameters: [] + parameters: + - name: state + type: bool + description: if set true it will enable the volumetric shadows, false otherwise. examples: - path: examples/setVolumetricShadowsEnabled-1.lua description: This example check if volumetric shadows enabled, if not enabled then enable it and set the shadow alpha. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Always returns true . + requires_review: true diff --git a/functions/World/setWeather.yaml b/functions/World/setWeather.yaml index 7ac5d83e..8a371aec 100644 --- a/functions/World/setWeather.yaml +++ b/functions/World/setWeather.yaml @@ -1,10 +1,13 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeather -server: +shared: name: setWeather description: This function sets the current [weather](/wiki/Weather "Weather") to the given valid value. To change the weather gradually, see [setWeatherBlended](/wiki/SetWeatherBlended "SetWeatherBlended"). - parameters: [] + parameters: + - name: weatherID + type: int + description: The ID of new weather . Valid values are 0 to 255 inclusive. examples: - path: examples/setWeather-1.lua description: This example will change the weather to foggy. @@ -13,4 +16,10 @@ server: description: This example allows you to change weather with a command. (Anything above 255 resets, so 256 will be 0 and so on) side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if the weather was set succesfully, false if an invalid + weatherID was specified. + requires_review: true diff --git a/functions/World/setWeatherBlended.yaml b/functions/World/setWeatherBlended.yaml index b496ec95..86d4673e 100644 --- a/functions/World/setWeatherBlended.yaml +++ b/functions/World/setWeatherBlended.yaml @@ -1,5 +1,5 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWeatherBlended -server: +shared: name: setWeatherBlended description: This function will change the current [weather](/wiki/Weather "Weather") to another in a smooth manner, over the period of 1\-2 in\-game hours (unlike @@ -7,11 +7,20 @@ server: To ensure this transition performs as expected, you should not call this function until [getWeather](/wiki/GetWeather "GetWeather") indicates that no transition is already being done. - parameters: [] + parameters: + - name: weatherID + type: int + description: The ID of the weather state you wish to set. Valid values are 0 to + 255 inclusive. examples: - path: examples/setWeatherBlended-1.lua description: This example sets the weather to sunny, then makes it change to a foggy over the period of one-two hours (assuming that a in-game hour is a minute in real time). side: server - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false if an invalid weatherID is passed. + requires_review: true diff --git a/functions/World/setWindVelocity.yaml b/functions/World/setWindVelocity.yaml index 106323b9..6644380c 100644 --- a/functions/World/setWindVelocity.yaml +++ b/functions/World/setWindVelocity.yaml @@ -1,12 +1,26 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWindVelocity -server: +shared: name: setWindVelocity description: This function changes the wind velocity. The wind shakes the vegetation and makes particles fly in a direction. The intensity and direction of the effect deppends of the wind velocity in each axis. - parameters: [] + parameters: + - name: velocityX + type: float + description: The velocity of the wind along the x axis. + - name: velocityY + type: float + description: The velocity of the wind along the y axis. + - name: velocityZ + type: float + description: The velocity of the wind along the z axis. examples: - path: examples/setWindVelocity-1.lua description: This example shows how to make a simple /windVelocity command. side: client - incomplete: true + returns: + values: + - type: bool + name: value + description: Returns true if successful, false if bad arguments were passed. + requires_review: true diff --git a/functions/World/setWorldProperty.yaml b/functions/World/setWorldProperty.yaml index fa79b883..e86ab16c 100644 --- a/functions/World/setWorldProperty.yaml +++ b/functions/World/setWorldProperty.yaml @@ -1,9 +1,21 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWorldProperty -client: +shared: name: setWorldProperty description: The downside of overriding is the need to implement custom blending (to change weather properties over time creating night / day cycle). - parameters: [] + parameters: + - name: property + type: string + description: The property you wish to override. + - name: value + type: var + description: MISSING_PARAM_DESC + - name: value + type: var + description: MISSING_PARAM_DESC + - name: value + type: var + description: MISSING_PARAM_DESC examples: - path: examples/setWorldProperty-1.lua description: 'This example makes volumetric shadows darker:' @@ -11,6 +23,11 @@ client: - path: examples/setWorldProperty-2.lua description: 'This example turns off street lights:' side: client + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. pair: getWorldProperty notes: - type: info @@ -23,4 +40,4 @@ client: (to change weather properties over time creating night / day cycle). - type: tip content: 'Test resource: worldprops.zip' - incomplete: true + requires_review: true diff --git a/functions/World/setWorldSoundEnabled.yaml b/functions/World/setWorldSoundEnabled.yaml index 094e5ba8..493537a1 100644 --- a/functions/World/setWorldSoundEnabled.yaml +++ b/functions/World/setWorldSoundEnabled.yaml @@ -1,10 +1,24 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWorldSoundEnabled -client: +shared: name: setWorldSoundEnabled description: This function allows you to disable world sounds. A world sound is a sound effect which has ***not*** been caused by [playSound](/wiki/PlaySound "PlaySound") or [playSound3D](/wiki/PlaySound3D "PlaySound3D"). - parameters: [] + parameters: + - name: group + type: int + description: An integer representing the world sound group . + - name: index + type: int + description: An integer representing an individual sound within the group + default: '-1' + - name: enable + type: bool + description: Set to false to disable, true to enable. + - name: immediate + type: bool + description: MISSING_PARAM_DESC + default: 'false' examples: - path: examples/setWorldSoundEnabled-1.lua description: This is a simplified example that lets the client toggle their weapon @@ -17,6 +31,12 @@ client: description: This example disables the wind sound effect immediately without changing the interior afterwards. side: client + returns: + values: + - type: bool + name: value + description: Returns true if the world sound was correctly enabled/disabled, false + if invalid values were passed. notes: - type: info content: 'The values for group and index can be determined by using the client @@ -24,4 +44,4 @@ client: is set to false , this function won''t affect sounds which are already playing (such as the wind that can only be stopped by entering an interior.) See also: setAmbientSoundEnabled .' - incomplete: true + requires_review: true diff --git a/functions/World/setWorldSpecialPropertyEnabled.yaml b/functions/World/setWorldSpecialPropertyEnabled.yaml index fbe869a3..cd3a616f 100644 --- a/functions/World/setWorldSpecialPropertyEnabled.yaml +++ b/functions/World/setWorldSpecialPropertyEnabled.yaml @@ -1,12 +1,58 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/SetWorldSpecialPropertyEnabled -server: +shared: name: setWorldSpecialPropertyEnabled description: Enables or disables a special world property. - parameters: [] + parameters: + - name: propname + type: string + description: 'the name of the property to set. Possible values are: hovercars + - equivalent of the JBGVNB cheat, and allows cars to drive on water. (default: + false) aircars - equivalent of the RIPAZHA cheat, and allows cars to fly. (default: + false) extrabunny - equivalent of the CJPHONEHOME or JHJOECW cheat, and allows + you to bunny hop on bicycles much higher. (default: false) extrajump - equivalent + of the KANGAROO cheat, and allows you to jump on foot much higher. (default: + false) randomfoliage - toggle randomly generated foliage on the GTA:SA map (default: + true) snipermoon - toggle the GTA:SA easter egg, which increases the size of + the moon every time you shoot it with a sniper rifle (default: false) extraairresistance + - toggle the vehicle speed limit on cross-country roads (default: true) underworldwarp + - toggle warp of peds and vehicles when fall under map (default: true) vehiclesunglare + - toggle the vehicle sun glare effect (default: false) coronaztest - disable + big sun lensflare effect (default: true) ADDED/UPDATED IN VERSION 1.6.0 r21919 + : watercreatures - toggle randomly generated underwater creatures (default: + true) ADDED/UPDATED IN VERSION 1.6.0 r22195 : burnflippedcars - toggle the vehicle + to burn when upside down (default: true) ADDED/UPDATED IN VERSION 1.6.0 r22199 + : fireballdestruct - toggle the aircraft model destruction on explosion ( preview + ) (default: true) ADDED/UPDATED IN VERSION 1.6.0 r22430 : roadsignstext - toggle + the drawing of text on road signs. (default: true) ADDED/UPDATED IN VERSION + 1.6.0 r22485 : extendedwatercannons - Increases the default limit of water cannons + used at the same time from 3 to 30. (default: true) ADDED/UPDATED IN VERSION + 1.6.0 r22596 : tunnelweatherblend - toggle the weather blending effect when + the player is in the tunnel. (default: true) ADDED/UPDATED IN VERSION 1.6.0 + r22815 : ignorefirestate - Allows aiming when the player is on fire and entering + burning vehicles. (default: false) ADDED/UPDATED IN VERSION 1.6.0 r22909 : flyingcomponents + - This property determines whether the detached components such as doors, bumpers, + etc., should respawn after a vehicle is recreated (change model or variant) + or streamed in. (default: true) ADDED/UPDATED IN VERSION 1.6.0 r23223 : vehicleburnexplosions + - This property toggles creation of additional explosions ( type 2 - rocket + ) when plane or helicopter is burning. (default: true) ADDED/UPDATED IN VERSION + 1.6.0 r23237 : vehicle_engine_autostart - This property toggles automatic vehicle + engine state behavior. (default: true) If you set it to false then vehicle engine + will not start on driver enter and will not stop on driver exit. To control + the engine you need to use setVehicleEngineState . Helicopter rotors will spin + only if the engine is on (with or without driver inside). This flag also affects + bikes' + - name: enable + type: bool + description: whether or not to enable the property. examples: - path: examples/setWorldSpecialPropertyEnabled-1.lua description: This code allows you to enable/disable certain property usingtrueorfalse. side: server + returns: + values: + - type: bool + name: value + description: Returns true if successful, false otherwise. pair: isWorldSpecialPropertyEnabled notes: - type: info @@ -14,4 +60,4 @@ server: for properties like " underworldwarp ", " burnflippedcars ", " extendedwatercannons ", " flyingcomponents ", " vehicle_engine_autostart " to avoid possible data desynchronization. - incomplete: true + requires_review: true diff --git a/functions/World/testLineAgainstWater.yaml b/functions/World/testLineAgainstWater.yaml index b699105c..e6c1b82b 100644 --- a/functions/World/testLineAgainstWater.yaml +++ b/functions/World/testLineAgainstWater.yaml @@ -1,15 +1,39 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TestLineAgainstWater -client: +shared: name: testLineAgainstWater description: This function checks to see if a line between two points collides with the water. This is similar to [processLineOfSight](/wiki/ProcessLineOfSight "ProcessLineOfSight"), but only collides with water. Waves are not taken into account when testing the line. - parameters: [] + parameters: + - name: startX + type: float + description: MISSING_PARAM_DESC + - name: startY + type: float + description: MISSING_PARAM_DESC + - name: startZ + type: float + description: MISSING_PARAM_DESC + - name: endX + type: float + description: MISSING_PARAM_DESC + - name: endY + type: float + description: MISSING_PARAM_DESC + - name: endZ + type: float + description: MISSING_PARAM_DESC examples: - path: examples/testLineAgainstWater-1.lua description: This code snippet adds a /isanywaterbelowme command, which checks if there is water at 500 units below the ground at the position of the player who types it. side: client - incomplete: true + returns: + values: + - type: bool float float float + name: value + description: Returns true and the position of the intersection point of the line + and the water surface if there is a collision, or false if there is no collision. + requires_review: true diff --git a/functions/World/testSphereAgainstWorld.yaml b/functions/World/testSphereAgainstWorld.yaml index 349ba8a7..6358c9d1 100644 --- a/functions/World/testSphereAgainstWorld.yaml +++ b/functions/World/testSphereAgainstWorld.yaml @@ -1,10 +1,45 @@ # Scraped from: https://wiki.multitheftauto.com/wiki/TestSphereAgainstWorld -client: +shared: name: testSphereAgainstWorld description: The function checks whether there is an object within the given radius and returns information about it. The function works similarly to [processLineOfSight](/wiki/ProcessLineOfSight "ProcessLineOfSight"), but instead of a straight line, it operates based on the specified radius, forming a sphere. - parameters: [] + parameters: + - name: vehicle + type: unknown + description: MISSING_PARAM_DESC + - name: ped + type: unknown + description: MISSING_PARAM_DESC + - name: etc. + type: object + description: MISSING_PARAM_DESC examples: [] - incomplete: true + returns: + values: + - type: 'bool -- hit + + element -- hitElement + + float float float -- worldModelPositionX' + name: value1 + - type: "Y" + name: value2 + - type: 'Z + + float float float -- worldModelRotationX' + name: value3 + - type: "Y" + name: value4 + - type: 'Z + + int -- worldModelID + + int -- worldLODModelID + + string -- entity' + name: value5 + description: The modelID , lodID , worldModelPositionX,Y,Z , worldModelRotationX,Y,Z + and entityType parameters are returned even if hitElement is nil . + requires_review: true diff --git a/migrate/oldwiki/copy_files.py b/migrate/oldwiki/copy_files.py index 356424a9..863d8188 100644 --- a/migrate/oldwiki/copy_files.py +++ b/migrate/oldwiki/copy_files.py @@ -12,6 +12,8 @@ COPY_TO_TEMP_DIR = True TEMP_DIR = "./temp_copy" +FORCE_COPY_ALL = False + def copy_files(page_type, source_dir, target_dir): copied_function_names = set() @@ -24,15 +26,14 @@ def copy_files(page_type, source_dir, target_dir): dest_path = os.path.join(target_dir, rel_path) copy_to_dest_path = os.path.join(TEMP_DIR, page_type, rel_path) if COPY_TO_TEMP_DIR else dest_path - if os.path.exists(dest_path): + if not FORCE_COPY_ALL and os.path.exists(dest_path): with open(dest_path, 'r', encoding='utf-8') as dest_file: content = dest_file.read() - if 'incomplete: true' not in content: - print(f"(YAML) Skipping {dest_path} because it is not incomplete") + if 'requires_review: true' not in content: + # print(f"(YAML) Skipping {dest_path} because it does not require review") continue os.makedirs(os.path.dirname(copy_to_dest_path), exist_ok=True) - print(f"(YAML) Copying {src_path} to {copy_to_dest_path}") with open(src_path, 'r', encoding='utf-8') as src_file: with open(copy_to_dest_path, 'w', encoding='utf-8') as dest_file: src_file_content = src_file.read() @@ -40,28 +41,25 @@ def copy_files(page_type, source_dir, target_dir): # because that's a YAML reserved keyword xD src_file_content = src_file_content.replace("name: y", 'name: "y"') dest_file.write(src_file_content) - copied_function_names.add(file[:-5]) # Remove .yaml extension + func_name = file[:-5] # Remove .yaml extension + copied_function_names.add(func_name) + # print(f"(YAML) Copied {func_name} from {src_path} to {copy_to_dest_path}") # Copy corresponding .lua files too for root, dirs, files in os.walk(source_dir): for file in files: if file.endswith(".lua"): # Ignore if we haven't copied the corresponding YAML file - # Loop function names and find if Lua file contains it - found = False - for func_name in copied_function_names: - if func_name in file: - found = True - break - if not found: - print(f"(Lua) Skipping {file} because corresponding YAML was not copied") + extracted_func_name = file.split('-')[0].strip() + if extracted_func_name not in copied_function_names: + # print(f"(Lua) Skipping {file} because corresponding YAML was not copied") continue src_path = os.path.join(root, file) rel_path = os.path.relpath(src_path, source_dir) dest_path = os.path.join(target_dir, rel_path) copy_to_dest_path = os.path.join(TEMP_DIR, page_type, rel_path) if COPY_TO_TEMP_DIR else dest_path os.makedirs(os.path.dirname(copy_to_dest_path), exist_ok=True) - print(f"(Lua) Copying {src_path} to {copy_to_dest_path}") + # print(f"(Lua) Copying {src_path} to {copy_to_dest_path}") with open(src_path, 'r', encoding='utf-8') as src_file: with open(copy_to_dest_path, 'w', encoding='utf-8') as dest_file: dest_file.write(src_file.read()) diff --git a/migrate/oldwiki/scrape.py b/migrate/oldwiki/scrape.py index d88c3dfd..780ac245 100644 --- a/migrate/oldwiki/scrape.py +++ b/migrate/oldwiki/scrape.py @@ -6,6 +6,7 @@ from bs4 import BeautifulSoup from html_to_markdown import convert_to_markdown import yaml +import re import time import os @@ -345,7 +346,7 @@ def parse_issues(content_div): if next_td: issue_desc = next_td.get_text(strip=True) issues.append({ - "id": issue_number, + "id": int(issue_number), "description": issue_desc }) return issues @@ -581,9 +582,6 @@ def parse_event_page(page_url: str, category: str, name: str, source: str) -> di if event_issues: yaml_dict["issues"] = event_issues - if (any(param["description"] == "MISSING_PARAM_DESC" for param in event_parameters)): - yaml_dict["incomplete"] = True - return yaml_dict def stop_if_deprecated(content_div, page_url: str): @@ -598,6 +596,624 @@ def stop_if_deprecated(content_div, page_url: str): if content_div.find(string=lambda s: s and text in s): raise ValueError(f"Found {text} in {page_url}. Please review manually.") +def parse_function_syntax(content_div, page_url: str): + """Parse function syntax section(s). Returns list of syntax objects.""" + syntax_header = content_div.find("span", id="Syntax") + if not syntax_header: + return [] + + syntax_variants = [] + + # Check if syntax is split by client/server sections + syntax_h2 = syntax_header.find_parent("h2") + if not syntax_h2: + return [] + + # Look for section divs (client/server specific syntax) + current = syntax_h2.find_next_sibling() + found_sections = False + + while current: + if current.name in ["h2", "h3"]: + # Reached next major section + break + + # Check for server/client header divs + if current.name == "div" and "serverHeader" in current.get("class", []): + found_sections = True + # Find the corresponding content div + content_div_section = current.find_next_sibling() + if content_div_section and content_div_section.get("id", "").startswith("section"): + pre_tag = content_div_section.find("pre", class_=lambda x: x and "prettyprint" in x and "lang-lua" in x) + if pre_tag: + syntax_line = pre_tag.get_text(strip=True) + syntax_variants.append({ + "type": "server", + "syntax_line": syntax_line, + "section_element": content_div_section + }) + + elif current.name == "div" and "clientHeader" in current.get("class", []): + found_sections = True + # Find the corresponding content div + content_div_section = current.find_next_sibling() + if content_div_section and content_div_section.get("id", "").startswith("section"): + pre_tag = content_div_section.find("pre", class_=lambda x: x and "prettyprint" in x and "lang-lua" in x) + if pre_tag: + syntax_line = pre_tag.get_text(strip=True) + syntax_variants.append({ + "type": "client", + "syntax_line": syntax_line, + "section_element": content_div_section + }) + + current = current.find_next_sibling() + + # If no sections found, look for a single shared syntax + if not found_sections: + # Look for pre tag directly after syntax header + current = syntax_h2.find_next_sibling() + while current: + if current.name in ["h2", "h3"]: + break + if current.name == "pre": + classes = current.get("class", []) + if any("prettyprint" in str(c) for c in classes) and any("lang-lua" in str(c) for c in classes): + syntax_line = current.get_text(strip=True) + syntax_variants.append({ + "type": "shared", + "syntax_line": syntax_line, + "section_element": None # Parameters/returns are outside sections + }) + break + current = current.find_next_sibling() + + return syntax_variants + +def parse_function_parameters(syntax_obj, content_div, page_url: str): + """Parse function parameters from syntax line and argument sections.""" + syntax_line = syntax_obj["syntax_line"] + section_element = syntax_obj.get("section_element") + + # Parse syntax line to extract parameters + # Format: returnType functionName ( param1, param2, [ optionalParam = default ] ) + + # Extract the part inside parentheses + params_match = re.search(r'\(([^)]*)\)', syntax_line) + if not params_match: + return [] + + params_text = params_match.group(1).strip() + if not params_text: + return [] + + # Split parameters, handling brackets for optional params + parameters = [] + current_param = "" + bracket_depth = 0 + + for char in params_text: + if char == '[': + if bracket_depth == 0: + # We're entering brackets - finalize current parameter first + if current_param.strip(): + parameters.append(current_param.strip()) + current_param = "" + bracket_depth += 1 + current_param += char + elif char == ']': + bracket_depth -= 1 + current_param += char + if bracket_depth == 0: + # We've closed all brackets - finalize this bracket group + if current_param.strip(): + parameters.append(current_param.strip()) + current_param = "" + elif char == ',' and bracket_depth == 0: + # Comma outside brackets - split parameter + if current_param.strip(): + parameters.append(current_param.strip()) + current_param = "" + else: + current_param += char + + if current_param.strip(): + parameters.append(current_param.strip()) + + # Parse each parameter to extract type, name, and default + parsed_params = [] + for param in parameters: + param = param.strip() + # Remove brackets for optional params + is_optional = param.startswith('[') and param.endswith(']') + if is_optional: + param = param[1:-1].strip() + # If the bracket content contains commas, split into multiple optional parameters + if ',' in param: + # Split by comma, but be careful with default values that might contain commas + # We'll split on commas that are not inside parentheses or other brackets + sub_params = [] + current_sub = "" + paren_depth = 0 + bracket_depth = 0 + + for char in param: + if char == '(': + paren_depth += 1 + current_sub += char + elif char == ')': + paren_depth -= 1 + current_sub += char + elif char == '[': + bracket_depth += 1 + current_sub += char + elif char == ']': + bracket_depth -= 1 + current_sub += char + elif char == ',' and paren_depth == 0 and bracket_depth == 0: + if current_sub.strip(): + sub_params.append(current_sub.strip()) + current_sub = "" + else: + current_sub += char + + if current_sub.strip(): + sub_params.append(current_sub.strip()) + + # Parse each sub-parameter + for sub_param in sub_params: + sub_param = sub_param.strip() + default_value = None + if '=' in sub_param: + parts = sub_param.split('=', 1) + sub_param = parts[0].strip() + default_value = parts[1].strip() + + # Extract type and name + parts = sub_param.split(None, 1) + if len(parts) == 2: + param_type, param_name = parts + parsed_params.append({ + "name": param_name.strip(), + "type": param_type.strip(), + "default": default_value, + "is_optional": True + }) + elif len(parts) == 1: + parsed_params.append({ + "name": parts[0].strip(), + "type": "unknown", + "default": default_value, + "is_optional": True + }) + continue + + # Extract default value if present (for non-bracketed params or single bracketed param) + default_value = None + if '=' in param: + parts = param.split('=', 1) + param = parts[0].strip() + default_value = parts[1].strip() + + # Extract type and name + parts = param.split(None, 1) + if len(parts) == 2: + param_type, param_name = parts + parsed_params.append({ + "name": param_name.strip(), + "type": param_type.strip(), + "default": default_value, + "is_optional": is_optional + }) + elif len(parts) == 1: + # Sometimes type is omitted, just use the name + parsed_params.append({ + "name": parts[0].strip(), + "type": "unknown", + "default": default_value, + "is_optional": is_optional + }) + + # Now find descriptions from Required/Optional Arguments sections + search_element = section_element if section_element else content_div + + # Find Required Arguments + required_header = None + for header in search_element.find_all(["h3"]): + span = header.find("span", class_="mw-headline") + if span: + header_text = span.get_text(strip=True).lower() + if "required arguments" in header_text or "required arguments" == header_text: + required_header = header + break + + # Find Optional Arguments + optional_header = None + for header in search_element.find_all(["h3"]): + span = header.find("span", class_="mw-headline") + if span: + header_text = span.get_text(strip=True).lower() + if "optional arguments" in header_text or "optional arguments" == header_text: + optional_header = header + break + + # Parse required arguments list + if required_header: + ul = required_header.find_next_sibling("ul") + if not ul: + # Sometimes it's in a div + next_elem = required_header.find_next_sibling() + if next_elem and next_elem.name == "div": + ul = next_elem.find("ul") + + if ul: + for li in ul.find_all("li"): + b_tag = li.find("b") + if b_tag: + param_name = b_tag.get_text(strip=True).rstrip(":") + # Find description after the colon + desc_text = li.get_text(" ", strip=True) + if ":" in desc_text: + desc = desc_text.split(":", 1)[1].strip() + else: + desc = "" + + # Match with parsed params + for param in parsed_params: + if param["name"] == param_name: + param["description"] = desc + break + + # Parse optional arguments list + if optional_header: + ul = optional_header.find_next_sibling("ul") + if not ul: + # Sometimes it's in a div + next_elem = optional_header.find_next_sibling() + if next_elem and next_elem.name == "div": + ul = next_elem.find("ul") + + if ul: + for li in ul.find_all("li"): + b_tag = li.find("b") + if b_tag: + param_name = b_tag.get_text(strip=True).rstrip(":") + # Find description after the colon + desc_text = li.get_text(" ", strip=True) + if ":" in desc_text: + desc = desc_text.split(":", 1)[1].strip() + else: + desc = "" + + # Match with parsed params + for param in parsed_params: + if param["name"] == param_name: + param["description"] = desc + break + + # Convert to final format + result = [] + for param in parsed_params: + param_obj = { + "name": param["name"], + "type": param["type"], + "description": param.get("description", "MISSING_PARAM_DESC") + } + if param.get("default"): + param_obj["default"] = param["default"] + result.append(param_obj) + + return result + +def parse_function_returns(syntax_obj, content_div, page_url: str): + """Parse function return types and description.""" + syntax_line = syntax_obj["syntax_line"] + section_element = syntax_obj.get("section_element") + + # Parse return types from syntax line + # Format: returnType1, returnType2 functionName ( ... ) + + # Extract everything before the function name and opening parenthesis + # Format: returnType1, returnType2 functionName ( ... ) + # Try to match: return types, then function name, then opening paren + match = re.match(r'^([^(]+?)\s+\w+\s*\(', syntax_line) + if not match: + # Try without function name (unlikely but possible) + match = re.match(r'^([^(]+?)\s*\(', syntax_line) + + return_types = [] + if match: + return_part = match.group(1).strip() + if return_part and return_part != "void": + # Split by comma + return_types = [t.strip() for t in return_part.split(",")] + + # Find Returns section + # First try in section_element if provided, then fall back to main content_div + # (Returns might be shared and outside client/server sections) + returns_header = None + + if section_element: + # Search within the section first + for header in section_element.find_all(["h3"]): + span = header.find("span", class_="mw-headline") + if span: + header_text = span.get_text(strip=True).lower() + if header_text == "returns": + returns_header = header + break + + # If not found in section, search in main content + if not returns_header: + returns_span = content_div.find("span", id="Returns") + if returns_span: + returns_header = returns_span.find_parent(["h2", "h3"]) + else: + # Also try searching all h3 headers in main content + for header in content_div.find_all(["h3"]): + span = header.find("span", class_="mw-headline") + if span: + header_text = span.get_text(strip=True).lower() + if header_text == "returns": + returns_header = header + break + + return_description = "" + if returns_header: + # Get description from paragraph after header + p = returns_header.find_next_sibling("p") + if p: + return_description = p.get_text(" ", strip=True) + else: + # Sometimes it's directly in the header's next text + next_elem = returns_header.find_next_sibling() + if next_elem: + return_description = next_elem.get_text(" ", strip=True) + + # Create return values array + return_values = [] + if return_types: + # If multiple return types, name them sequentially (x, y, z for positions, etc.) + # For now, use generic names + for i, ret_type in enumerate(return_types): + if len(return_types) == 1: + return_values.append({ + "type": ret_type, + "name": "value" + }) + else: + # Use common naming patterns + if ret_type == "float" and len(return_types) == 3: + names = ["x", "y", "z"] + return_values.append({ + "type": ret_type, + "name": names[i] if i < len(names) else f"value{i+1}" + }) + else: + return_values.append({ + "type": ret_type, + "name": f"value{i+1}" + }) + elif return_description: + # Try to infer return type from description + # Common patterns: "Returns true/false" -> bool, "Returns a..." -> element/string/etc + desc_lower = return_description.lower() + if "true" in desc_lower or "false" in desc_lower or "boolean" in desc_lower: + return_values.append({ + "type": "bool", + "name": "value" + }) + elif "element" in desc_lower: + return_values.append({ + "type": "element", + "name": "value" + }) + # If we can't infer, we'll still create the returns object but without values + + result = { + "values": return_values + } + if return_description: + result["description"] = return_description + + return result if return_values or return_description else None + +def parse_oop_syntax(content_div, page_url: str): + """Parse OOP Syntax section from function page.""" + # Look for OOP Syntax section + # It can be in a

with OOP Syntax or just a

structure + + oop_dl = None + + # First, try to find the OOP Syntax heading + oop_heading = None + for p in content_div.find_all("p"): + u_tag = p.find("u") + if u_tag: + b_tag = u_tag.find("b") + if b_tag and "OOP Syntax" in b_tag.get_text(): + oop_heading = p + break + + if oop_heading: + # Find the
tag after the heading + oop_dl = oop_heading.find_next_sibling("dl") + if not oop_dl: + # Sometimes it's in the next element + next_elem = oop_heading.find_next_sibling() + if next_elem and next_elem.name == "dl": + oop_dl = next_elem + + # If not found, try searching for any
with OOP-related content + if not oop_dl: + for dl in content_div.find_all("dl"): + dds = dl.find_all("dd") + for dd in dds: + b_tag = dd.find("b") + if b_tag: + text = b_tag.get_text(strip=True) + if text in ["Method", "Variable", "Constructor", "Note", "Counterpart"]: + oop_dl = dl + break + if oop_dl: + break + + if not oop_dl: + return None + + oop_data = {} + + # Parse
elements + for dd in oop_dl.find_all("dd"): + b_tag = dd.find("b") + if not b_tag: + continue + + label = b_tag.get_text(strip=True) + i_tag = dd.find("i") + + if label == "Note": + if i_tag: + note_text = i_tag.get_text(strip=True) + oop_data["note"] = note_text + + elif label == "Method": + if i_tag: + # Extract method information + # Format: element:methodName(...) + # or: Element.methodName(...) for static + # or: ClassName(...) for constructor (mislabeled as Method) + # or: ClassName(...) for constructor without link + method_text = i_tag.get_text(strip=True) + a_tag = i_tag.find("a") + + if a_tag: + element_name = a_tag.get_text(strip=True) + # Get text after the link to determine if it's a constructor + # If the link is followed by just (...), it's a constructor + link_text = a_tag.get_text() + # Get all text nodes in the i_tag + all_text = i_tag.get_text() + # Check what comes after the link text + after_link = all_text[len(link_text):].strip() + + # Check if it's static (has dot) or instance (has colon) + if ":" in method_text: + # Instance method: element:methodName + method_name = method_text.split(":")[-1].split("(")[0].strip() + oop_data["method"] = method_name + oop_data["element"] = element_name.lower() + oop_data["static"] = False + elif "." in method_text and not after_link.startswith("("): + # Static method: Element.methodName (has dot and doesn't start with ( after link) + method_name = method_text.split(".")[-1].split("(")[0].strip() + oop_data["method"] = method_name + oop_data["element"] = element_name + oop_data["static"] = True + elif after_link.startswith("(") or (not "." in method_text and not ":" in method_text): + # Constructor: link text followed by (...) or no : or . in method_text + # Extract class name from link + oop_data["constructorclass"] = element_name + # Try to extract element from link href + href = a_tag.get("href", "") + if href: + # Extract from /wiki/ElementName + href_element = href.replace("/wiki/", "").split("/")[0] + oop_data["element"] = href_element.lower() + else: + oop_data["element"] = element_name.lower() + else: + # Fallback: treat as static method if has dot + if "." in method_text: + method_name = method_text.split(".")[-1].split("(")[0].strip() + oop_data["method"] = method_name + oop_data["element"] = element_name + oop_data["static"] = True + else: + # No link, try to parse from text + if ":" in method_text: + parts = method_text.split(":") + if len(parts) >= 2: + element_name = parts[0].strip() + method_name = parts[1].split("(")[0].strip() + oop_data["method"] = method_name + oop_data["element"] = element_name.lower() + oop_data["static"] = False + elif "." in method_text: + parts = method_text.split(".") + if len(parts) >= 2: + element_name = parts[0].strip() + method_name = parts[1].split("(")[0].strip() + oop_data["method"] = method_name + oop_data["element"] = element_name + oop_data["static"] = True + else: + # No : or . means it's a constructor (ClassName(...)) + class_name = method_text.split("(")[0].strip() + oop_data["constructorclass"] = class_name + oop_data["element"] = class_name.lower() + + elif label == "Variable": + if i_tag: + var_text = i_tag.get_text(strip=True) + # Remove leading dot if present + if var_text.startswith("."): + var_text = var_text[1:] + oop_data["variable"] = var_text + + elif label == "Constructor": + if i_tag: + # Constructor format: ClassName(...) + constructor_text = i_tag.get_text(strip=True) + a_tag = i_tag.find("a") + if a_tag: + class_name = a_tag.get_text(strip=True) + oop_data["constructorclass"] = class_name + # Try to extract element from link href + href = a_tag.get("href", "") + if href: + # Extract from /wiki/ElementName + element_name = href.replace("/wiki/", "").split("/")[0] + oop_data["element"] = element_name + + elif label == "Counterpart": + # Counterpart is just for reference, we already parse it elsewhere + # But we can note it if needed + pass + + # Ensure element is set (required by schema) + if "element" not in oop_data: + # Try to infer from method or constructor + if "method" in oop_data: + # Already set above + pass + elif "constructorclass" in oop_data: + # Element should be set from constructor parsing + pass + else: + # Can't determine element, skip OOP + return None + + # Return in schema format + result = { + "element": oop_data["element"] + } + + if "note" in oop_data: + result["note"] = oop_data["note"] + + if "constructorclass" in oop_data: + result["constructorclass"] = oop_data["constructorclass"] + else: + if "method" in oop_data: + result["method"] = oop_data["method"] + if "variable" in oop_data: + result["variable"] = oop_data["variable"] + if "static" in oop_data: + result["static"] = oop_data["static"] + + return result if result else None + def parse_function_page(page_url: str, category: str, name: str, source: str) -> dict: response_text = get_page_from_cache_or_fetch(page_url, name) @@ -626,8 +1242,8 @@ def parse_function_page(page_url: str, category: str, name: str, source: str) -> func_notes, func_meta = parse_notes(content_div) handled_header_names.append("Remarks") - # TODO: Syntax: parameters and returns - # also ignore_parameters if needed + # Parse Syntax, Parameters, Returns, and OOP + syntax_variants = parse_function_syntax(content_div, page_url) handled_header_names.append("Syntax") handled_header_names.append("Parameters") handled_header_names.append("Arguments") @@ -636,8 +1252,25 @@ def parse_function_page(page_url: str, category: str, name: str, source: str) -> handled_header_names.append("Optional Arguments") handled_header_names.append("Optional arguments") handled_header_names.append("Returns") - # TODO parse OOP syntax - + + # Parse OOP syntax (typically shared) + oop_data = parse_oop_syntax(content_div, page_url) + + # Parse parameters and returns for each syntax variant + syntax_data = {} + for variant in syntax_variants: + variant_type = variant["type"] + params = parse_function_parameters(variant, content_div, page_url) + returns = parse_function_returns(variant, content_div, page_url) + + syntax_data[variant_type] = { + "parameters": params, + "returns": returns + } + + # If no syntax found, log warning + if not syntax_variants: + log(f"Warning: No syntax found for {name} in {page_url}") # Examples examples = parse_examples(content_div) @@ -670,34 +1303,116 @@ def parse_function_page(page_url: str, category: str, name: str, source: str) -> extra_headers = get_additional_headers_found_in_page(content_div, handled_header_names, page_url) - yaml_dict = { - func_type: { + # Build YAML structure based on syntax variants + yaml_dict = {} + + if "shared" in syntax_data: + # Single shared syntax + yaml_dict["shared"] = { + "name": name, + "description": func_description, + "parameters": syntax_data["shared"]["parameters"], + "examples": added_examples, + } + if syntax_data["shared"]["returns"]: + yaml_dict["shared"]["returns"] = syntax_data["shared"]["returns"] + if oop_data: + yaml_dict["shared"]["oop"] = oop_data + if func_pair: + yaml_dict["shared"]["pair"] = func_pair + if func_notes: + yaml_dict["shared"]["notes"] = func_notes + if func_meta: + yaml_dict["shared"]["meta"] = func_meta + if func_issues: + yaml_dict["shared"]["issues"] = func_issues + elif "client" in syntax_data or "server" in syntax_data: + # Client/server specific syntaxes + # Check if returns are shared (same for both sides) + shared_returns = None + if "client" in syntax_data and "server" in syntax_data: + client_returns = syntax_data["client"]["returns"] + server_returns = syntax_data["server"]["returns"] + if client_returns and server_returns: + # Compare returns (simple string comparison for now) + if str(client_returns) == str(server_returns): + shared_returns = client_returns + + if "client" in syntax_data: + yaml_dict["client"] = { + "name": name, + "description": func_description, + "parameters": syntax_data["client"]["parameters"], + "examples": [e for e in added_examples if e.get("side") == "client" or e.get("side") == "shared"], + } + if syntax_data["client"]["returns"]: + yaml_dict["client"]["returns"] = syntax_data["client"]["returns"] + elif shared_returns: + yaml_dict["client"]["returns"] = shared_returns + if oop_data: + yaml_dict["client"]["oop"] = oop_data + if func_pair: + yaml_dict["client"]["pair"] = func_pair + if func_notes: + yaml_dict["client"]["notes"] = func_notes + if func_meta: + yaml_dict["client"]["meta"] = func_meta + if func_issues: + yaml_dict["client"]["issues"] = func_issues + + if "server" in syntax_data: + yaml_dict["server"] = { + "name": name, + "description": func_description, + "parameters": syntax_data["server"]["parameters"], + "examples": [e for e in added_examples if e.get("side") == "server" or e.get("side") == "shared"], + } + if syntax_data["server"]["returns"]: + yaml_dict["server"]["returns"] = syntax_data["server"]["returns"] + elif shared_returns: + yaml_dict["server"]["returns"] = shared_returns + if oop_data: + yaml_dict["server"]["oop"] = oop_data + if func_pair: + yaml_dict["server"]["pair"] = func_pair + if func_notes: + yaml_dict["server"]["notes"] = func_notes + if func_meta: + yaml_dict["server"]["meta"] = func_meta + if func_issues: + yaml_dict["server"]["issues"] = func_issues + else: + # Fallback: use func_type (from source) if no syntax found + yaml_dict[func_type] = { "name": name, "description": func_description, "parameters": [], "examples": added_examples, } - } - if func_pair: - yaml_dict[func_type]["pair"] = func_pair - if func_notes: - yaml_dict[func_type]["notes"] = func_notes - if func_meta: - yaml_dict[func_type]["meta"] = func_meta - if func_issues: - yaml_dict[func_type]["issues"] = func_issues - - # This parser is unfinished, so mark as incomplete - yaml_dict[func_type]["incomplete"] = True - + if oop_data: + yaml_dict[func_type]["oop"] = oop_data + if func_pair: + yaml_dict[func_type]["pair"] = func_pair + if func_notes: + yaml_dict[func_type]["notes"] = func_notes + if func_meta: + yaml_dict[func_type]["meta"] = func_meta + if func_issues: + yaml_dict[func_type]["issues"] = func_issues + if extra_headers: - yaml_dict[func_type]["meta"] = yaml_dict.get("meta", []) - headears_missing = "This function was partially migrated from the old wiki. Please review manually:\n" - for header in extra_headers: - headears_missing += f"- Missing section: {header}\n" - yaml_dict[func_type]["meta"].append({ - "needs_checking": headears_missing - }) + for key in yaml_dict: + if "meta" not in yaml_dict[key]: + yaml_dict[key]["meta"] = [] + headears_missing = "This function was partially migrated from the old wiki. Please review manually:\n" + for header in extra_headers: + headears_missing += f"- Missing section: {header}\n" + yaml_dict[key]["meta"].append({ + "needs_checking": headears_missing + }) + + for key in yaml_dict: + yaml_dict[key]["requires_review"] = True return yaml_dict diff --git a/schemas/common-defs.yaml b/schemas/common-defs.yaml index c3a6e7cc..a8df9083 100644 --- a/schemas/common-defs.yaml +++ b/schemas/common-defs.yaml @@ -3,7 +3,7 @@ $id: common-defs.yaml title: Common definitions type: object $defs: - incomplete: + requires_review: type: boolean description: | If set to true, this item is considered incomplete and may not have all the necessary information. diff --git a/schemas/event.yaml b/schemas/event.yaml index c751dcd8..4c349f3c 100644 --- a/schemas/event.yaml +++ b/schemas/event.yaml @@ -41,8 +41,8 @@ properties: $ref: 'common-defs.yaml#/$defs/examples' see_also: $ref: 'common-defs.yaml#/$defs/see_also' - incomplete: - $ref: 'common-defs.yaml#/$defs/incomplete' + requires_review: + $ref: 'common-defs.yaml#/$defs/requires_review' $defs: source_element: diff --git a/schemas/function.yaml b/schemas/function.yaml index bb72ff87..4bc103cb 100644 --- a/schemas/function.yaml +++ b/schemas/function.yaml @@ -61,8 +61,8 @@ $defs: $ref: 'common-defs.yaml#/$defs/examples' see_also: $ref: 'common-defs.yaml#/$defs/see_also' - incomplete: - $ref: 'common-defs.yaml#/$defs/incomplete' + requires_review: + $ref: 'common-defs.yaml#/$defs/requires_review' oop: type: object diff --git a/web/astro.config.mjs b/web/astro.config.mjs index 618db7d6..ce596750 100644 --- a/web/astro.config.mjs +++ b/web/astro.config.mjs @@ -1,123 +1,156 @@ // @ts-check -import { defineConfig } from 'astro/config'; -import starlight from '@astrojs/starlight'; -import mtasaStarlightThemePlugin from '@multitheftauto/starlight-theme-mtasa'; -import { SITE_TITLE, SITE_URL } from './src/content.constants'; +import { defineConfig } from "astro/config"; +import starlight from "@astrojs/starlight"; +import mtasaStarlightThemePlugin from "@multitheftauto/starlight-theme-mtasa"; +import { SITE_TITLE, SITE_URL } from "./src/content.constants"; export default defineConfig({ - site: SITE_URL, - i18n: { - locales: ["en", "es", "fr"], - defaultLocale: "en", - routing: { - prefixDefaultLocale: false, - }, - }, - integrations: [ - starlight({ - plugins: [ - mtasaStarlightThemePlugin(), - ], - favicon: 'favicon.ico', - title: SITE_TITLE, - logo: { - replacesTitle: true, - light: './src/assets/images/logo-black.png', - dark: './src/assets/images/logo-white.png', - }, - social: [ - { icon: 'github', label: 'GitHub', href: 'https://github.com/multitheftauto/wiki.multitheftauto.com' }, - ], - editLink: { - baseUrl: 'https://github.com/multitheftauto/wiki.multitheftauto.com/edit/main/web/', - }, - components: { - // Override some default components - PageTitle: './src/overrides/PageTitle.astro', - Pagination: './src/overrides/Pagination.astro', - }, - customCss: [ './src/styles/custom.css' ], - disable404Route: true, - sidebar: [ - { - label: 'Welcome', - items: [ - { - label: 'Introduction', link: '/', - }, - { - label: 'Contributing', link: '/Contributing', - }, - { - label: 'Incomplete Pages', link: '/Incomplete_Pages', badge: { text: 'Help Wanted', variant: 'tip' }, - }, - ] - }, - { - label: 'Articles', - autogenerate: { directory: 'articles' } - }, - { - label: 'Reference', - items: [ - { - label: 'Resources', - items: [ - { label: 'Lua API', link: '/reference/Lua_API' }, - { label: 'ID Lists', link: '/reference/ID_Lists'}, - { label: 'Meta.xml', link: '/reference/Meta.xml'}, - { label: 'Resource Web Access', link: '/reference/Resource_Web_Access'}, - { - label: 'Functions', - collapsed: true, - items: [ - {label: 'All Functions', link: '/reference/Scripting_Functions'}, - {label: 'Shared Functions', link: '/reference/Shared_Scripting_Functions'}, - {label: 'Client Functions', link: '/reference/Client_Scripting_Functions'}, - {label: 'Server Functions', link: '/reference/Server_Scripting_Functions'}, - ] - }, - { - label: 'Events', - collapsed: true, - items: [ - {label: 'Event System', link: '/reference/Event_System'}, - {label: 'All Events', link: '/reference/Scripting_Events'}, - {label: 'Client Events', link: '/reference/Client_Scripting_Events'}, - {label: 'Server Events', link: '/reference/Server_Scripting_Events'}, - ] - }, - { - label: 'Elements', - collapsed: true, - items: [ - {label: 'Element Types', link: '/reference/Element'}, - {label: 'Element Tree', link: '/reference/Element_tree'}, - {label: 'Entities', link: '/reference/Entity'}, - ] - }, - { - label: 'OOP', - collapsed: true, - items: [ - {label: 'About OOP', link: '/reference/OOP'}, - {label: 'OOP Classes', link: '/reference/OOP_Classes'}, - ] - }, - ] - }, - { - label: 'Configuration', - items: [ - {label: 'MTAServer.conf', link: '/reference/Server_mtaserver.conf'}, - {label: 'Settings.xml', link: '/reference/Settings_System'}, - {label: 'ACL.xml', link: '/reference/Access_Control_List'}, - {label: 'Anti cheat guide', link: '/reference/Anti_Cheat_Guide'}, - ] - }, - ] - }, - ], - }), - ], + site: SITE_URL, + i18n: { + locales: ["en", "es", "fr"], + defaultLocale: "en", + routing: { + prefixDefaultLocale: false, + }, + }, + integrations: [ + starlight({ + plugins: [mtasaStarlightThemePlugin()], + favicon: "favicon.ico", + title: SITE_TITLE, + logo: { + replacesTitle: true, + light: "./src/assets/images/logo-black.png", + dark: "./src/assets/images/logo-white.png", + }, + social: [ + { + icon: "github", + label: "GitHub", + href: "https://github.com/multitheftauto/wiki.multitheftauto.com", + }, + ], + editLink: { + baseUrl: + "https://github.com/multitheftauto/wiki.multitheftauto.com/edit/main/web/", + }, + components: { + // Override some default components + PageTitle: "./src/overrides/PageTitle.astro", + Pagination: "./src/overrides/Pagination.astro", + }, + customCss: ["./src/styles/custom.css"], + disable404Route: true, + sidebar: [ + { + label: "Welcome", + items: [ + { + label: "Introduction", + link: "/", + }, + { + label: "Contributing", + link: "/Contributing", + }, + ], + }, + { + label: "Articles", + autogenerate: { directory: "articles" }, + }, + { + label: "Reference", + items: [ + { + label: "Resources", + items: [ + { label: "Lua API", link: "/reference/Lua_API" }, + { label: "ID Lists", link: "/reference/ID_Lists" }, + { label: "Meta.xml", link: "/reference/Meta.xml" }, + { + label: "Resource Web Access", + link: "/reference/Resource_Web_Access", + }, + { + label: "Functions", + collapsed: true, + badge: { text: "Help Wanted", variant: "tip" }, + items: [ + { + label: "All Functions", + link: "/reference/Scripting_Functions", + }, + { + label: "Shared Functions", + link: "/reference/Shared_Scripting_Functions", + }, + { + label: "Client Functions", + link: "/reference/Client_Scripting_Functions", + }, + { + label: "Server Functions", + link: "/reference/Server_Scripting_Functions", + }, + ], + }, + { + label: "Events", + collapsed: true, + items: [ + { label: "Event System", link: "/reference/Event_System" }, + { + label: "All Events", + link: "/reference/Scripting_Events", + }, + { + label: "Client Events", + link: "/reference/Client_Scripting_Events", + }, + { + label: "Server Events", + link: "/reference/Server_Scripting_Events", + }, + ], + }, + { + label: "Elements", + collapsed: true, + items: [ + { label: "Element Types", link: "/reference/Element" }, + { label: "Element Tree", link: "/reference/Element_tree" }, + { label: "Entities", link: "/reference/Entity" }, + ], + }, + { + label: "OOP", + collapsed: true, + items: [ + { label: "About OOP", link: "/reference/OOP" }, + { label: "OOP Classes", link: "/reference/OOP_Classes" }, + ], + }, + ], + }, + { + label: "Configuration", + items: [ + { + label: "MTAServer.conf", + link: "/reference/Server_mtaserver.conf", + }, + { label: "Settings.xml", link: "/reference/Settings_System" }, + { label: "ACL.xml", link: "/reference/Access_Control_List" }, + { + label: "Anti cheat guide", + link: "/reference/Anti_Cheat_Guide", + }, + ], + }, + ], + }, + ], + }), + ], }); diff --git a/web/src/components/ItemDescription.astro b/web/src/components/ItemDescription.astro index d02b0bff..162d8475 100644 --- a/web/src/components/ItemDescription.astro +++ b/web/src/components/ItemDescription.astro @@ -4,10 +4,10 @@ import { SITE_CONTRIBUTING_URL } from '@src/content.constants'; interface Props { description: string; - incomplete?: boolean; + requiresReview?: boolean; } -const { description, incomplete = false } = Astro.props; +const { description, requiresReview = false } = Astro.props; let path = Astro.url.pathname; // Remove trailing slash if any @@ -16,10 +16,9 @@ path = path.endsWith('/') ? path.slice(0, -1) : path; path = path.substring(path.lastIndexOf('/')); ---
- {incomplete && ( -

This page is incomplete! Help wanted!

-

Please finish this page using the corresponding Old Wiki article. -
Go to Contribution guidelines for more information.

+ {requiresReview && ( +

Manual Review Required

+

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


)} diff --git a/web/src/pages/Contributing.astro b/web/src/pages/Contributing.astro index 86004c2a..1cb26c36 100644 --- a/web/src/pages/Contributing.astro +++ b/web/src/pages/Contributing.astro @@ -1,83 +1,154 @@ --- -import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import { SITE_CONTRIBUTING_URL } from '@src/content.constants'; +import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; +import { SITE_CONTRIBUTING_URL } from "@src/content.constants"; --- - -

Multi Theft Auto has loads of areas in which you can help. In turn, we'll be more than happy to help you get started with any ideas you have, help test them and - if they're good enough - release them to the whole community. This page outlines the key areas you could do something in, of course, there are many things we've not thought of, so think outside the box!

+ }} +> +

+ Multi Theft Auto has loads of areas in which you can help. In + turn, we'll be more than happy to help you get started with any ideas you have, + help test them and - if they're good enough - release them to the whole community. + This page outlines the key areas you could do something in, of course, there + are many things we've not thought of, so think outside the box! +

-

Documentation

-

Before you make changes check out: Contribution Guidelines.

- +

Documentation

+

+ Before you make changes check out: Contribution Guidelines. +

+ -

Quality Assurance

-
    -
  • Report issues with the mod, make sure to do a search on the already reported issues first.
  • +

    Quality Assurance

    +
      +
    • + Report issues with the mod, make sure to do a search on the already reported issues first. +
    • Test and confirm existing reported issues.
    • -
    • Use the newest build of MTA to detect and report new bugs, by going to 'Settings', 'Advanced', 'Update build type' and choosing 'Nightly' or get it regularly - from here. +
    • + Use the newest build of MTA to detect and report new bugs, by going to + 'Settings', 'Advanced', 'Update build type' and choosing 'Nightly' or get + it regularly + from here.
    • -
    • Any bugs which are related to a scripting function/event and present in the main release (rather than nightlies), document that bug by adding an issue to the wiki page to save other scripters a lot of time. +
    • + Any bugs which are related to a scripting function/event and present in + the main release (rather than nightlies), document that bug by adding an issue to the wiki page to save other scripters a lot of time.
    • -
    +
-

Translating

- +

Translating

+ -

Scripting

- -

Mapping

-
    -
  • Create and publish a map for an existing gamemode, with the map editor. - +
-

Web development

- -

Programming

- +

Programming

+ -

Specific tasks

-
    +

    Specific tasks

    +
    • Create a fuzzer to check for crashes in our scripting functions.
    • -
    - -

    Grant

    -
      -
    • You can donate to MTA here
    • -
    +
+

Grant

+
    +
  • + You can donate to MTA here +
  • +
diff --git a/web/src/pages/Incomplete_Pages.astro b/web/src/pages/Incomplete_Pages.astro deleted file mode 100644 index 851d1d73..00000000 --- a/web/src/pages/Incomplete_Pages.astro +++ /dev/null @@ -1,77 +0,0 @@ ---- -import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import AnchorHeading from '@astrojs/starlight/components/AnchorHeading.astro'; - -import { SITE_CONTRIBUTING_URL } from '@src/content.constants'; -import { getUnfinishedPages } from '@src/utils/general'; - -import NoteBox from '@src/components/NoteBox.astro'; - -const unfinishedFunctions = getUnfinishedPages('functions'); -const unfinishedEvents = getUnfinishedPages('events'); ---- - - - - Stay up to date with the progress by connecting with us on the MTA Development Discord server. - - -

The following pages are not finished, and need your attention! Please help complete the new MTA Wiki.

-

Contribution guidelines

- -Unfinished Function Pages - - Please help review and complete these pages by adding missing documentation or code examples. -
In most cases, the page is missing extra information that couldn't be automatically migrated from the old wiki. -
-
- {unfinishedFunctions.length === 0 ? ( -

There are currently no unfinished function pages πŸ˜„

- ) : ( -

These functions (part of the MTA Lua API) are missing documentation or code examples:

-
- Total: {unfinishedFunctions.length} -
    - {unfinishedFunctions.map((func) => ( -
  • - {func} -
  • - ))} -
-
- )} -
- -Unfinished Event Pages -
- {unfinishedEvents.length === 0 ? ( -

There are currently no unfinished event pages πŸ˜„

- ) : ( -

These events (part of the MTA Lua API) are missing documentation or code examples:

-
- Total: {unfinishedEvents.length} -
    - {unfinishedEvents.map((event) => ( -
  • - {event} -
  • - ))} -
-
- )} -
- -
- - \ No newline at end of file diff --git a/web/src/pages/reference/[event].astro b/web/src/pages/reference/[event].astro index 85f0be34..53c3542f 100644 --- a/web/src/pages/reference/[event].astro +++ b/web/src/pages/reference/[event].astro @@ -1,33 +1,35 @@ --- -import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import { getCollection } from 'astro:content'; +import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; +import { getCollection } from "astro:content"; import fs from "fs"; import path from "path"; -import { Code } from '@astrojs/starlight/components'; -import { renderInlineMarkdown, getSeeAlsoLinksForItem } from '@src/utils/general'; -import { Icon } from '@astrojs/starlight/components'; - - -import NoteBox from '@src/components/NoteBox.astro'; -import type { NotesType } from '@src/utils/types'; - -import SeeAlsoSection from '@src/components/SeeAlsoSection.astro'; -import CodeExamplesSection from '@src/components/CodeExamplesSection.astro'; -import ItemDescription from '@src/components/ItemDescription.astro'; -import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro'; -import PreviewImages from '@src/components/PreviewImages.astro'; -import ChangelogList from '@src/components/ChangelogList.astro'; +import { Code } from "@astrojs/starlight/components"; +import { + renderInlineMarkdown, + getSeeAlsoLinksForItem, +} from "@src/utils/general"; +import { Icon } from "@astrojs/starlight/components"; + +import NoteBox from "@src/components/NoteBox.astro"; +import type { NotesType } from "@src/utils/types"; + +import SeeAlsoSection from "@src/components/SeeAlsoSection.astro"; +import CodeExamplesSection from "@src/components/CodeExamplesSection.astro"; +import ItemDescription from "@src/components/ItemDescription.astro"; +import EnhancedMarkdown from "@src/components/EnhancedMarkdown.astro"; +import PreviewImages from "@src/components/PreviewImages.astro"; +import ChangelogList from "@src/components/ChangelogList.astro"; export async function getStaticPaths() { - const events = await getCollection('events'); - return events.map(event => ({ - params: { event: event.id }, - props: { event }, - })); + const events = await getCollection("events"); + return events.map((event) => ({ + params: { event: event.id }, + props: { event }, + })); } const { event } = Astro.props; -event.data.itemType = 'event'; +event.data.itemType = "event"; const eventType = event.data.type; const eventPath = path.dirname(event.filePath ?? ""); @@ -37,104 +39,140 @@ const eventParameters = event.data.parameters || []; let parametersCode = ""; // Build parameters code syntax e.g. "int param1, string param2" if (eventParameters.length > 0) { - parametersCode = eventParameters.map((param: any) => { - return param.type + " " + param.name; - }).join(", "); + parametersCode = eventParameters + .map((param: any) => { + return param.type + " " + param.name; + }) + .join(", "); } -if ( eventExamples.length > 0 ){ - eventExamples = eventExamples.map((example: any) => { - try { - const luaCode = fs.readFileSync(path.resolve(`${eventPath}`, example.path), "utf8"); - return { ...example, luaCode }; - } catch (error) { - console.error(`Error reading ${example.path}:`, error); - return { ...example, luaCode: "Loading example error." }; - } - }); +if (eventExamples.length > 0) { + eventExamples = eventExamples.map((example: any) => { + try { + const luaCode = fs.readFileSync( + path.resolve(`${eventPath}`, example.path), + "utf8" + ); + return { ...example, luaCode }; + } catch (error) { + console.error(`Error reading ${example.path}:`, error); + return { ...example, luaCode: "Loading example error." }; + } + }); } let notesContent: NotesType = []; if (Array.isArray(event.data.notes) && event.data.notes.length > 0) { - notesContent = event.data.notes; + notesContent = event.data.notes; } const eventMeta = event.data.meta || []; -const changelogEntries = eventMeta.find(m => m.changelog)?.changelog ?? []; -const needsChecking = eventMeta.find(m => m.needs_checking)?.needs_checking ?? undefined; +const changelogEntries = eventMeta.find((m) => m.changelog)?.changelog ?? []; +const needsChecking = + eventMeta.find((m) => m.needs_checking)?.needs_checking ?? undefined; ---
- - {needsChecking && ( -
- - - -
- )} - - - - - - - - - {notesContent.length > 0 && ( -
- {notesContent.map((note) => ( - - - - ))} -
- )} - -

Parameters

- {eventParameters.length > 0 ? ( - <> - - {eventParameters.map((param: any) => ( -
    -
  • ${param.name}: ${renderInlineMarkdown(param.description)}`} - /> -
- ))} - - ) : ( -

This event does not pass any parameters to the handler function.

- )} - -

Source

-

{event.data.source_element.type}: - {renderInlineMarkdown(event.data.source_element.description)} + + { + needsChecking && ( +

+ + + +
+ ) + } + + + + + + + + + { + notesContent.length > 0 && ( +
+ {notesContent.map((note) => ( + + + + ))} +
+ ) + } + +

Parameters

+ { + eventParameters.length > 0 ? ( + <> + + {eventParameters.map((param: any) => ( +
    +
  • ${param.name}: ${renderInlineMarkdown(param.description)}`} + /> +
+ ))} + + ) : ( +

+ + This event does not pass any parameters to the handler function. +

+ ) + } - - {event.data.canceling && ( - <> -

Canceling

-

{event.data.canceling}

- - )} +

Source

+

+ {event.data.source_element.type}: + {renderInlineMarkdown(event.data.source_element.description)} +

+ + + { + event.data.canceling && ( + <> +

+ Canceling{" "} + + + +

+

{event.data.canceling}

+ + ) + } - + - + - -
+ +
\ No newline at end of file + .help-icon { + display: inline-block; + vertical-align: middle; + } + diff --git a/web/src/pages/reference/[func].astro b/web/src/pages/reference/[func].astro index 40f345dc..ba5dcb52 100644 --- a/web/src/pages/reference/[func].astro +++ b/web/src/pages/reference/[func].astro @@ -71,8 +71,6 @@ funcExamples = funcExamples.map((example: any) => { } }); -const isDocIncomplete = funcInfo.incomplete === true || funcExamples.length === 0; - let notesContent: NotesType = []; if (Array.isArray(funcInfo.notes) && funcInfo.notes.length > 0) { notesContent = funcInfo.notes; @@ -123,7 +121,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data); return ( ); } @@ -162,7 +160,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
@@ -170,7 +168,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data); })() : ( )} @@ -287,7 +285,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data); ))} - + )} ))} diff --git a/web/src/utils/functions.ts b/web/src/utils/functions.ts index a80e72a5..756ce3a7 100644 --- a/web/src/utils/functions.ts +++ b/web/src/utils/functions.ts @@ -132,6 +132,7 @@ export function getFunctionInfo(data: FunctionData): FunctionInfo { const details: FunctionInfo = data[type]; details.type = type; details.typePretty = getFunctionTypePretty(data); + details.requiresReview = data[type].requires_review === true; return details; } diff --git a/web/src/utils/general.ts b/web/src/utils/general.ts index 2c0b70e2..9cec728f 100644 --- a/web/src/utils/general.ts +++ b/web/src/utils/general.ts @@ -214,33 +214,6 @@ export function getSeeAlsoLinksForItem(theItem: any): SeeAlsoLinkGroup[] { return getSeeAlsoLinksFromList(allSeeAlso); } -export function getUnfinishedPages(pageType: 'functions' | 'events'): string[] { - const unfinishedPages: string[] = []; - const pagesByCategory = { - functions: getFunctionsByCategory(), - events: getEventsByCategory(), - }; - for (const category in pagesByCategory[pageType]) { - const items = pagesByCategory[pageType][category]; - for (const item of items) { - const data = item.data.shared || item.data.client || item.data.server || item.data; - // Check if the item is marked as incomplete - if (data && data.incomplete) { - unfinishedPages.push(item.id); - } else { - // Check if the item has no code examples - const examples = item.data.shared?.examples || item.data.client?.examples || item.data.server?.examples || item.data.examples; - if (!examples || examples.length === 0) { - unfinishedPages.push(item.id); - } - } - } - } - // Sort alphabetically - unfinishedPages.sort((a, b) => a.localeCompare(b)); - return unfinishedPages; -} - export function extractVersion(versionString: string): string | null { const match = versionString?.match(/^(\d+\.\d+\.\d+)/); return match ? match[1] : null; diff --git a/web/src/utils/types.ts b/web/src/utils/types.ts index ec145809..b205f917 100644 --- a/web/src/utils/types.ts +++ b/web/src/utils/types.ts @@ -33,7 +33,7 @@ export type OOPInfo = MethodOOP | ConstructorOOP; export type FunctionInfo = { description: string; - incomplete?: boolean; + requiresReview?: boolean; type: FunctionType; typePretty: string; pair?: string;