Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 14/03/23 in all areas

  1. Hello, We are from organization 'CREED' . we are looking for create international MTA server . so we looking for a sponsor for MTA server. we have around 20+ MTA players, we need like 100 slots for server. We can advertise your company or your other business in our server If anything else you want just say it. if you interested, please contact me on e-mail. kindly regards, wiz119 (Team CREED) Email: d [email protected]
    1 point
  2. i figured it out, got it. u helped alot thanks mate !
    1 point
  3. E super keep up the good work man! ? Jocul ala e legendar, ma faci curios de cum o sa fie varianta finala
    1 point
  4. Got it fixed! Somehow i replaced your image draw with a button for test! Also dont forget to put your picture back on client side part. Server side function desligarGeradorS( player, generatorID ) local id = getElementData(markers[generatorID], "generatorID") if id == generatorID then setElementData(markers[generatorID], "state", false) end end addEvent( "desligarGerador", true ) addEventHandler( "desligarGerador", root, desligarGeradorS ) function ligarGeradorS( player, generatorID ) local id = getElementData(markers[generatorID], "generatorID") if id == generatorID then setElementData(markers[generatorID], "state", true) end end addEvent( "ligarGerador", true ) addEventHandler( "ligarGerador", root, ligarGeradorS ) Client Side local data = {} -- or u name it the way u want local screenW, screenH = guiGetScreenSize() function AbrirGeradorM( generatorID, currentFuelLevel, fuelLevel, maxFuelLevel, state, x, y, z ) data["id"] = generatorID data["currentFuelLevel"] = currentFuelLevel data["fuelLevel"] = fuelLevel data["maxFuelLevel"] = maxFuelLevel data["state"] = state data["x"] = x data["y"] = y data["z"] = z setElementData( localPlayer, "AbrirGerador", true ) end addEvent( "AbrirGerador", true ) addEventHandler( "AbrirGerador", root, AbrirGeradorM ) addEventHandler("onClientRender", root, function() if getElementData( localPlayer, "AbrirGerador" ) == true then -- if a == 0 then -- a = 1 local generatorID = data["id"] local currentFuelLevel = data["currentFuelLevel"] local fuelLevel = data["fuelLevel"] local maxFuelLevel = data["maxFuelLevel"] if fuelLevel then -- showCursor(true,true) -- test = guiCreateButton(310, 359, 98, 50, "test", false) -- addEventHandler("onClientGUIClick",test,aaa,false) -- replace back with your picture i took here one random for testing dxDrawImage(screenW * 0.4103, screenH * 0.4401, screenW * 0.0235, screenH * 0.2734, "cube.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Combustivel:", 412, 459, 548, 491, tocolor(255, 255, 255, 255), 1.00, "default", "right", "bottom", false, false, false, false, false) --progress gasolina local imageWidth = screenW * 0.0147 local maxHeight = screenH * 0.2617 local imageHeight = maxHeight * fuelLevel / maxFuelLevel dxDrawImage(screenW * 0.4147, screenH * 0.4453 + maxHeight - imageHeight, imageWidth, imageHeight, "cube.png", 0, 0, 0, tocolor(195, 181, 32, 206), false) if data["state"] == true then r,g,b = 74, 255, 80 dxDrawText("Desligar", screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false) dxDrawImage(screenW * 0.3132, screenH * 0.6471, screenW * 0.0941, screenH * 0.0664, "cube.png", 0, 0, 0, tocolor(r, g, b, 217), false) elseif data["state"] == false then r,g,b = 147, 74, 60 dxDrawText("Ligar", screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "arial", "center", "center", false, false, false, false, false) dxDrawImage(screenW * 0.3132, screenH * 0.6471, screenW * 0.0941, screenH * 0.0664, "cube.png", 0, 0, 0, tocolor(r, g, b, 217), false) end end end end) addEventHandler( "onClientClick", root, function (button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedWorld) if button == "left" then if state == "down" then if getElementData( localPlayer, "AbrirGerador" ) == true then if isCursorOnElement(screenW * 0.3206, screenH * 0.6602, screenW * 0.3963, screenH * 0.7018) then local state = data["state"] local x = data["x"] local y = data["y"] local z = data["z"] local id = data["id"] if data["id"] and data["state"] == true then triggerServerEvent( "desligarGerador", resourceRoot, localPlayer, data["id"] ) elseif data["id"] and data["state"] == false then playSound3D( "start.mp3", x, y, z ) triggerServerEvent( "ligarGerador", resourceRoot, localPlayer, data["id"] ) end end end end end end)
    1 point
×
×
  • Create New...