Matevsz
Members-
Posts
197 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Matevsz
-
How to do that when you drive a car in the marker appeared in the name of the car gridlist column? InfoCar = createMarker(-2052.3999023438, 170.5, 27.799999237061, "cylinder", 4, 255, 0, 0, 0) carsPanel = guiCreateWindow(10, (screenH - 372) / 2, 836, 372, "Car", false) gridList = guiCreateGridList(10, 29, 669, 287, false, carsPanel) column1 = guiGridListAddColumn(gridList, "Model", 0.3) row = guiGridListAddRow(gridList) nameCar = guiGridListSetItemText(gridList, 0, 1, "-", false, false)
-
Okay. Thanks. You could still help me with the object / Scroll Bar / and lifting? guiScrollBarSetScrollPosition(scroll, 0) Scroll is set to 0. X, Y, Z, X1, Y2, Z2, Object: min. = -2052.5, 170.3, 27.5, 0, 0, 90 max. = -2052.5, 170.3, 27.1, 0, 0, 90 Now how to lift up an object using scrollBar?
-
Because, I don't like markers. Can you give me an example of how to use colshapes?
-
Hi, after entering the marker does not show the gui. marker = createMarker(-2050.5, 167.39999, 27.9, "cylinder", 1, 255, 0, 0, 0) local screenW, screenH = guiGetScreenSize() function GUI() window = guiCreateWindow(10, (screenH - 372) / 2, 836, 372, "GUI", false) guiWindowSetSizable(window, false) closeButton = guiCreateButton(413, 328, 187, 34, "Close", false, window) addEventHandler("onClientMarkerHit", marker, function() guiSetVisible(window, true) showCursor(true) end) addEventHandler("onClientGUIClick", closeButton, function() guiSetVisible(window, false) showCursor(false) end) end
-
Hello, how to make more players in the train? For example 20? This is a script for MultiSeat but I do not know how to get the cords of players..
-
Hello, how to make moving the camera to the Login Panel of positions: X=-2680.3693847656 Y=1297.5594482422 Z=93.396697998047 LX=-2680.3747558594 LY=1298.5538330078 LZ=93.291488647461
-
on a normal server for colleagues (so far) *maybe even an entry in the xml file
-
Hello I am looking for a tutorial to the login panel, where it is shown step by step how to do it Thanks
-
local LoadOxygen = createPickup(-1890.1999511719, 2145.1000976563, 1.7999999523163, 3, 2690, 2000) local clothes = createPickup(-1886.7001953125, 2142.7001953125, 1.7999999523163, 3, 1275, 2000) function DiverJob(hitElement) local skin = getElementModel(localPlayer) if skin == 97 then local CurrentSkin = getElementData(localPlayer, "CurrentSkin") setElementModel(localPlayer, CurrentSkin) outputChatBox("Finished working diver.", localplayer) else setElementData(localPlayer, "CurrentSkin", skin, false) setElementModel(localPlayer, 97) outputChatBox("I started working diver", localplayer) end end addEventHandler("onClientPickupHit", clothes, DiverJob) setTimer(function() for k,v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 and isElementInWater(v) then return end local oxygen = getPedOxygenLevel(v) if isElementInWater(v) then setPedOxygenLevel(v, oxygen-1) end end end, 300000, 1) addEventHandler("onClientPickupHit", LoadOxygen, function(element) for k, v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 and not isElementInWater(v) then return end if element ~= localPlayer then return end setPedOxygenLevel(v, 100) end end ) This is my full code. After entering the water do not take oxygen every 4 minutes
-
LoadOxygen = createPickup(-1890.1999511719, 2145.1000976563, 1.7999999523163, 3, 2690, 2000) setTimer(function() for k, v in ipairs (getElementsByType("player")) do if getElementModel(v) ~= 97 or not isElementInWater(v) then return end local oxygen = getPedOxygenLevel(v) if isElementInWater(v) then setPedOxygenLevel(v, oxygen-1) end end end, 400000, 1) addEventHandler("onClientPickupHit", LoadOxygen, function(element) for k, v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 and not isElementInWater(v) then return end if element ~= localPlayer then return end setPedOxygenLevel(v, 100) end end ) unfortunately, after 4 minutes, do not want to subtract oxygen
-
Hi, I want to do a slow subtraction of oxygen in the water every 4 minutes, and when we enter the pickup is charged oxygen to the full LoadOxygen = createPickup(-1890.1999511719, 2145.1000976563, 1.7999999523163, 3, 2690, 2000) setTimer( function() for k,v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 or not isElementInWater(v) then return end local oxygen = getPedOxygenLevel(v) if isElementInWater(v) then setPedOxygenLevel(v, oxygen-1) end end end, 60000*4, 1) addEventHandler("onClientPickupHit", LoadOxygen, function(element) for k, v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 and not isElementInWater(v) then return end if element ~= getLocalPlayer() then return end setPedOxygenLevel(v, 100) end end )
-
Hello, help someone to make mileage to this dxDrawText? addEventHandler("onClientRender", root, function() dxDrawRectangle(820, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawRectangle(839, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawRectangle(858, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawRectangle(877, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawRectangle(896, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawRectangle(915, 951, 15, 20, tocolor(255, 255, 255, 255), true) dxDrawText("0", 822, 947, 839, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("1", 841, 947, 858, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("2", 860, 947, 877, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("3", 879, 947, 896, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("4", 898, 947, 915, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("5", 915, 947, 932, 971, tocolor(0, 0, 0, 255), 1.90, "default-bold", "left", "top", false, false, true, false, false) end )
-
local money = string.format("%.2f", getPlayerMoney(getLocalPlayer())) dxDrawText("$"..money.."", 1455, 53, 1478, 86, tocolor(255, 255, 255, 255), 1.50, "pricedown", "left", "top", false, false, false, false, false) See $0.00 Now add the rest of the digits "0"? Gui Editor:
-
I would like to x6 ordinary money and pennies together x2 (.00) = $000000.00 and only a pittance without dividing into $000,000,000
-
Edit: See $0 and add player money see $54,454,454 and how to do so after the entry could be seen as: I have to enter a zero in dxDrawText?
-
See $$0 And error in db3: attempt to compare string with number
-
You see $ 000000000, and how to make $000000.00?
-
Hi, I created hud money with pennies. After loading shows $00.00 instead of $000000.00 function HudMoney() local money = string.format("%.2f", getPlayerMoney(getLocalPlayer())) dxDrawText("$"..money.."", 1455, 53, 1478, 86, tocolor(255, 255, 255, 255), 1.50, "pricedown", "left", "top", false, false, false, false, false) end And after entering 25.50, gives us the same 25 whether it is a bad string.format?
-
'm writing a script on the lights for the car under the "lshift." When he squeezed it appears gui and light but let 'lshift "is the lights go out. Is is well positioned triggerServerEvent? Client: function LightsCar() local car = getPedOccupiedVehicle(localPlayer) triggerServerEvent("lights", localPlayer) if car then if getVehicleOverrideLights(car) ~= 2 then guiSetVisible(Lights, true) guiSetVisible(LightsOff, true) guiSetVisible(menu, false) else guiSetVisible(Lights, false) guiSetVisible(LightsOff], false) guiSetVisible(menu, true) guiSetVisible(button, false) end end end bindKey("lshift", "both", LightsCar) Server: addEvent("lights", true) addEventHandler("lights", root, function() local car = getPedOccupiedVehicle(source) if car then if getVehicleOverrideLights(car) ~= 2 then setVehicleOverrideLights(car, 2) else setVehicleOverrideLights(car, 1) end end end)
-
Hi, i create x6 image and x6 button. After pressing "lshift" shows 6 photos and now I would like to show one of the first button to the photo by pressing the arrow "arrow_u" and "arrow_d". function carLights(value) local car = getPedOccupiedVehicle(localPlayer) if car and getVehicleController(car) == localPlayer then if value == true then guiSetVisible(photos, true) elseif value == false then guiSetVisible(photos, false) end end end bindKey("lshift", "both", function(key,state) if state == "down" then carLights(true) elseif state == "up" then carLights(false) end end) addEventHandler("onClientGUIClick", photos, function() local car = getPedOccupiedVehicle(localPlayer) if car then if getVehicleOverrideLights(car) ~= 2 then guiSetVisible(button1, true) guiSetVisible(lights, false) bindKey("arrow_u", "up", button1) bindKey("arrow_d", "down", button1) else guiSetVisible(button1, false) guiSetVisible(lights, true) unbindKey("arrow_u", "up", button1) unbindKey("arrow_d", "down", button1) end end end) what we could be wrong?
-
g_root = getRootElement() g_rootElement = getResourceRootElement( getThisResource() ) g_Player = getLocalPlayer() c_EnableScaling = true -- --> These values will be scaled with screen size -- Offsets from the lower right screen corner c_XOffset = 10 c_YOffset = 10 c_ImageW = 200 c_ImageH = 200 c_BarW = 0 c_BarH = 0 c_BarYOffset = 70 -- <-- -- All other values are fixed c_FireTimeMs = 5000 c_BarAlpha = 120 c_BarFlashInterval = 300 g_tFireStart = nil function drawNeedle() if not isPedInVehicle(g_Player) then -- Fallback for player exiting car without onClientVehicleStartExit event -- (e.g. falling off a bike) hideSpeedometer() end local vehSpeed = getVehicleSpeed() --local vehHealth = getElementHealth(source,getPedOccupiedVehicle(g_Player)) if vehHealth and (vehHealth > 0) then -- Show a little red/green health bar on the speedo local hp = (vehHealth-250)/750 local curBarLen = hp*g_BarW if curBarLen < 1 then curBarLen = 1 end -- green/yellow till 50%, then yellow/red local r = 255*(1 - hp)/0.5 if r > 255 then r = 255 end local g = 255*hp/0.5 if g > 255 then g = 255 end if g < 0 then g = 0 end if hp >= 0 then g_tFireStart = nil dxDrawRectangle(x + g_ImageW/2 - g_BarW/2, y + g_BarYOffset, curBarLen, g_BarH, tocolor(r, g, 0, c_BarAlpha)) else -- Flash red bar for 5s when car is about to blow if not g_tFireStart then g_tFireStart = getTickCount() end local firePerc = (c_FireTimeMs - (getTickCount() - g_tFireStart)) / c_FireTimeMs if firePerc < 0 then firePerc = 0 end local a = c_BarAlpha if (getTickCount()/c_BarFlashInterval)%2 > 1 then a = 0 end dxDrawRectangle(x + g_ImageW/2 - g_BarW/2, y + g_BarYOffset, firePerc*g_BarW, g_BarH, tocolor(255, 0, 0, a)) end end -- Draw rotated needle image -- Image is scaled exactly 1° per kmh of speed, so we can use vehSpeed directly dxDrawImage(x, y, g_ImageW, g_ImageH, "needle.png", vehSpeed -130, 0, 0, white, true) end function showSpeedometer() guiSetVisible(disc, true) addEventHandler("onClientRender", g_root, drawNeedle) end function hideSpeedometer() guiSetVisible( disc, false) removeEventHandler("onClientRender", g_root, drawNeedle) end function getVehicleSpeed() if isPedInVehicle(g_Player) then local vx, vy, vz = getElementVelocity(getPedOccupiedVehicle(g_Player)) return math.sqrt(vx^2 + vy^2 + vz^2) * 161 end return 0 end addEventHandler("onClientVehicleEnter", g_root, function(thePlayer) if thePlayer == g_Player then showSpeedometer() end end ) addEventHandler("onClientVehicleStartExit", g_root, function(thePlayer) if thePlayer == g_Player then hideSpeedometer() end end ) function round(num) return math.floor(num + 0.3) end function initGui() if disc then destroyElement(disc) end g_screenWidth, g_screenHeight = guiGetScreenSize() local scale if c_EnableScaling then scale = (g_screenWidth/1000 + g_screenHeight/850)/2 else scale = 1 end g_XOffset = round(c_XOffset*scale) g_YOffset = round(c_YOffset*scale) g_ImageW = round(c_ImageW*scale) g_ImageH = round(c_ImageH*scale) g_BarW = round(c_BarW*scale) g_BarH = round(c_BarH*scale) g_BarYOffset = round(c_BarYOffset*scale) disc = guiCreateStaticImage(g_screenWidth - g_ImageW - g_XOffset, g_screenHeight - g_ImageH - g_YOffset, g_ImageW, g_ImageH, "disc.png", false) x, y = guiGetPosition(disc, false) end addEventHandler("onClientResourceStart", g_rootElement, function () initGui() guiSetVisible(disc, false) setTimer(function() local w, h = guiGetScreenSize() if (w ~= g_screenWidth) or (h ~= g_screenHeight) then initGui() end end, 500, 0) if isPedInVehicle(g_Player) then showSpeedometer() end end ) Here is the entire code I changed to: c_XOffset = 0 c_YOffset = 0 but still it is on the right