Jump to content

Trust aka Tiffergan

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Trust aka Tiffergan

  1. function onPlayerTakeJob(player, jobName) setPlayerWantedLevel(player, getPlayerWantedLevel(player) + 1) end
  2. I guees create new animation and set that animation when you're running or maybe use one of the animations that are already in the game and you will like something
  3. local myCar = getPedOccupiedVehicle(localPlayer) setVehicleColor(myCar, 0, 0, 255, 0, 0, 255) This will change the color of your car to red, but other players will still see your car as its original color. This is because the color change is only applied to your client and is not synced with the server or other clients
  4. local screenW, screenH = guiGetScreenSize() local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*screenW, cursorY*screenH local boneX, boneY, boneZ = getPedBonePosition(player, boneID) setPedBonePosition(player, boneID, cursorX, cursorY, boneZ) This code gets the position of the cursor on the screen using the `getCursorPosition` function, and then converts the cursor coordinates to screen coordinates using the `guiGetScreenSize` function. It then gets the position of the bone using the `getPedBonePosition` function, and finally sets the position of the bone to the cursor position using the `setPedBonePosition` function. You will need to replace player with a reference to the `player` element, and `boneID` with the ID of the bone that you want to follow the cursor.
  5. addCommandHandler("bootveh", bootVehicle) function bootVehicle(player, command, vinOrPlate) -- retrieve the VIN or plate of the vehicle from the command arguments local vinOrPlate = vinOrPlate -- retrieve the element of the vehicle using the VIN or plate local vehicle = getVehicleFromVinOrPlate(vinOrPlate) -- check if the vehicle was found if not vehicle then outputChatBox("Invalid VIN or plate.", player) return end -- freeze the vehicle setElementFrozen(vehicle, true) outputChatBox("Vehicle frozen.", player) end function getVehicleFromVinOrPlate(vinOrPlate) -- query the database for the VIN or plate local result = dbQuery(...) -- check if the result is valid if not result then return end -- retrieve the first row from the result local row = dbPoll(result, -1)[1] -- check if a row was found if not row then return end -- return the element of the vehicle return row.vehicle end addCommandHandler("unbootveh", unbootVehicle) function unbootVehicle(player, command, vinOrPlate) -- retrieve the VIN or plate of the vehicle from the command arguments local vinOrPlate = vinOrPlate -- retrieve the element of the vehicle using the VIN or plate local vehicle = getVehicleFromVinOrPlate(vinOrPlate) -- check if the vehicle was found if not vehicle then outputChatBox("Invalid VIN or plate.", player) return end -- unfreeze the vehicle setElementFrozen(vehicle, false) outputChatBox("Vehicle unfrozen.", player) end You will need to create a function to retrieve the element of the vehicle from the VIN or plate. You can do this by querying the database for the VIN or plate and returning the element of the vehicle. You can create a similar command and function for /unbootveh to unfreeze the vehicle.
  6. @Ryuto Maybe something with https://wiki.multitheftauto.com/wiki/SetCursorPosition https://wiki.multitheftauto.com/wiki/GetCursorPosition And something with getting name of the player when cursor is on them? Hmm hard question...
  7. Have a nice year and don't cheat again ?
  8. @Matei02Mihai It looks like you're trying to create a button using the dgsCreateButton function, but it's not appearing on the screen. There are a few things you could try to troubleshoot this issue: Make sure that you have correctly imported the dgs library and the OOP classes by using the dgsImportFunction and dgsImportOOPClass functions. These functions should be called before you try to use any dgs functions or classes. Make sure that the paneltest function is being called correctly. You can add a print statement at the beginning of the function to verify that it's being called correctly. Make sure that you have correctly defined the position and size of the button using the buttonfinal.x, buttonfinal.y, buttonsize.x, and buttonsize.y variables. These variables should be set to the desired position and size of the button. Make sure that you are not accidentally covering up the button with other GUI elements. You can try changing the draw order of your GUI elements to make sure that the button is being drawn on top of other elements.
  9. 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
  10. 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.
  11. You can ask for help here and someone will help you FOR FREE xd @Satko
  12. 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
  13. 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
  14. 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
  15. 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
  16. start with original lua here -> : https://www.lua.org/start.html
  17. 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.
  18. what do you mean? what that script have to do ? s
  19. 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
  20. 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!
  21. 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.
  22. 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)
×
×
  • Create New...