-
Posts
65 -
Joined
-
Last visited
Everything posted by TRtam
-
Pues puedes hacerlo así: local sX, sY = guiGetScreenSize() local width, height = sX*(150/1336), sY*(200/768) dxDrawRectangle(sX/2-width/2, sY/2-height/2, width, height, tocolor(...))
-
Jaja, de nada. Yo antes tambien pensaba en hacer calculos con getTickCount, pero un dia conoci los poderes del math.min y math.max :'v
-
Aqui te dejo un ejemplo bastante sencillo: function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end local sizeY = 10 addEventHandler("onClientRender",root, function() if isMouseInPosition(100,200, 200,sizeY) do -- Si el mouse esta en esa posicion entonces se agrandara sizeY = math.min(sizeY + 5, 50) else -- Si esta fuera se achicara sizeY = math.max(sizeY - 5, 10) end dxDrawRectangle(100,200, 200,sizeY, tocolor(255,157,0)) end )
-
Es por la usefull dxDrawProgressBar, cambia esa por esta: function dxDrawProgressBar(posX,posY, sizeX,sizeY, progress,progressmax, color,backColor) local progress = progress or 0 local max_progress = progressmax or 0 local color = color or tocolor(0,255,255,255) local back_color = backColor or tocolor(0,0,0,200) dxDrawRectangle(posX,posY, sizeX,sizeY, back_color) dxDrawRectangle(posX+1,posY+1, (sizeX-2/max_progress)*progress,sizeY-2, color) end Y en la función en donde renderizas el dxDrawProgressBar pone esto: dxDrawProgressBar( x/2.7, y/1.23, x/4, y/25, progress,ExpSystem, tocolor( 0, 255, 255, 255), tocolor( 255, 255, 255, 55) )
-
Cambia esto: dxDrawProgressBar( x/2.7, y/1.23, x/4, y/25, (ExpSystem/progress)*100 , tocolor( 0, 255, 255, 255), tocolor( 255, 255, 255, 55) ) Por esto: dxDrawProgressBar( x/2.7, y/1.23, x/4, y/25, ((x/4)/ExpSystem)*progress , tocolor( 0, 255, 255, 255), tocolor( 255, 255, 255, 55) )
-
Por alguna razon no me deja editar mi otra reply asi que lo dejo aqui. Gracias Gaberiel me habia olvidado de eso texto = {"Text", "Text2", "Text3"} local randomtext = "" addEventHandler("onClientVehicleEnter",root, function() randomtext = texto[math.random(1, #texto)] addEventHandler("onClientRender",root, drawve) end ) addEventHandler("onClientVehicleExit",root, function() removeEventHandler("onClientRender",root, drawve) end ) function drawve() local screenW,screenH = guiGetScreenSize() dxDrawText("Carga Actual: "..randomtext, (screenW * 0.3050) - 1, (screenH * 0.7844) - 1, (screenW * 0.6913) - 1, (screenH * 0.8900) - 1, tocolor(255, 255, 0, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) end
-
Esto deberia servir texto = {"Text", "Text2", "Text3"} local randomtext = "" addEventHandler("onClientVehicleEnter",root, function() randomtext = texto[math.random(1, #texto)] addEventHandler("onClientRender",root, drawve) end ) function drawve() local screenW,screenH = guiGetScreenSize() dxDrawText("Carga Actual: "..randomtext, (screenW * 0.3050) - 1, (screenH * 0.7844) - 1, (screenW * 0.6913) - 1, (screenH * 0.8900) - 1, tocolor(255, 255, 0, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) end
-
¿En qué lista? Si quieres hacer un panel de clanes y obtener los players que hay en cada clan puedes usar getPlayersInTeam
-
Something like this? function drawWindow(title, x,y, width,height) dxDrawRectangle(x,y, width,height, tocolor(0,0,0, 180)) dxDrawRectangle(x,y, width,24, tocolor(75,2,130, 254)) dxDrawLine(x,y, x+width,y, nil, 1) dxDrawLine(x,y, x,y+height, nil, 1) dxDrawLine(x+width,y, x+width,y+height, nil, 1) dxDrawLine(x,y+height, x+width,y+height, nil, 1) dxDrawLine(x,y+24, x+width,y+24, nil, 1) dxDrawText(title, x-1,y-1, x+width, y+24, tocolor(0,0,0), 1, 'default-bold', 'center','center') dxDrawText(title, x+3,y+3, x+width, y+24, tocolor(0,0,0), 1, 'default-bold', 'center','center') dxDrawText(title, x+1,y+1, x+width, y+24, nil, 1, 'default-bold', 'center','center') dxDrawText('X', x-1,y-1, x+width-1, y+24, tocolor(0,0,0), 1, 'bankgothic', 'right','center') dxDrawText('X', x+3,y+3, x+width-1, y+24, tocolor(0,0,0), 1, 'bankgothic', 'right','center') dxDrawText('X', x+1,y+1, x+width-1, y+24, nil, 1, 'bankgothic', 'right','center') end
-
Here: local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function drawVehicleHUD() local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) if ( vehicle ) then --local speedX, speedY, speedZ = getElementVelocity ( vehicle ) --local actualSpeed = (speedX^2 + speedY^2 + speedZ^2)^(0.5) --local KMH = math.floor(actualSpeed*180) health = getElementHealth(vehicle) health = (math.max(0,health-250)/750)*100 dxDrawRectangle(1079*sW, 578*sH, 191*sW, 17*sH, tocolor(0, 0, 0, 180), true) dxDrawRectangle(1084*sW, 583*sH, 181*sW, 17*sH, tocolor(0, 0, 0, 80), true) dxDrawRectangle(1084*sW, 583*sH, 181*sW/100*math.floor(health), 10*sH, tocolor(8, 252, 104, 255), true) --dxDrawText("HEALTH", 1084*sW, 683*sH, 1265*sW, 700*sH, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) --dxDrawRectangle(1079*sW, 646*sH, 191*sW, 27*sH, tocolor(0, 0, 0, 180), true) --dxDrawText(KMH.." KM/H", 1084*sW, 651*sH, 1265*sW, 668*sH, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(math.floor(health).."%", 1203*sW, 1020*sH, 1260*sW, 270*sH, tocolor(0, 255, 0, 255), 1.00, "default-bold", "center", "center", false, false, true, true, false) end end addEventHandler("onClientRender", root, drawVehicleHUD)
-
Para eso busca en la carpeta del Race un archivo .lua que se llama util_client, busca la funcion msToTimeStr(), en el return saca la parte ..centiseconds y listo.
-
Job basic(? : --<<< Important function startRe() --<<< The marker truckMr = createMarker(-709, 963, 12, "cylinder", 2) --<<< The blip truckBp = createBlip(-709, 963, 12, 51, 1) --<<< The event addEventHandler("onMarkerHit", truckMr, startMn) end addEventHandler("onResourceStart", getRootElement(), startRe) --<<< The Mision function startMn(hitElement) if getElementType(hitElement) == 'player' then --<<< Create the Truck truckM = createVehicle(514, -715, 963, 12) --<<< Attach the Trailer to the Vehicle setTimer(function() trailer = createVehicle ( 435, 0, 0, 4 ) -- create a trailer attachTrailerToVehicle ( truckM, trailer ) -- attach them end, 50, 1) --<<< Destroy the Marker of the Mission destroyElement(truckMr) outputChatBox("Go to the Waypoint") --<<< Create the Waypoint and the Marker BpMissionEnd = createBlip(-725, 874, 14, 41) MrMissionEnd = createMarker(-725, 874, 14, "cylinder") --<<< Create the event to finish the mission addEventHandler("onMarkerHit", MrMissionEnd, endMn) end end --<<< The end of the Mission function endMn(hitElement) if getElementType(hitElement) == 'player' then outputChatBox("You finished the Mission! Congratulations!") --<<< Destroy the other Markers and the Vehicle destroyElement(MrMissionEnd) destroyElement(BpMissionEnd) destroyElement(trailer) destroyElement(truckM) --<<< Give the money givePlayerMoney(hitElement, 1000) end end
-
I do not speak English so you will not be able to explain why it does not work but I'll let this have already arranged for you to see. myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit(hitElement) if getElementType(hitElement) == "player" then showCursor(true) main = guiCreateWindow(0.35, 0.35, 0.29, 0.31, "Trucking", true) guiWindowSetMovable(main, false) guiWindowSetSizable(main, false) guiSetAlpha(main, 0.73) guiSetProperty(main, "CaptionColour", "FFFFFEFE") acceptBtn = guiCreateButton(0.39, 0.38, 0.22, 0.05, "Accept Legal Load", true, main) acceptBtn2 = guiCreateButton(0.39, 0.44, 0.22, 0.05, "Accept Illegal Load", true, main) cancelBtn = guiCreateButton(0.40, 0.50, 0.21, 0.07, "Cancel", true, main) guiSetProperty(cancelBtn, "NormalTextColour", "FFC30000") addEventHandler("onClientGUIClick", cancelBtn, closeMain) memo = guiCreateMemo(0.39, 0.58, 0.23, 0.07, "Trucking Job is new, it may have bugs. If you find any please report.", true, main) guiMemoSetReadOnly(memo, true) end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) function closeMain() guiSetVisible (main, not guiGetVisible ( main ) ) showCursor(false) end
-
Try this. myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit(hitElement) if getElementType(hitElement) == "player" then main = guiCreateWindow(0.35, 0.35, 0.29, 0.31, "Trucking", true) guiWindowSetMovable(main, false) guiWindowSetSizable(main, false) guiSetAlpha(main, 0.73) guiSetProperty(main, "CaptionColour", "FFFFFEFE") acceptBtn = guiCreateButton(0.39, 0.38, 0.22, 0.05, "Accept Legal Load", true) acceptBtn2 = guiCreateButton(0.39, 0.44, 0.22, 0.05, "Accept Illegal Load", true) cancelBtn = guiCreateButton(0.40, 0.50, 0.21, 0.07, "Cancel", true) guiSetProperty(cancelBtn, "NormalTextColour", "FFC30000") memo = guiCreateMemo(0.39, 0.58, 0.23, 0.07, "Trucking Job is new, it may have bugs. If you find any please report.", true) guiMemoSetReadOnly(memo, true) end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )
