Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Lua Language Server - Definition files The Lua language server is a powerful tool that enhances the development experience for Lua programming. It provides a comprehensive set of code editing features, including suggestions, auto-completion, and error checking. With the Lua language server, developers can effortlessly navigate through their resource files, access documentation easily, and ensure code correctness by giving warnings. Why should you care? The language server will inform you about all sorts of problems: type mismatches, missing function arguments, missing variables, etc. You have access to a lot of MTA syntax/autocomplete out of the box. The syntax information will remain while writing. You do not have to restart your resource so often in order to validate if everything is working. Type validation Having value type validation in your code editor is one of the main key features of the Lua Language Server. When working with variables, parameters, and arguments in Lua, you are not restricted to specific value types. This flexibility can make mistakes more likely to happen. However, being able to validate those mistakes instantly saves you a lot of time and frustration. Type annotations for your own functions Adding type annotations to your own functions can help improve validation and catch logic mistakes. It is particularly useful when calling functions from different parts of your code, as the annotations provide clarity on the expected input (arguments) and output (return values). Additionally, comments that are placed above or adjacent to a variable or function are visible when hovering over them in another file or line. This can provide helpful information and context when working with the code. How that looks like: How can I quickly add annotations in less than a second? Open the spoiler: AddEventHandler auto-complete Most MTA addEventHandler functions have full eventName autocompletion. And the attached anonymous function is fully autocompleted and typed as well. Navigation features of Lua Language Server It can be time consuming to find out where a (global) function or variable is located. Being able to jump right to it, saves you a lot of time. Other information which you can find in the readme Installation for the Lua Language Server How to use the definition files? Known issues Make sure to always have an empty new line at the end of your files, as recommended in this issue. Currently, the Lua server language definition files do not have a clear separation between serverside functions/events and clientside functions/events. However, it is possible to enforce this separation for specific functions if needed. outputChatBox--[[@as outputChatBox_server]]("Serverside", player) In certain cases, certain functions in the Lua server language definition files may return multiple types, even if you have selected a different syntax. To handle this situation, you can use the `cast` or `as` notation to explicitly specify the desired type or adjust the returned type. See `Casting and as` syntax below. Casting and as In certain situations, you may have a strong understanding of the type(s) that a variable or expression will have. This is where the keywords "cast" and "as" come into play. These keywords enable you to explicitly specify the intended type, ensuring proper type handling. local varName = exampleFunc() ---@cast varName string local varName = exampleFunc() ---@cast varName string | number local varName = exampleFunc() --[[@as string]] local varName = exampleFunc() --[[@as string | number]] Download The definition files can be downloaded here.
  2. Hello Forum! I need yor help I am just starting to learn programming in Lua, there are not many guides, so I turn to you. I wrote my own passport emulation, but I don't understand how I can put the entered data into the database. Below I will attach my code. Also, I would be happy if you could help me and tell me how I can add the display of this "passport" when entering a marker using addEventHendler. Thank you in advance! My code local dgs = exports.dgs local sw,sh = guiGetScreenSize() -- разрешение экрана игрока local px,py = sw/1920,sh/1080 -- адаптация экрана local window = dgs:dgsCreateWindow(((sw-800)/2)*px,((sh-600)/2)*py,800*px,600*py,"Паспорт",false) local buttonExecute = dgs:dgsCreateButton(325*px,530*py,150*px,40*py,"Подтвердить",false,window,nil,nil,nil,nil,nil,nil,tocolor(255,0,0),tocolor(100,0,0),tocolor(255,0,0)) local labelFirstName = dgs:dgsCreateLabel(200*px,200*py,400*px,30*py," Имя: ",false,window) local editFirstName = dgs:dgsCreateEdit(200*px,220*py,400*px,30*py,"",false,window,tocolor(255,255,255),nil,nil,nil) dgs:dgsSetProperty(labelFirstName,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editFirstName,"alignment",{"center"}, {"center"}) local labelLastName = dgs:dgsCreateLabel(200*px,270*py,400*px,30*py," Фамилия: ",false,window) local editLastName = dgs:dgsCreateEdit(200*px,290*py,400*px,30*py,"",false,window,tocolor(255,255,255),nil,nil,nil) dgs:dgsSetProperty(labelLastName,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editLastName,"alignment",{"center"}, {"center"}) local labelAge = dgs:dgsCreateLabel(200*px,340*py,400*px,30*py," Возраст: ",false,window,tocolor(255,255,255),nil,nil,nil) local editAge = dgs:dgsCreateEdit(200*px,360*py,400*px,30*py,"",false,window) dgs:dgsSetProperty(labelAge,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editAge,"alignment",{"center"}, {"center"}) local labelCountry = dgs:dgsCreateLabel(200*px,410*py,400*px,30*py," Страна: ",false,window,tocolor(255,255,255),nil,nil,nil,tocolor(100,100,100,100)) local editCountry = dgs:dgsCreateEdit(200*px,430*py,400*px,30*py,"",false,window) dgs:dgsSetProperty(labelCountry,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editCountry,"alignment",{"center"}, {"center"}) dgs:dgsWindowSetMovable(window,false) dgs:dgsWindowSetSizable(window,false) dgs:dgsWindowSetCloseButtonEnabled(window,false) dgs:dgsSetVisible(window,true) dgs:dgsSetVisible(window,true) showCursor(true) function openPanel() dgs:dgsSetVisible(window,true) showCursor(true) end function colsePanel() dgs:dgsSetVisible(window,false) showCursor(false) end local currentChose = "register" addEventHandler("onDgsMouseClick",root,function(btn,state) if btn == "left" and state == "down" then if source == buttonExecute then local firstName = dgs:dgsGetText(editFirstName) local lastName = dgs:dgsGetText(editLastName) local age = dgs:dgsGetText(editAge) local country = dgs:dgsGetText(editCountry) if not string.find(firstName,"%S") then outputChatBox("Name") return end if not string.find(lastName,"%S") then outputChatBox("LastName") return end if not string.find(age,"%d") then outputChatBox("Age") return end if not string.find(country,"%S") then outputChatBox("Country") return end triggerServerEvent("playerPassportEnter",localPlayer,firstName,lastName,age,country) end end end) If you do help me, please write this with explanations, thank you in advance! I LOVE YOU FORUM
  3. se busca scripters para este servidor que sepa programar en lua de forma voluntaria si quiere puede unirse al proyecto estamos con la gamemode de chicago roleplay / pop life / life stealh roleplay son de la misma base las 3 se maneja algo similar por lo que tengo entendido el que este interesado entre al servidor de discord, verifiquense y abran un ticket para hablarme de forma privada adamas buscamos nuevos usuarios que sean activos para poder poner en pie el servidor, gracias. Discord: https://discord.gg/Ecjn6AyUQN
  4. se busca scripters para este servidor que sepa programar en lua de forma voluntaria si quiere puede unirse al proyecto estamos con la gamemode de chicago roleplay / pop life / life stealh roleplay son de la misma base las 3 se maneja algo similar por lo que tengo entendido el que este interesado entre al servidor de discord, verifiquense y abran un ticket para hablarme de forma privada adamas buscamos nuevos usuarios que sean activos para poder poner en pie el servidor, gracias. Discord: https://discord.gg/Ecjn6AyUQN
  5. Hello everyone, i was wondering if there's a way to make some models exceptions on this code, that is supposed to delete all GTA default models but i need the ints to not be deleted so i want to know how can i make exceptions for some interior models.. addEventHandler("onResourceStart", resourceRoot, function() for i=550, 20000 do removeWorldModel(i, 10000, 0, 0, 0) setOcclusionsEnabled(false) end end)
  6. Hello guys, does anyone have an idea how to send Lua values to JavaScript to display them in the game, or for example, to show a list of players or run a JavaScript function?
  7. I made a hud but it has a bug. For those who register and login, setElementData is not set. How to fix it ? If the resource is restarted, the element data will be set and saved in the account data Server Side addEventHandler("onPlayerQuit", root, function(type) if type == "Quit" then local health = getElementHealth(source) local armor = getPedArmor(source) local water = getElementData(source, "water") local food = getElementData(source, "food") local account = getPlayerAccount(source) setAccountData(account, "health", health) setAccountData(account, "armor", armor) setAccountData(account, "water", water) setAccountData(account, "food", food) end end) addEventHandler("onPlayerLogin", root, function(pa, ca) local account = getPlayerAccount(source) if not isGuestAccount(account) then local health = getAccountData(account, "health") local armor = getAccountData(account, "armor") local water = getAccountData(account, "water") local food = getAccountData(account, "food") setElementHealth(source, health) setPlayerArmor(source, armor) setElementData(source, "water", water) setElementData(source, "food", food) end end) function drinkWater(player, price, size) if getPlayerMoney(player) < System.prices.food_price then outputChatBox("water cannot be given because you have no money", player, 255, 0, 0) else if getElementData(player, "water") >= 95 then outputChatBox("You can't get more food because your stomach is full!", player, 255, 0, 0) else setElementData(player, "water", getElementData(player, "water") + 20) takePlayerMoney(player, System.prices.water_price) triggerClientEvent(player, "drinking", player) end end end function eatFood(player, price, size) if getPlayerMoney(player) < System.prices.water_price then outputChatBox("Food cannot be given because you have no money", player, 255, 0, 0) else if getElementData(player, "food") >= 95 then outputChatBox("You can't get more food because your stomach is full!", player, 255, 0, 0) else setElementData(player, "food", getElementData(player, "food") + 20) takePlayerMoney(player, System.prices.food_price) triggerClientEvent(player, "eating", player) end end end addEventHandler("onPlayerWasted", root, function() setElementData(source, "water", 50) setElementData(source, "food", 50) end) addEvent("fireStop", true) addEventHandler("fireStop", root, function(player) toggleControl(player, "fire", false) end) addEvent("fireStart", true) addEventHandler("fireStart", root, function(player) toggleControl(player, "fire", true) end) addEvent("runStop", true) addEventHandler("runStop", root, function(player) toggleControl(player, "sprint", false) end) addEvent("runStart", true) addEventHandler("runStart", root, function(player) toggleControl(player, "sprint", true) end) Client Side local screenW, screenH = guiGetScreenSize() setElementData(localPlayer, "water", 100) setElementData(localPlayer, "food", 100) showPlayerHudComponent("health", false) showPlayerHudComponent("armour", false) showPlayerHudComponent("money", false) showPlayerHudComponent("ammo", false) showPlayerHudComponent("weapon", false) showPlayerHudComponent("clock", false) function render() health = getElementHealth(localPlayer) armor = getPedArmor(localPlayer) water = getElementData(localPlayer, "water") food = getElementData(localPlayer, "food") money = getPlayerMoney(localPlayer) time = getRealTime() hour = time.hour minute = time.minute second = time.second weaponID = getPlayerWeapon(localPlayer) weaponName = getWeaponNameFromID(weaponID) ammo = getPedAmmoInClip(localPlayer) allammo = getPedTotalAmmo(localPlayer) -- health dxDrawCircle((screenW - 225), (screenH / 5000 + 30), 25, -270,(health * 3.6 - 270), tocolor(0, 255, 0), 30) -- health line dxDrawCircle((screenW - 225), (screenH / 5000 + 30), 18, 0, 360, tocolor(26, 26, 26)) -- black circle dxDrawImage((screenW - 225) - (27 / 2), (screenH / 300 + 15), 27, 27, "assets/icons/heart.png") -- health icon -- armor dxDrawCircle((screenW - 160), (screenH / 5000 + 30), 25, -270,(armor * 3.6 - 270), tocolor(194, 194, 194), 30) -- armor line dxDrawCircle((screenW - 160), (screenH / 5000 + 30), 18, 0, 360, tocolor(26, 26, 26)) -- black circle dxDrawImage((screenW - 160) - (27 / 2), (screenH / 300 + 16), 27, 27, "assets/icons/armor.png") -- armor icon -- water dxDrawCircle((screenW - 95), (screenH / 5000 + 30), 25, -270,(water * 3.6 - 270), tocolor(10, 252, 236), 30) -- water line dxDrawCircle((screenW - 95), (screenH / 5000 + 30), 18, 0, 360, tocolor(26, 26, 26)) -- black circle dxDrawImage((screenW - 95) - (20 / 2), (screenH / 300 + 12), 20, 30, "assets/icons/water.png") -- water icon -- food dxDrawCircle((screenW - 30), (screenH / 5000 + 30), 25, -270,(food * 3.6 - 270), tocolor(209, 102, 8), 30) -- food line dxDrawCircle((screenW - 30), (screenH / 5000 + 30), 18, 0, 360, tocolor(26, 26, 26)) -- black circle dxDrawImage((screenW - 28) - (27 / 2), (screenH / 300 + 13), 27, 27, "assets/icons/food.png") -- food icon --background dxDrawRectangle((screenW - 235), (screenH / 5000 + 62), 260, 50, tocolor(23, 23, 23, 230)) dxDrawCircle((screenW - 235), (screenH / 5000 + 87), 25, -90, -270, tocolor(23, 23, 23, 230)) -- money dxDrawText("MONEY: $"..money, (screenW - 203), (screenH / 5000 + 70), 20, 20 , tocolor(0, 186, 43), 0.5, "bankgothic") -- real time dxDrawText(string.format("TIME: %02d:%02d:%02d", hour,minute,second), (screenW - 200), (screenH / 5000 + 90), 20, 20 , tocolor(166, 166, 166), 0.5, "bankgothic") -- weapons if weaponID ~= 0 then dxDrawRectangle((screenW - 235), (screenH / 5000 + 120), 260, 25, tocolor(23, 23, 23, 230)) dxDrawCircle((screenW - 235), (screenH / 5000 + 132.5), 12, -90, -270, tocolor(23, 23, 23, 230)) dxDrawText(weaponName.." | "..ammo.." | "..allammo, (screenW - 203), (screenH / 5000 + 125), 20, 20 , tocolor(237, 186, 0), 0.5, "bankgothic") end if (food <= 2) then triggerServerEvent("fireStop", resourceRoot, localPlayer) else triggerServerEvent("fireStart", resourceRoot, localPlayer) end if (water <= 2) then triggerServerEvent("runStop", resourceRoot, localPlayer) else triggerServerEvent("runStart", resourceRoot, localPlayer) end end addEventHandler("onClientRender", root, render) setTimer(function(player) if (getElementData(localPlayer, "water") <= 2) then return else setElementData(localPlayer, "water", getElementData(localPlayer, "water") - 1) end end, System.decrease.water, 0) setTimer(function(player) if (getElementData(localPlayer, "food") <= 2) then return else setElementData(localPlayer, "food", getElementData(localPlayer, "food") - 1) end end, System.decrease.food, 0)
  8. what is problem this code ? gate = createObject(980, 364.82147, 186.89452, 1019.98438) setElementInterior(gate, 3) bombMarker = createMarker(364.70267, 186.29311, 1019.98438 -0.5, "cylinder", 1, 255, 0, 0) setElementInterior(bombMarker, 3) addEventHandler("onMarkerHit", bombMarker, function(player) outputChatBox("ugh!") end)
  9. Why is outPutChatBox saying false instead of 1 ? What I need is to get the outPutChatBox as 1 marker = createMarker(2093.75464, -1948.29468, 13.54688, "cylinder", 1) addEventHandler("onClientMarkerHit", marker, function(player) setElementData(player, "item", 1) outputChatBox("hitted") end) addEventHandler("onClientRender", root, function(player) count = tostring(getElementData(player, "item")) outputChatBox(count) end)
  10. Why doesn't the vehicle destroy when the player disconnects ? marker = createMarker(2169.62500, -1983.23706, 13.55469, "cylinder", 1) vehicles = {} addEventHandler("onMarkerHit", marker, function(player) vehicles[player] = createVehicle(408, 2169.62500 + 3, -1983.23706, 13.55469) end) addEventHandler("onPlayerQuit", root, function(type) if (type == "Quit") then destroyElement(vehicles[player]) end end)
  11. This is a dirt job script I'm currently working on... There's a bug here, why isn't the marker destroyed when the player exits the vehicle? client side -- client side local screenW, screenH = guiGetScreenSize() local w, h = 400, 330 local jobMarker = createMarker(-1895.57104, -1660.41797, 22.11562, "cylinder", 1.0, 0, 255, 0) local window setMoonSize(1000) function getJob(player, matchingDeminsion) if player == localPlayer and matchingDeminsion then if not isPedInVehicle(player) then if isPedOnGround(player) then if not (window) then window = guiCreateWindow((screenW / 2) - (w / 2), (screenH / 2) - (h / 2), w, h, "garbage job", false) memo = guiCreateMemo(0, 30, w, 200, "this is garbage job!", false, window) guiMemoIsReadOnly(memo) accept = guiCreateButton(0, 290, 100, 40, "Accept", false, window) leave = guiCreateButton(130, 290, 100, 40, "Leave Job", false, window) close = guiCreateButton(250, 290, 100, 40, "Close", false, window) showCursor(true) else guiSetVisible(window, false) window = nil showCursor(false) end end end end end addEventHandler("onClientMarkerHit", jobMarker, getJob) function clicks() if (source == accept) then guiSetVisible(window, false) window = nil showCursor(false) triggerServerEvent("acceptJob", resourceRoot, localPlayer) elseif (source == leave) then guiSetVisible(window, false) window = nil showCursor(false) triggerServerEvent("leaveJob", resourceRoot, localPlayer) elseif (source == close) then guiSetVisible(window, false) window = nil showCursor(false) end end addEventHandler("onClientGUIClick", root, clicks) Server side -- server side addEventHandler("onResourceStart", root, function() team = createTeam("garbage", 0, 255, 0) end) addEvent("acceptJob", true) addEvent("leaveJob", true) function checkAccept(player) -- [accept job function] if (getElementData(player, "Jobs") == "garbage") then outputChatBox("you have alrady garbage job sorry!", player, 255, 0, 0) else setElementData(player, "Jobs", "garbage") setElementData(player, "trashlocation", 0) outputChatBox("job accept successfully!", player, 0, 255, 0) startJob(player) if (team) then setPlayerTeam(player, team) end end end addEventHandler("acceptJob", root, checkAccept) vehicles = { [408] = true } garbages = { [1] = {-1881.14380, -1707.47888, 21.75000}, [2] = {-1885.83081, -1723.84656, 21.75641}, [3] = {-1896.03723, -1731.46301, 21.75000}, [4] = {-1908.80933, -1733.61536, 21.75000}, [5] = {-1930.82690, -1767.77832, 26.18353}, [6] = {-1938.78809, -1781.46545, 29.32999}, [7] = {-1936.23059, -1760.15820, 24.36698}, [8] = {-1935.32361, -1742.58679, 22.91065}, [9] = {-1935.62610, -1719.10291, 21.75000}, [10] = {-1921.58350, -1706.34143, 21.90317}, [11] = {-1902.96033, -1704.98352, 21.75000} } function pickUpLocation(player, id) local x, y, z = garbages[id][1],garbages[id][2],garbages[id][3] local marker = createMarker(x, y, z, "cylinder", 3.0) -- <<<<<< Marker is here addEventHandler("onMarkerHit", marker, function(player) if getElementModel(getPedOccupiedVehicle(player)) == 408 then destroyElement(marker) marker = nil outputChatBox("hitted") setElementData(player, "trashlocation", getElementData(player, "trashlocation")+1) newLocation = getElementData(player, "trashlocation") pickUpLocation(player, newLocation) end end) end addEventHandler("onPlayerVehicleEnter", root, function(vehicle, seat, jacked) --[on player vehicle enter] if (vehicles[getElementModel(vehicle)]) and (getElementData(source, "Jobs") ~= "garbage") then removePedFromVehicle(source) x, y, z = getElementPosition(source) setElementPosition(source, x+1, y, z) outputChatBox("You don't have a garbage job", player, 255, 0, 0) end end) addEventHandler("onPlayerVehicleExit", root, function(vehicle, seat, jeacked) --[on player vehicle exit] if (getElementData(source, "Jobs") == "garbage") then if (getElementModel(vehicle) == 408) then outputChatBox("exited") setElementData(source, "Jobs", nil) destroyElement(marker) -- <<<<<<< problem is ehere end end end) trashVehicles = {} trashVehiclesBlips = {} function startJob(player) trashVehicle = createVehicle(408, -1879.74951, -1672.44751, 21.75000, 0, 0, 180) trashVehicleBlip = createBlipAttachedTo(trashVehicle, 51) trashVehicles[player] = trashVehicle trashVehiclesBlips[player] = trashVehicleBlip function checkVehicle(player) local vehicle = getPedOccupiedVehicle(source) local vehicleId = getElementModel(vehicle) outputChatBox(vehicleId) if (vehicleId == 408) then pickUpLocation(player, 1) setElementData(player, "trashlocation", 1) end end addEventHandler("onPlayerVehicleEnter", root, checkVehicle) end function leave(player)-- [leave job function] setElementData(player, "Jobs", nil) setPlayerTeam(player, nil) outputChatBox("leave successfully garbage job!", player, 255, 255, 0) end addEventHandler("leaveJob", root, leave)
  12. I made a trashman job. But there is a small problem, how can only those who have the trashman job try to enter the trash vehicle? -- client side local screenW, screenH = guiGetScreenSize() local w, h = 400, 330 local jobMarker = createMarker(-1895.57104, -1660.41797, 22.11562, "cylinder", 1.0, 0, 255, 0) local window function getJob(player, matchingDeminsion) if player == localPlayer and matchingDeminsion then if not isPedInVehicle(player) then if isPedOnGround(player) then if not (window) then window = guiCreateWindow((screenW / 2) - (w / 2), (screenH / 2) - (h / 2), w, h, "garbage job", false) memo = guiCreateMemo(0, 30, w, 200, "this is garbage job!", false, window) guiMemoIsReadOnly(memo) accept = guiCreateButton(0, 290, 100, 40, "Accept", false, window) leave = guiCreateButton(130, 290, 100, 40, "Leave Job", false, window) close = guiCreateButton(250, 290, 100, 40, "Close", false, window) showCursor(true) else guiSetVisible(window, false) window = nil showCursor(false) end end end end end addEventHandler("onClientMarkerHit", jobMarker, getJob) function clicks() if (source == accept) then guiSetVisible(window, false) window = nil showCursor(false) triggerServerEvent("acceptJob", resourceRoot, localPlayer) elseif (source == leave) then guiSetVisible(window, false) window = nil showCursor(false) triggerServerEvent("leaveJob", resourceRoot, localPlayer) elseif (source == close) then guiSetVisible(window, false) window = nil showCursor(false) end end addEventHandler("onClientGUIClick", root, clicks) --server side addEvent("acceptJob", true) addEvent("leaveJob", true) function checkAccept(player) -- [accept job function] if (getElementData(player, "Jobs") == "garbage") then outputChatBox("you have alrady garbage job sorry!", player, 255, 0, 0) else setElementData(player, "Jobs", "garbage") outputChatBox("job accept successfully!", player, 0, 255, 0) startJob(player) end end function startJob(player) trashVehicle = createVehicle(408, -1879.74951, -1672.44751, 21.75000, 0, 0, 180) end addEventHandler("acceptJob", root, checkAccept) function leave(player)-- [leave job function] setElementData(player, "Jobs", nil) destroyElement(trashVehicle) outputChatBox("leave successfully garbage job!", player, 255, 255, 0) end addEventHandler("leaveJob", root, leave)
  13. When one of these markers is hit, another marker is destroyed. After that, even if other markers are hit, none of the markers will be destroyed. What is the reason for it ? garbages = { {-1881.14380, -1707.47888, 21.75000}, {-1885.83081, -1723.84656, 21.75641}, {-1896.03723, -1731.46301, 21.75000}, {-1908.80933, -1733.61536, 21.75000} } function pickup(player) for i,garbage in pairs(garbages) do marker = createMarker(garbage[1], garbage[2], garbage[3], "cylinder", 3.0) function picked(player) destroyElement(marker) end addEventHandler("onMarkerHit", marker, picked) end end
  14. How to increase the shooting speed of a weapon ?
  15. This is a script I made. This has been working fine so far and then suddenly stopped working. What is the reason for it? addEvent("startMinerJob", true) function startJob(thePlayer) if not (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", "miner") setElementData(thePlayer, "copper", getElementData(thePlayer, "copper")) end mineMarker = createMarker(596.22632, 926.04364, -37.97111, "cylinder", 10.0) addEventHandler("onMarkerHit", mineMarker, function() playerWeapon = getPlayerWeapon(thePlayer) if playerWeapon == 23 then outputChatBox("test", thePlayer) setPedFrozen(thePlayer, true) setTimer(function() setPedAnimation(thePlayer, "SWORD", "sword_4", -1, false, false, false, false) end, 1000, 5) setTimer( function() outputChatBox("relesed", thePlayer) setPedFrozen(thePlayer, false) setElementData(thePlayer, "copper", getElementData(thePlayer, "copper")+3) end , 5000, 1) end end) end addEventHandler("startMinerJob", root, startJob) --[[ Leave Miner Job Section ]] addEvent("leaveMinerJob", true) function leaveJob(thePlayer) if (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", nil) outputChatBox("you leaved miner job!", thePlayer, 0, 255, 0) end end addEventHandler("leaveMinerJob", root, leaveJob) --[[ Job Testing Section ]] function test(thePlayer) de = getElementData(thePlayer, "copper") outputChatBox("you have "..de.." coppers") end addCommandHandler("gg", test)
  16. scolen

    [HELP]DATABSE

    No purchased vehicles will be left. In the console, here is an error: "CarShop-System/Server.lua:120: dbExec failed; (1) SQL argument error ".. but the localhost is working fine without any errors, when I put it on the server it happens like this. What is the reason for that ? createBlip ( 2131.88086, -1149.92566, 24.21433, 55, 2, 0, 0, 0, 255, 0, 99999.0, getRootElement( ) ) local vehDB = dbConnect( 'sqlite', 'Loja de veiculos - Database.db' ) dbExec( vehDB, ' CREATE TABLE IF NOT EXISTS `VehiclesSystem_Players` (pSerial, vehID, vehName, vehPrice, Subscription) ' ) --dbExec( vehDB, ' DROP TABLE `VehiclesSystem_Players` ' ) vehPers = { }; vehview = { }; function refreshMyList( ) local check = dbQuery( vehDB, ' SELECT * FROM `VehiclesSystem_Players` ' ) local results = dbPoll( check, -1 ) if ( type( results ) == 'table' and #results == 0 or not results ) then triggerClientEvent( root, 'VehiclesSystem;emptyMyList', root ) return end triggerClientEvent( root, 'VehiclesSystem;putMyVehicles', root, results ) end addEvent( 'refreshMyListS', true ) addEventHandler( 'refreshMyListS', root, refreshMyList ) function viewVehiclex( ID, x, y, z, state ) if ( state == 'close' ) then if ( isElement( vehview[source] ) ) then destroyElement( vehview[source] ) end elseif ( state == 'view' ) then if ( isElement( vehview[source] ) ) then if ( getElementModel( vehview[source] ) ) == ID then return end destroyElement( vehview[source] ) end vehview[source] = createVehicle( ID, x, y, z + 0.2, 0, 0, 10 ) setElementDimension( vehview[source], getElementData( root, 'vehiclesSystem;dimension' ) or 1 ) setElementDimension( source, getElementData( root, 'vehiclesSystem;dimension' ) or 1 ) setElementData( root, 'vehiclesSystem;dimension', getElementData( root, 'vehiclesSystem;dimension' ) + 1 or 1 ) end end addEvent( 'VehiclesSystem;createViewVehicle', true ) addEventHandler( 'VehiclesSystem;createViewVehicle', root, viewVehiclex ) addEvent( 'VehiclesSystem;destroyPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;destroyPersonalVehicle', root, function( ) if ( isElement( vehPers[source] ) ) then destroyElement( vehPers[source] ) end end ) addEvent( 'VehiclesSystem;createRentVehicle', true ) addEventHandler( 'VehiclesSystem;createRentVehicle', root, function( ID, vehName ) if ( isElement( vehPers[source] ) ) then destroyElement( vehPers[source] ) end vehPers[source] = createVehicle( ID, 2126.08862, -1136.05115, 25.47241 + 1, -0, 0, 224.5189666748 ) fadeCamera( source, false ) setTimer( fadeCamera, 1500, 1, source, true ) takePlayerMoney( source, 1000 ) setElementDimension( vehPers[source], 0 ) setElementDimension( source, 0 ) setTimer( warpPedIntoVehicle, 1500, 1, source, vehPers[source] ) setTimer( destroyElement, 300000, 1, vehPers[source] ) setTimer( function( ) outputChatBox( '#1E90FF[Car Shop] #FFFFFFWarning: Your rental time is up and your vehicle has been removed #FF0000!', source, 255, 255, 255, true ) end, 300000, 1 ) triggerClientEvent( source, 'VehiclesSystem;gridListAddRent', source, ID, vehName ) end ) addEvent( 'VehiclesSystem;lock/unlockPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;lock/unlockPersonalVehicle', root, function( ) if ( not isElement( vehPers[source] ) ) then outputChatBox( '#1E90FF[Car Shop] #FFFFFFError: you dont have this vehicle #FF0000!', source, 255, 255, 255, true ) return end if ( isVehicleLocked( vehPers[source] ) == true ) then setVehicleLocked( vehPers[source], false ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFSuccess, Your vehicle has been unlocked #2BFF00!', source, 255, 255, 255, true ) else setVehicleLocked( vehPers[source], true ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFSuccess, Your vehicle has been locked #2BFF00!', source, 255, 255, 255, true ) end end ) addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, function( ) if ( not isElement( vehPers[source] ) ) then outputChatBox( '#1E90FF[Car Shop] #FFFFFFError: you dont have this vehicle #FF0000!', source, 255, 255, 255, true ) return end if ( getVehicleEngineState( vehPers[source] ) == true ) then setVehicleEngineState( vehPers[source], false ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFEngine off #2BFF00!', source, 255, 255, 255, true ) else setVehicleEngineState( vehPers[source], true ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFEngine on #2BFF00!', source, 255, 255, 255, true ) end end ) addEvent( 'VehiclesSystem;off/onLightsPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onLightsPersonalVehicle', root, function( ) if ( not isElement( vehPers[source] ) ) then outputChatBox( '#1E90FF[Car Shop] #FFFFFFError: you dont have this vehicle #FF0000!', source, 255, 255, 255, true ) return end if ( getVehicleLightState( vehPers[source], 0 ) == 0 and getVehicleLightState( vehPers[source], 1 ) == 0 ) then setVehicleLightState( vehPers[source], 0, 1 ) setVehicleLightState( vehPers[source], 1, 1 ) setVehicleLightState( vehPers[source], 2, 1 ) setVehicleLightState( vehPers[source], 3, 1 ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFlights off #2BFF00!', source, 255, 255, 255, true ) else setVehicleLightState( vehPers[source], 0, 0 ) setVehicleLightState( vehPers[source], 1, 0 ) setVehicleLightState( vehPers[source], 2, 0 ) setVehicleLightState( vehPers[source], 3, 0 ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFLights on #2BFF00!', source, 255, 255, 255, true ) end end ) addEvent( 'VehiclesSystem;sellMyPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;sellMyPersonalVehicle', root, function( ID, price ) local check = dbQuery( vehDB, ' SELECT * FROM `VehiclesSystem_Players` WHERE pSerial = ? AND vehID = ? ', getPlayerSerial( source ), ID ) local results = dbPoll( check, -1 ) if ( type( results ) == 'table' and #results == 0 or not results ) then outputChatBox( '#1E90FF[Car Shop] #FFFFFFError: This vehicle is not permanent, you cannot sell it #FF0000!', source, 255, 255, 255, true ) return end if ( isElement( vehPers[source] ) ) then destroyElement( vehPers[source] ) end dbExec( vehDB, ' DELETE FROM `VehiclesSystem_Players` WHERE pSerial = ? AND vehID = ? ', getPlayerSerial( source ), ID ) refreshMyList( ) givePlayerMoney( source, price ) outputChatBox( '#2BFF00*#1E90FF[Car Shop] #FFFFFFSold! You have successfully sold your vehicle #2BFF00!', source, 255, 255, 255, true ) end ) addEvent( 'VehiclesSystem;createPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;createPersonalVehicle', root, function( ID ) local x, y, z = getElementPosition( source ) if ( isElement( vehPers[source] ) ) then destroyElement( vehPers[source] ) end vehPers[source] = createVehicle( ID, x + 2, y + 2, z + 1 ) if ( getElementData( source, 'VehiclesSystem;WarpToVehicle' ) == 'Enabled' ) then warpPedIntoVehicle( source, vehPers[source] ) setElementData( vehPers[source], 'myPersVehicle', getPlayerName( source ) ) end end ) addEvent( 'VehiclesSystem;buyCurrentCar', true ) addEventHandler( 'VehiclesSystem;buyCurrentCar', root, function( ID, Name, Price ) local check = dbQuery( vehDB, ' SELECT * FROM `VehiclesSystem_Players` WHERE pSerial = ? AND vehddID = ? ', getPlayerSerial( source ), ID ) local results = dbPoll( check, -1 ) if ( type( results ) == 'table' and #results == 0 or not results ) then dbExec( vehDB, ' INSERT INTO `VehiclesSystem_Players` VALUES(?,?,?,?,?) ', getPlayerSerial( source ), tonumber(ID), Name, Price, 'Permanente' ) vehPers[source] = createVehicle( ID, 2126.08862, -1136.05115, 25.47241 + 1, -0, 0, 224.5189666748 ) warpPedIntoVehicle( source, vehPers[source] ) takePlayerMoney( source, Price ) setTimer(setCameraTarget, 1500, 1, source ) setElementDimension( vehPers[source], 0 ) setElementDimension( source, 0 ) fadeCamera( source, false ) setTimer( fadeCamera, 1500, 1, source, true ) triggerClientEvent( source, 'VehiclesSystem;hideBuyWindow', source ) viewVehiclex( nil, nil, nil, nil, 'close' ) refreshMyList( ) else outputChatBox( '#1E90FF[Car Shop] #FFFFFFError: This vehicle already exists in your list #FF0000!', source, 255, 255, 255, true ) return end end )
  17. Is there a resource that spawns from the nearest hospital after a player dies ?... or how to make it. I have put many respawn resources but there is some error and it doesn't spawn from the nearest hospital.
  18. I created a Miner Job but there is a problem. When I hit the plant command several times, I could mine only the 5 stones in this script, but the other stones are not destroyed. What is the reason for this? Please help? addEvent("startMinerJob", true) function startJob(thePlayer) if not (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", "miner") end function plant(thePlayer) if (getElementData(thePlayer, "Jobs") == "miner") then x, y, z = getElementPosition(thePlayer) disx = 611.54028 disy = 878.61017 disz = -42.9609 if (getDistanceBetweenPoints3D(x, y, z, disx, disy, disz) < 90) then outputChatBox("Bomb Planted!", thePlayer, 255, 0, 0) setTimer(function() createExplosion(x, y, z, 10) stone1 = createObject(3930, x+0, y+1, z-0.5) stone2 = createObject(3930, x+1*2, y+3, z-0.5) stone3 = createObject(3930, x+2*2, y+2, z-0.5) stone4 = createObject(3930, x+3*2, y+5, z-0.5) stone5 = createObject(3930, x+4*2, y+4, z-0.5) x1, y1, z1 = getElementPosition(stone1) x2, y2, z2 = getElementPosition(stone2) x3, y3, z3 = getElementPosition(stone3) x4, y4, z4 = getElementPosition(stone4) x5, y5, z5 = getElementPosition(stone5) marker1 = createMarker(x1, y1, z1, "cylinder", 1.0, 0, 0, 0, 0) marker2 = createMarker(x2, y2, z2, "cylinder", 1.0, 0, 0, 0, 0) marker3 = createMarker(x3, y3, z3, "cylinder", 1.0, 0, 0, 0, 0) marker4 = createMarker(x4, y4, z4, "cylinder", 1.0, 0, 0, 0, 0) marker5 = createMarker(x5, y5, z5, "cylinder", 1.0, 0, 0, 0, 0) addEventHandler("onMarkerHit", marker1, function(thePlayer) setPedFrozen(thePlayer, true) setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false) destroyElement(marker1) setTimer(function() destroyElement(stone1) setPedFrozen(thePlayer, false) givePlayerMoney(thePlayer, 300) end, 3000, 1) end) addEventHandler("onMarkerHit", marker2, function(thePlayer) setPedFrozen(thePlayer, true) setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false) destroyElement(marker2) setTimer(function() destroyElement(stone2) setPedFrozen(thePlayer, false) givePlayerMoney(thePlayer, 300) end, 3000, 1) end) addEventHandler("onMarkerHit", marker3, function(thePlayer) setPedFrozen(thePlayer, true) setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false) destroyElement(marker3) setTimer(function() destroyElement(stone3) setPedFrozen(thePlayer, false) givePlayerMoney(thePlayer, 300) end, 3000, 1) end) addEventHandler("onMarkerHit", marker4, function(thePlayer) setPedFrozen(thePlayer, true) setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false) destroyElement(marker4) setTimer(function() destroyElement(stone4) setPedFrozen(thePlayer, false) givePlayerMoney(thePlayer, 300) end, 3000, 1) end) addEventHandler("onMarkerHit", marker5, function(thePlayer) setPedFrozen(thePlayer, true) setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false) destroyElement(marker5) setTimer(function() destroyElement(stone5) setPedFrozen(thePlayer, false) givePlayerMoney(thePlayer, 300) end, 3000, 1) end) end, 5000, 1) end end end addCommandHandler("plant", plant) end addEventHandler("startMinerJob", root, startJob) --[[ Leave Miner Job Section ]] addEvent("leaveMinerJob", true) function leaveJob(thePlayer) if (getElementData(thePlayer, "Jobs") == "miner") then setElementData(thePlayer, "Jobs", nil) outputChatBox("you leaved miner job!", thePlayer, 0, 255, 0) end end addEventHandler("leaveMinerJob", root, leaveJob)
  19. da rapaziada, gostaria de saber como faço para modificar um do lados do retangulo, tipo deixar um dos lados dele um pouco na diagonal, tipo assim " / ", poderiam me ajudar?
  20. Lua tables are a fundamental data structure that allows you to store key-value pairs and create complex data structures. Tables in Lua are versatile and can contain values of different types. Let's dive into a detailed explanation with examples : Table Creation: To create a table in Lua, you use curly braces { } and separate the elements with commas. Here's an example: local table = {1, 2, 3, 4, 5} -- table crt In the above example, we created a table named table and populated it with values 1, 2, 3, 4, and 5. Accessing Table Elements: You can access table elements by using square brackets [ ]. Indices in Lua start from 1. Here's an example: -- Accessing table elements print(table[1]) --output : 1 print(table[3]) --output : 3 In the above example, we access the value at the 1st index (1) and the 3rd index (3) of the table. Adding Elements to a Table: To add a new element to a table, you specify the index and the value. If the specified index already exists in the table, the value will be overwritten. Here's an example: -- Removing elements from a table table[3] = nil In the above example, we remove the element at the 3rd index of the table. Getting the Size of a Table: To get the size of a table (i.e., the number of elements), you can use the # operator. Here's an example: -- Getting the size of a table print(#table) -- 5 In the above example, we print the size of the table using the # operator. Table Iteration: You can iterate over the elements in a table using the ipairs or pairs functions. ipairs provides index-based iteration, while pairs provides key-based iteration. Here's an example: -- Table iteration for index, value in ipairs(table) do print(index, value) end In the above example, we iterate over the table using ipairs and print the index and value of each element. +---------------------------------------------------+ | Game Settings | +---------------------------------------------------+ | Difficulty: | Hard | | Sound Volume: | 80% | | Controls: | Keyboard & Mouse | | Graphics Quality: | High | +---------------------------------------------------+ In the above example, an ASCII art representation is used to display a Lua table representing game settings. The table consists of different elements representing various game settings. Here's the Lua code that represents the table: local gameSettings = { difficulty = "Hard", soundVolume = "80%", controls = "Keyboard & Mouse", graphicsQuality = "High" } In the Lua code, a table named "gameSettings" is created, and different elements representing game settings such as difficulty, sound volume, controls, and graphics quality are added to the table. local person = { name = "Eren", age = 20, occupation = "Software Engineer", country = "Germany" } local tableFormat = [[ +-----------------------+ | Person Info | +-----------------------+ | Name: %s | | Age: %d | | Occupation: %s | | Country: %s | +-----------------------+ ]] local formattedTable = string.format(tableFormat, person.name, person.age, person.occupation, person.country) print(formattedTable) In the example above, we create a Lua table named "person" and populate it with some sample information about a person. We then define a string format named "tableFormat" which represents an ASCII table structure. We use placeholders like %s and %d to indicate the places where the values from the "person" table will be inserted. Finally, we use the string.format function to fill in the format with the data from the "person" table and store it in the variable "formattedTable". We print the "formattedTable" to display the final result. I explained string methods in the previous tutorial, here is the link: string methods LINK Output : +-----------------------+ | Person Info | +-----------------------+ | Name: Eren | | Age: 20 | | Occupation: Software Engineer | | Country: Germany | +-----------------------+ Nested Tables: Tables can contain other tables, allowing you to create nested or multidimensional data structures. Here's an example: -- Nested tables local team = { name = "Team A", players = { { name = "Eren", age = 20 }, { name = "Emily", age = 27 }, { name = "Angela", age = 23 } } } print(team.name) -- Team A print(team.players[2].name) -- Emily In the above example, we created a table named team with two elements: name and players. The players element is a nested table that contains information about individual players. We access the name element of the team table and the name of the player at the 2nd index of the players table. Table Insertion and Removal: Lua provides various functions for inserting and removing elements from tables. Here's an example that demonstrates these operations: -- Table insertion and removal local fruits = {"apple", "banana"} table.insert(fruits, "orange") -- Insert an element at the end table.insert(fruits, 2, "grape") -- Insert an element at the 2nd index table.remove(fruits, 1) -- Remove the element at the 1st index for index, fruit in ipairs(fruits) do print(index, fruit) end In the above example, we start with a table named fruits containing two elements. Using table.insert, we add an element at the end and another element at the 2nd index. Then, using table.remove, we remove the element at the 1st index. Finally, we iterate over the modified fruits table and print the index and value of each element. Table Concatenation: Lua allows you to concatenate tables using the .. operator. Here's an example: -- Table concatenation local table1 = {1, 2, 3} local table2 = {4, 5, 6} local mergedTable = {} for _, value in ipairs(table1) do table.insert(mergedTable, value) end for _, value in ipairs(table2) do table.insert(mergedTable, value) end for index, value in ipairs(mergedTable) do print(index, value) end In the above example, we have two tables named table1 and table2. We create an empty table named mergedTable and use table.insert to concatenate the elements from table1 and table2 into mergedTable. Finally, we iterate over mergedTable and print the index and value of each element. for MTA:SA Player Information: Lua tables can be used to store player information in MTA:SA. Below is an example of a player table that contains details such as the player's name, level, and score: local player = { name = "Eren", level = 5, score = 1000 } In the above example, we create a table named "player" and populate it with the player's name, level, and score. Vehicle List: Lua tables can be utilized to store data related to vehicles in MTA:SA. Here's an example of a vehicle table that includes the model names and colors of the vehicles: local vehicles = { { model = "Infernus", color = {255, 0, 0} }, { model = "Bullet", color = {0, 0, 255} }, { model = "Sultan", color = {0, 255, 0} } } In the above example, we create a table named "vehicles" and store each vehicle as a separate table with its model name and color data. Colors are represented using RGB values. NPC (Non-Player Character) List: Lua tables can be used to store in-game NPCs in MTA:SA. Here's an example of an NPC list table that includes the model IDs and coordinates of the NPCs: local npcs = { { model = 23, x = 100, y = 200, z = 10 }, { model = 56, x = 150, y = 250, z = 15 }, { model = 89, x = 200, y = 300, z = 20 } } In the above example, we create a table named "npcs" and store each NPC as a separate table with their model ID and coordinates. I hope you will like it
  21. How do you try not to hit the marker when a player is in a vehicle ?
  22. i created tree cuting job in my server but it have probem. when i take job ,job panel going to all players in server . how can fix it jobPed = createPed(230, 870.47406, -24.95437, 63.97986, 160) setPedFrozen(jobPed, true) jobMarker = createMarker(870.02686, -25.90853, 62.90933, "cylinder", 1.5) createBlipAttachedTo(jobMarker, 22) addEventHandler("onClientMarkerHit", jobMarker, function(player) window = guiCreateWindow(500, 200, 250, 250, "*Tree JoB*", false) memo = guiCreateMemo(100, 20, 240, 100, "Unicos RP Tree Job You can make esy money with rhis one# happy happy happy", false, window) button = guiCreateButton(20, 150, 100, 100, "Accep", false, window) closebutton = guiCreateButton(150, 150, 100, 100, "Close", false, window) showCursor(true) end) function clicks() if source == closebutton then guiSetVisible(window, false) showCursor(false) elseif source == button then guiSetVisible(window, false) showCursor(false) --outputChatBox("You Have a Job!", 0, 255, 0) triggerServerEvent("StartTreeJob", resourceRoot, localPlayer) end end addEventHandler("onClientGUIClick", root, clicks)
  23. I made a bank rob script and there is a big problem. When a person plants the bomb, if another player hits the markers to get money, nothing will happen to him. The person who planted the bomb will get those things. How to fix it? ped1 = createPed(76, 2306.65967, -3.14179, 26.74219, -90) ped2 = createPed(76, 2312.06738, -11.00959, 26.74219, 90*2) ped3 = createPed(76, 2318.17793, -7.16190, 26.74219, 90) entranceGate = createObject(3036, 2304.04873, -17.82764, 26.74219, 0, 0, 90) exitgate = createObject(2930, 2314.72744, 0.79857, 27.94219, 0, 0, 90) marker = createMarker(2303.18848, -16.23989, 25.58438, "cylinder", 1.5, 255,0,0) createBlipAttachedTo(marker, 36) addEventHandler("onMarkerHit", marker, function(thePlayer) destroyElement(marker) setPedFrozen(thePlayer, true) setTimer(function()-- repeat animation set bomb setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", -1, false, false, false, false) end, 1000, 15) setTimer(function()-- bomb planting time Dynamite = createObject(1654, 2303.78211, -16.25232, 25.78438, 0, 90, -90) setObjectScale(Dynamite, 2) setPedFrozen(thePlayer, false) outputChatBox("Run! Run! Run! The bomb was planted", thePlayer, 255,0,0) end, 15000, 1) setTimer(function()-- settimer to expolsion x = 1 while (x < 20) do expolsion = createExplosion(2304.04873, -17.82764, 26.74219, 10) x = x+1 end if expolsion then outputChatBox("The entrance of the bank was destroyed", thePlayer, 255,255,0) destroyElement(entranceGate) destroyElement(Dynamite) setPedAnimation(ped1, "ped", "handsup", -1, false) setPedAnimation(ped2, "ped", "handsup", -1, false) setPedAnimation(ped3, "ped", "handsup", -1, false) end moneyOb1 = createObject(1212, 2312.23828, -17.32469, 27.38801) moneyOb2 = createObject(1212, 2314.83828, -17.32469, 27.38801) setObjectScale(moneyOb1, 2) setObjectScale(moneyOb2, 2) moneyOne = createMarker(2312.33984, -16.28635, 25.84957, "cylinder", 1, 0,255,255) moneyTwo = createMarker(2314.93530, -16.28635, 25.84957, "cylinder", 1, 0,255,255) addEventHandler("onMarkerHit", moneyOne, function() setPedFrozen(thePlayer, true) destroyElement(moneyOne) setTimer(function() setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", -1, false, false, false, false) end, 500, 20) setTimer(function() setPedFrozen(thePlayer, false) mathRandomMoney = math.random(40000, 60000) givePlayerMoney(thePlayer, mathRandomMoney) outputChatBox("You have received $"..mathRandomMoney, thePlayer, 0,255,0) destroyElement(moneyOb1) moneyBag = createObject(1550,0,0,0) exports.bone_attach:attachElementToBone(moneyBag,thePlayer,3, 0, -0.17, 0.07, 0, 0, 0) setTimer(function() ---- Money bag destroy Time 5min (1000*60*5) destroyElement(moneyBag) end, 1000*60*5, 1) end, 1000*35, 1) end) addEventHandler("onMarkerHit", moneyTwo, function() setPedFrozen(thePlayer, true) destroyElement(moneyTwo) setTimer(function() setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", -1, false, false, false, false) end, 500, 20) setTimer(function() setPedFrozen(thePlayer, false) mathRandomMoney = math.random(40000, 60000) givePlayerMoney(thePlayer, mathRandomMoney) outputChatBox("You have received $"..mathRandomMoney, thePlayer, 0,255,0) destroyElement(moneyOb2) moneyBag = createObject(1550,0,0,0) exports.bone_attach:attachElementToBone(moneyBag,thePlayer,3, 0, -0.17, 0.07, 0, 0, 0) setTimer(function()---- Money bag destroy Time 5min (1000*60*5) destroyElement(moneyBag) end, 1000*60*5, 1) end, 1000*35, 1) end) end, 25000, 1) end)
  24. Hey guys, I'm doing freelance on MTA. Prices are very cheap, I accept almost any pay method. Can do: Lua scripting, web development (React/Vue) + Backend (express.js), UI/UX design, simple low poly GTA SA style models, shaders Portfolio: https://imgur.com/a/39PFt56 (click see more) Shaders portfolio: I don't respond on forum, text me on discord borsuk#1102
  25. When I randomly tap my voice button or just hold it for sec, I experience bug when event "onClientPlayerVoiceStop" is not being called. Anyone experience it yet? Image with UI representation of bug https://imgur.com/a/LfysaBA thanks for any replay ;)
×
×
  • Create New...