
Karuzo
Members-
Posts
1,213 -
Joined
-
Last visited
Everything posted by Karuzo
-
Just put the local in front of blipD away and it should work.
-
What ? That doesn't even makes sense.
-
What ? That doesn't even makes sense.
-
Bad argument @ getPedOccupiedVehicle . Why ? local veh = getPedOccupiedVehicle(source)
-
https://wiki.multitheftauto.com/wiki/Math.round I think that should do that. Just like : x = 55,54545455 math.round(x, 2)
-
[url=https://wiki.multitheftauto.com/wiki/OnClientPlayerWasted]https://wiki.multitheftauto.com/wiki/On ... ayerWasted[/url] I think that's what you're lookin for.
-
Thank you Wei, it works, it shows now the Image. But if i wanna turn on the engine it doesn't work. and i get this error : Code: function motor_func() local veh = getPedOccupiedVehicle(source) if veh then setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) else setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) end end function light_func() local veh = getPedOccupiedVehicle(source) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function (player, seat) if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) local enginestate = getElementData(source,"engine") if not enginestate then setElementData(source,"engine",false) triggerClientEvent(player,"OnMotor", player) enginestate = false end if enginestate == false then setVehicleEngineState(source,false) triggerClientEvent("OffMotor", player) end bindKey(player,"l","down",light_func) bindKey(player,"x","down",motor_func) end end) addEventHandler("onVehicleExit",getRootElement(),function (player, seat) if seat == 0 then unbindKey(player,"l","down",light_func) unbindKey(player,"x","down",motor_func) triggerClientEvent("CloseMotor", player) end end)
-
Oh , haha missed that completely. But it still doesn't work if i use local player = source. function motor_func () local player = source local veh = getPedOccupiedVehicle(player) if veh then setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) else setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) end end function light_func () local player = source local veh = getPedOccupiedVehicle(player) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function (seat) local player = source if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) local enginestate = getElementData(source,"engine") if not enginestate then setElementData(source,"engine",false) triggerClientEvent("OnMotor", player) enginestate = false end if enginestate == false then setVehicleEngineState(source,false) triggerClientEvent("OffMotor", player) end bindKey(player,"l","down",light_func,player) bindKey(player,"x","down",motor_func,player) end end) addEventHandler("onVehicleExit",getRootElement(),function (seat) local player = source if seat == 0 then unbindKey(player,"l","down",light_func,player) unbindKey(player,"x","down",motor_func,player) end end)
-
Hey Guys, so i have a problem with my engine-script. If i press 'X' it should show the engine_on.png if the engine is on, and engine_off if the engine is off. But that doesn't really work. Hope you could help me. Code: Server: function motor_func ( player) local veh = getPedOccupiedVehicle(player) local veh1 = getPedOccupiedVehicle(player) if veh then setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) else setVehicleEngineState(veh,not getVehicleEngineState(veh)) setElementData(veh,"engine",not getElementData(veh,"engine")) end end function light_func ( player) local veh = getPedOccupiedVehicle(player) if veh then if getVehicleOverrideLights(veh) ~= 2 then setVehicleOverrideLights(veh,2) else setVehicleOverrideLights(veh,1) end end end addEventHandler("onVehicleEnter",getRootElement(),function ( player,seat) if seat == 0 then outputChatBox("Starte den Motor mit 'X' und die Lichter mit 'L'",player,0,125,0) local enginestate = getElementData(source,"engine") if not enginestate then setElementData(source,"engine",false) triggerClientEvent("OnMotor", source) enginestate = false end if enginestate == false then setVehicleEngineState(source,false) triggerClientEvent("OffMotor", source) end bindKey(player,"l","down",light_func,player) bindKey(player,"x","down",motor_func,player) end end) addEventHandler("onVehicleExit",getRootElement(),function ( player,seat) if seat == 0 then unbindKey(player,"l","down",light_func,player) unbindKey(player,"x","down",motor_func,player) end end) Client: function MotorOn() Motor = guiCreateStaticImage(X1,Y1, Width1, Height1,"data/engine_on", false) end addEvent("OnMotor", true) addEventHandler("OnMotor", root, MotorOn) function MotorOff() guiStaticImageLoadImage(Motor, "data/engine_off") end addEvent("OffMotor", true) addEventHandler("OffMotor", root, MotorOff)
-
I think he wants that the register login shows the player just one time, and the one times is , is the first join.
-
What? Why should he open a register window everytime a player joins?
-
I know, i've changed all Thank you . But could you help me with the blur?
-
Hmm i don't think that this would help me, what shaders could help me here?
-
ok, got it . just forgotted to remove the guiSetVisible's Thank you guys! Just another question: Is there a function to make everything blurry but not the GUI ? Didn't found smth like that.
-
local sWidth,sHeight = guiGetScreenSize() local Width,Height = 300,451 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) Ok thank you gonna make that . The problem is : I can press the buttons, but i don't see them.
-
Oh Sorry, forgetted that completely: This is how it looks now, and this is my code at this moment : Login_wnd=guiCreateStaticImage(X, Y, Width,Height, "login/images/login_wnd.png",false) guiSetVisible(Login_wnd, false) guiMoveToBack(Login_wnd) Loginbtn = guiCreateStaticImage(X+5, Y+300, 290, 65, "login/images/login_btn.png", false,Login_wnd) guiSetVisible(Loginbtn, false) Regbtn = guiCreateStaticImage(X+5, Y+370, 290, 65, "login/images/reg_btn.png", false,Login_wnd) guiSetVisible(Regbtn, false) Eyebtn = guiCreateStaticImage(X+262, Y+245, 32,32, "login/images/eye_btn.png", false,Login_wnd) guiSetVisible(Eyebtn, false) Logo = guiCreateStaticImage(X+65, Y, 179, 62, "login/images/logo_h.png" , false,Login_wnd) guiSetVisible(Logo, false) Username_edit = guiCreateEdit(X+10, Y+130, 250, 50, "", false,Login_wnd) guiEditSetMaxLength(Username_edit, 25) guiSetVisible(Username_edit,false) guiEditSetReadOnly(Username_edit, true) Passwort_edit = guiCreateEdit(X+10,Y+235, 250, 50, "", false,Login_wnd) guiEditSetMasked(Passwort_edit, true) guiEditSetMaxLength(Passwort_edit, 25) guiSetVisible(Passwort_edit,false) --didn't wrote the full code, cause it's useless. function OpenLogin() exports.gie:guiAddInterpolateEffect(Login_wnd, X, Y-150, 0, 0,X, Y, Width,Height,2, "InElastic", "OutElastic", true) playername = string.gsub ( getPlayerName ( player ), '#%x%x%x%x%x%x', '' ) guiSetText(Username_edit, playername) showPlayerHudComponent("all", false) setCameraMatrix(1291,-1208,94, 1503,-1453,63, 0, 70) showCursor(true) guiSetVisible(Regbtn, true) guiSetVisible(Eyebtn, true) guiSetVisible(Logo, true) guiSetVisible(Loginbtn, true) guiSetVisible(Passwort_edit, true) guiSetVisible(Username_edit,true) end addEventHandler("onClientResourceStart", resourceRoot, OpenLogin) @Ciber: tried that, didn't worked.
-
No, it's a GUI Static Image
-
Hey guys, i have a small problem, i'm usin' GUI interpolate effects, just to try out, ok. So what's the problem ? If i let my Login-Panel open, the Login_wnd shows up, but the buttons and so on are at the back, so I just can see the Login_Wnd , but i want to see the buttons. Tried with guiBringtoFront, but didn't worked. Here's the part which matters: function OpenLogin() exports.gie:guiAddInterpolateEffect(Login_wnd, X, Y-150, 0, 0,X, Y, Width,Height,2, "InElastic", "OutElastic", true) playername = string.gsub ( getPlayerName ( player ), '#%x%x%x%x%x%x', '' ) guiSetText(Username_edit, playername) showPlayerHudComponent("all", false) setCameraMatrix(1291,-1208,94, 1503,-1453,63, 0, 70) showCursor(true) guiSetVisible(Regbtn, true) guiSetVisible(Eyebtn, true) guiSetVisible(Logo, true) guiSetVisible(Loginbtn, true) guiSetVisible(Passwort_edit, true) guiSetVisible(Username_edit,true) guiBringToFront(Eyebtn) guiBringToFront(Passwort_edit) guiBringToFront(Loginbtn) guiBringToFront(Logo) guiBringToFront(Regbtn) end addEventHandler("onClientResourceStart", resourceRoot, OpenLogin)
-
Please show us your code.
-
Where did you defined taker? Which button did you used?
-
#push
-
Which button ? And what does dbgscript 3 say ? - Please be more specific. I don't understand why you are using .txt's to set the text of an memo, why won't you just set the text normal ?
-
Well i used playersO to show the players which are currently playing in the server as you can see in this line : dxDrawText(playersO.."/50" ,X+525, Y-15, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) Nah, not really , i just have a "rectangel" and the bar where the Names , Teams ,etc.. stand so it's easier for me . So lets get back to the problem : As you can see it stops at Player37 and i can't scroll anymore , why ? here's my code : local gRoot = getRootElement() local sWidth,sHeight = guiGetScreenSize() local Width,Height = 549,412 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) local playerheight = 20 --Better to be here as it's a constant local nbLinesToDraw = 20 -- the number of lines that will be drawn at the same time local offset = 0 local fakelist = {} for k=1, 40 do table.insert(fakelist, "Player"..k) end playersO = #getElementsByType ( "player" ) function offsetplus() if offset >= (#fakelist)-nbLinesToDraw then return end offset = offset + 1 end function offsetneg() if offset <= 0 then return end --Top Position offset = offset - 1 end local currentMoney = 0 addEventHandler ( "onClientRender", root, function ( ) local money = getPlayerMoney ( ) if ( currentMoney ~= money ) then outputChatBox ( money ) setElementData ( localPlayer, "playerMoney", money ) currentMoney = money end end) function Scoreboard() dxDrawImage(X,Y,Width,Height, "/images/back.png") dxDrawImage(X, Y, 549, 42,"/images/bar.png") dxDrawText("Name", X+60, Y+10, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(playersO.."/50" ,X+525, Y-15, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Ping", X+480, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Geld", X+210, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Fraktion", X+350, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) --local players = getElementsByType ( "player" ) local players = fakelist -- uncomment only for testing local line = 0 --the current line number - 1 for k, player in pairs(players) do -- we will draw if we are at the right offset AND if we still didn't draw [nbLinesToDraw] lines (here 20) if k > offset and line <= nbLinesToDraw then --local ping = getPlayerPing(player) local ping = 67 -- uncomment only for testing --local teamp = getPlayerTeam(player) local teamp = nil -- uncomment only for testing local teamn = "Keine" if teamp then teamn = getTeamName(teamp) end --local money = tonumber ( getElementData(player, "playerMoney") ) or 0 local money = 500-- uncomment only for testing if (ping >= 250) then r,g,b = 255,0,0 elseif (ping >= 120) then r,g,b = 255,69,0 else r,g,b = 0,255,0 end local tmpY = Y+60+playerheight*line if tmpY > Y and tmpY < Y+400 then --dxDrawText(getPlayerName( player ), X+60, tmpY, Width,Height, tocolor(255,255,255), 1 , "default-bold","left", "top",false, false,true,true) dxDrawText(player, X+60, tmpY, Width,Height, tocolor(255,255,255), 1 , "default-bold","left", "top",false, false,true,true) dxDrawText(ping, X+480, tmpY, Width, Height, tocolor(r,g,b), 1, "default","left", "top",false,false,true,true) dxDrawText(tostring( money ).." $", X+210, tmpY, Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) dxDrawText(teamn, X+350, tmpY, Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) end line = line + 1 end end end function Zeit() local hours = getRealTime().hour local minutes = getRealTime().minute local seconds = getRealTime().second dxDrawText(hours..":"..minutes..":"..seconds, X-325, Y+525, Width, Height, tocolor(255,255,255), 1, "default-bold","left", "top",false, false,true,true) end addEventHandler("onClientRender", gRoot, Zeit) function open() opened = not opened if opened == true then bindKey("mouse_wheel_down", "down", offsetplus) bindKey("mouse_wheel_up", "down", offsetneg) addEventHandler("onClientRender", gRoot, Scoreboard) showChat(false) showPlayerHudComponent("all", false) removeEventHandler("onClientRender", gRoot, Zeit) else offset = 0 unbindKey("mouse_wheel_down", "down", offsetplus) unbindKey("mouse_wheel_up", "down", offsetneg) removeEventHandler("onClientRender", gRoot, Scoreboard) showPlayerHudComponent("all", true) showChat(true) addEventHandler("onClientRender", gRoot, Zeit) end end bindKey("tab","both",open)
-
Doesn't work , debugscript says nothin