Lachuks Posted June 18, 2017 Posted June 18, 2017 (edited) Hello! I have error witch I don't know how to fix. I hope you can help me. Code: Spoiler local screenWidth, screenHeight = guiGetScreenSize() local newbieShow = false local newbieHead = "-" local newbieText = "-" local newbiePosition = 0,0,0 function setNewbieInfo (show,head,text,element) newbieShow = show newbieHead = head newbieText = text newbiePosition = element end addEventHandler("onClientRender", getRootElement(), function() if newbieShow == false then return end local ax,ay,az = getElementPosition(newbiePosition) local x,y = getScreenFromWorldPosition (ax,ay,az) local length = dxGetTextWidth(newbieText,1,"default-bold") dxDrawRectangle ( x-length/2-screenWidth*0.01,y, screenWidth*0.02+length, screenHeight*0.1, tocolor (33,33,33,100) ) dxDrawingColorText(newbieHead,x-length/2-screenWidth*0.01,y, x+length/2+screenWidth*0.01, y+screenHeight*0.03, tocolor(22,255,22,120),0.5, 1.1, "default-bold", "center", "center") dxDrawingColorText(newbieText,x-length/2-screenWidth*0.01,y+screenHeight*0.03, x+length/2+screenWidth*0.01, y+screenHeight*0.07, tocolor(255,255,255,120),0.5, 1, "default-bold", "center", "center") end ) Error: 409 line = 21 line Edited June 18, 2017 by Emix
Moderators IIYAMA Posted June 18, 2017 Moderators Posted June 18, 2017 if x and y then -- code where you use x and y end Let me remind you that this section is for learning scripting and not for repairing scripts from the community. (if you are not a scripter) 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now