Jump to content

[Help] Errors


Lachuks

Recommended Posts

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:

 

8rbEHOSbQSmNkGT0sDo0wg.png 409 line = 21 line

Edited by Emix
Link to comment
  • Moderators
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)

  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...