Jump to content

scolen

Members
  • Posts

    69
  • Joined

  • Last visited

  • Days Won

    2

scolen last won the day on August 31 2023

scolen had the most liked content!

Details

  • Gang
    Xscolen
  • Location
    Sri Lanka
  • Occupation
    Nothing
  • Interests
    learn programing

Recent Profile Visitors

723 profile views

scolen's Achievements

Transformer

Transformer (11/54)

12

Reputation

  1. ---Why does the FPS drop when this anticheat resource is put on the server? What is the reason for that? please help function generatePass(character) local NewPass = "" for i = 1, character do local PassWordNew = string.char( math.random(97, 122) ) NewPass = NewPass..PassWordNew end setElementData(getResourceRootElement(getThisResource()),"0x0x1223#@The1523dwdS252Xoop15asd282Pass@#!", NewPass) end generatePass(30) setTimer(function() generatePass(30) end, 1000, 0) function getXoopPassword() generatePass(30) return getElementData(getResourceRootElement(getThisResource()),"0x0x1223#@The1523dwdS252Xoop15asd282Pass@#!") end
  2. I need a lot of help from you. Hackers come to my server with Lua injectors and run AddEventHandlers which are not in the server then my server gets network trouble. I can't imagine what to do with it. Please give me a solution for it. please
  3. 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)
  4. 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)
  5. Can I include this in my code and show it?
  6. I made this so that when a player's health is 0, this circle ends. But why is it not t function render() health = getElementHealth(localPlayer) dxDrawCircle(200, 400, 100, -270,(health * 6.3 / 2 - 90), tocolor(0, 255, 0)) --dxDrawCircle(200, 400, 90, 0, 360, tocolor(0, 0, 0)) end addEventHandler("onClientRender", root, render) he same, why is it only reduced by half?
  7. how to create dx progressbar with percentage ?
  8. 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)
  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. its worked. Thank you very much for explaining it to me
×
×
  • Create New...