Jump to content

Trust aka Tiffergan

Members
  • Posts

    133
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Trust aka Tiffergan

  1. 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
  2. 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.
  3. You can ask for help here and someone will help you FOR FREE xd @Satko
  4. 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
  5. 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
  6. 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
  7. It seems to me that with such characters it would be more difficult to give a penalty to the player because you would have to look for him in the panel you would not do it command not having the ability to rewrite his name
  8. start with original lua here -> : https://www.lua.org/start.html
  9. 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.
  10. what do you mean? what that script have to do ? s
  11. 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
  12. 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!
  13. 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.
  14. 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)
  15. 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.
  16. @ToreTTo_MTAadd me on discord i send you a request
  17. 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
  18. 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
  19. 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))
  20. 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.
  21. It used to be but in 2014 or so if i remember correctly
  22. @oblivionosakai know that it existed before but i cant find it so i made one here : [snip]
  23. i got it http://www.mediafire.com/file/f4o4vw43llneylw/Mods_by_Venux.rar/file
×
×
  • Create New...