-
Posts
133 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Trust aka Tiffergan
-
Press the F8 key to open the console. Type the following command: bind M "mousetoggle" Now, when you press the "M" key, it will toggle the mouse cursor on and off. You can use the mouse to click and interact with elements in the game while the cursor is visible. I hope this helps! Let me know if you have any other questions. @DRAGSTER
-
[help!] I can't add a value to the table
Trust aka Tiffergan replied to Murilo_apa's topic in Scripting
Make sure that the vehicle table that is being referenced in the function actually exists and has an entry for the car_id that you are passing to the function. Make sure that the hasV function is correctly implemented and returns the expected values. Check if there are any errors being thrown by the script by enabling debugging in your script editor or by using the outputDebugString function to print error messages to the console. Make sure that the garagem table is being correctly initialized and that it is being set as an element data attribute of the player. Check if the setElementData function is being called correctly and if it is returning the expected result. Make sure that you are calling the giveV function with the correct arguments.- 1 reply
-
- helpme
- please help!
-
(and 2 more)
Tagged with:
-
You can ask for help here and someone will help you FOR FREE xd @Satko
-
buying Base system AND boss system and air drop system
Trust aka Tiffergan replied to konrad22222's topic in Resources
Boss system shloud be connected to your gamemode with your damage weapons etc. Base system same as Boss shloud be connected with playera groups data... And stuff But airdrop is easy so here is some script you can edit to your preferences Airdrop -
[Help] How can i make setItemText for dxgridlist
Trust aka Tiffergan replied to STINGX's topic in Scripting
To set the text of an item in a grid list created with the above code, you will need to modify the dxGridListSetItemText function as follows: First, you will need to modify the function definition to accept the element, column, and row indices as arguments, as well as the new text for the item. Here is an example of how you can do this: function dxGridListSetItemText(element, column, row, text) Next, you will need to retrieve the grid list element from the cache using the Cache table, as shown in the other functions: local self = Cache[element] Once you have the grid list element, you can access the items in the grid list using the self.items table. To set the text of an item, you will need to index into this table using the column and row indices passed to the function. Here is an example of how you can do this: self.items[row][column].text = text Finally, you may need to set the update2 flag to true to trigger a redraw of the grid list. This will ensure that the changes to the item text are displayed in the game. function dxGridListSetItemText(element, column, row, text) local self = Cache[element] if self then if self.items[row] and self.items[row][column] then self.items[row][column].text = text self.update2 = true return true end end return false end I hope this helps! Let me know if you have any questions -
[QUESTION] Attaching moving objects to a vehicle
Trust aka Tiffergan replied to NovaCrew's topic in Scripting
To do this, you will need to use the attachElements Here is an example of how you can use the attachElements function to attach a ramp to a vehicle: local ramp = createObject(1239, 0, 0, 0) -- Create the ramp object local vehicle = createVehicle(400, 0, 0, 0) -- Create the vehicle attachElements(ramp, vehicle, 0, 2, -1) -- Attach the ramp to the vehicle -
start with original lua here -> : https://www.lua.org/start.html
-
It's not that easy because everything you say must be done in gamemode because the weapons must match the zombie script etc etc... -- Spawn a zombie at a random location on the map local x, y, z = math.random(-8000, 8000), math.random(-8000, 8000), 0 local zombie = createPed(28, x, y, z) -- Make the zombie drop a Christmas box when it dies addEventHandler("onPedWasted", zombie, function() local box = createObject(1225, x, y, z) -- You can add code here to make the box contain skins or other items end) Keep in mind that this code is just an example and may need to be modified to fit your specific needs.
-
merry christmas
-
what do you mean? what that script have to do ? s
-
hello i cant join server i get kick with this info in console * Connected! [MTA:SA Server 1.5.9 [GNU/Linux]] Server FPS limit: 60 Server AC info: [Allowed client files: None] [Disabled AC: None] [Enabled SD: None] Błąd pobierania: Error downloading requested files. Couldn't connect to server. [Failed to connect to 178.32.203.118 port 20097 after 2310 ms: Connection refused] [admin/client/admin_clientjoiner.lua] i already install MTA, added MTA to trusted in firewall, tried using VP @Shady1tell me to replace mtaserver.conf on my server and that fix the problem
-
Siema polsko
-
[QUESTION] Adding VTOL to other aircraft
Trust aka Tiffergan replied to NovaCrew's topic in Scripting
you will need to create a new LUA script that defines the behavior of your VTOL aircraft. This script should handle things like takeoff and landing, as well as any other special abilities or features that you want your aircraft to have. In your script, you will need to define a function that handles the vertical takeoff and landing of your aircraft. This function should use the `setElementRotation` function to change the pitch and roll of the aircraft as it takes off and lands. You may also need to use other functions such as `setElementVelocity` and `setElementFrozen` to control the movement of the aircraft. Finally, you will need to bind your VTOL function to a key or button so that the player can control the aircraft. You can do this using the `bindKey` function or by handling the `onClientKey` event. I hope this helps! -
To give the first button an action to do something, you can simply add the code that you want to execute when the button is clicked within the block of the first if statement For example, if you want the first button to output a message to the chat when it is clicked, you can do something like this: addEventHandler ("onClientClick", root, function(btn, state) if btn ~= "left" or state ~= "down" then return end if isMouseInPosition (xx*594, yy*396, xx*235, yy*300) then -- click 1-st button outputChatBox("Button 1 was clicked!") elseif isMouseInPosition (xx*840, yy*396, xx*235, yy*300) then -- click 2-nd button end end) You can also execute other functions or trigger other events when the button is clicked. Just replace the outputChatBox line with the code that you want to execute.
-
how to teleport to coordinates from guiEdit?
Trust aka Tiffergan replied to w3rt1x's topic in Scripting
You are correct that the string.match() function is not the best choice for parsing coordinates in this scenario. Splitting the string into tokens using string.split() and then converting each token to a number using tonumber() is a more robust solution. Here is an example of how you can use string.split() and tonumber() to parse the coordinates string entered in the edit box and store the x, y, and z values in separate variables: local xyz_str = guiGetText(edit_box) local xyz = split(xyz_str, ",") -- xyz is now a table of tokens if #xyz == 3 then -- check if there are exactly 3 coordinates local x, y, z = tonumber(xyz[1]), tonumber(xyz[2]), tonumber(xyz[3]) if x and y and z then -- check if each coordinate is a valid number -- code to execute if coordinates were parsed successfully else -- code to execute if not all coordinates are valid numbers end else -- code to execute if there aren't exactly 3 coordinates end This code will split the coordinates string entered in the edit box into separate tokens using string.split(), and then convert each token to a number using tonumber(). It also checks that there are exactly 3 coordinates and that each coordinate is a valid number before proceeding. You can then use the x, y, and z variables to teleport the player to the specified coordinates using setElementPosition(), as in the previous example. setElementPosition(player, x, y, z) -
how to teleport to coordinates from guiEdit?
Trust aka Tiffergan replied to w3rt1x's topic in Scripting
function createPanel(commandName) local window = guiCreateWindow(532, 373, 232, 171, "TELEPORTER POSITION", false) guiWindowSetSizable(window, false) local button_1 = guiCreateButton(141, 99, 64, 25, "EXIT", false, window) -- guiSetAlpha(button_1, 0.42) -- local button_2 = guiCreateButton(32, 99, 64, 25, "TELEPORT", false, window) local edit_box = guiCreateEdit(42, 37, 153, 21, "0,0,0", false, window) showCursor(true) addEventHandler("onClientGUIClick", button_1, function() if isElement(window) then destroyElement(window) showCursor(false) end end) addEventHandler("onClientGUIClick", button_2, function(player) local x, y ,z = string.match(guiGetText(edit_box), "(%d+), (%d+), (%d+)") x, y, z = tonumber(x), tonumber(y), tonumber(z) setElementPosition(player, x, y, z) end) end addCommandHandler("tp", createPanel) To use this script, the player can enter the desired coordinates in the format "x, y, z" in the edit box and click the "TELEPORT" button. This will teleport the player to the specified coordinates. -
@ToreTTo_MTAadd me on discord i send you a request
-
To detect if a player is near a ped, you can use the isElementWithinColShape function. This function takes two arguments: the first is the element you want to check (in this case, the player), and the second is the colshape you want to check if the element is within (in this case, the ped). If the player is within the colshape of the ped, the function will return true, otherwise it will return false. Here is an example of how you might use this function in your script: function onClientRender() local player = getLocalPlayer() -- get the local player local ped = getPedOccupiedVehicle(player) -- get the ped the player is in if ped then -- if the player is in a ped local pedColShape = createColCircle(getElementPosition(ped), 5) -- create a colshape around the ped if isElementWithinColShape(player, pedColShape) then -- check if the player is within the colshape -- player is within 5 units of the ped, so do something here end end end
-
To apply the S@moke box shader to a texture instead of the screen, you need to remove the followin fragments of code: sampler TextureSampler = sampler_state { Texture = <screenSource>; AddressU = Mirror; AddressV = Mirror; }; and float4 PixelShaderFunction(float2 texCoords : TEXCOORD0) : COLOR0 { // shader code } then you need to add following code sampler TextureSampler = sampler_state { Texture = <tex>; AddressU = Mirror; AddressV = Mirror; }; technique Draw { pass P0 { PixelShader = compile ps_3_0 PixelShaderFunction(texCoords); } } In the above code, `tex` is used as the name of the texture that the shader should be applied to, instead of `screenSource`. Also, a `technique` section was added, which allows the shader to be called from code. Including these changes should allow the shader to be applied to the texture instead of the screen. @raynner
-
To transfer data from Lua to JavaScript and display it in HTML, you can do it as follows: In your Lua code, generate the data that you want to transfer to JavaScript. You can do this using the print statement or other methods of writing data to a file. In your JavaScript code, add code that retrieves the data from the file generated by Lua and saves it to a variable. You can do this using the fetch function or XMLHttpRequest. In your HTML code, add code that displays the data saved in the JavaScript variable. You can do this using the <script> tag or the document.write function. Here is an example code that illustrates the above process: -- Lua code player_name = "John Doe" player_score = 1000 -- save data to file file = io.open("player_data.txt", "w") file:write(player_name .. "\n") file:write(player_score .. "\n") file:close() -- JavaScript code // retrieve data from file fetch("player_data.txt") .then(response => response.text()) .then(data => { // split data by newline character var data_lines = data.split("\n") // save data to variables var player_name = data_lines[0] var player_score = data_lines[1] // display data in HTML document.write("Player name: " + player_name + "<br>") document.write("Player score: " + player_score + "<br>") }) .catch(error => console.error(error))
-
Hello, I have a question, is there any way to improve the viewing distance? I mean, when aiming with a sniper rifle we have a higher level of vision than looking normally from a regular third person. So I'm curious if there is a possibility to block the render somewhere in the files at this maximum level. That we get when aiming with a sniper. Cheers. Hope I asks a question in the right section.
-
Looking for the resource that shows your ping
Trust aka Tiffergan replied to oblivionosaka's topic in Resources
It used to be but in 2014 or so if i remember correctly -
Looking for the resource that shows your ping
Trust aka Tiffergan replied to oblivionosaka's topic in Resources
@oblivionosakai know that it existed before but i cant find it so i made one here : [snip] -
looking for this theme
Trust aka Tiffergan replied to Trust aka Tiffergan's topic in Custom GUI Themes
i got it http://www.mediafire.com/file/f4o4vw43llneylw/Mods_by_Venux.rar/file