BlackIN Posted July 1, 2011 Share Posted July 1, 2011 local g_screenX,g_screenY = guiGetScreenSize() local ghostState = "off" addEvent("setGhostModeState", true) addEventHandler("setGhostModeState", getRootElement(), function(state) ghostState = state end ) function ghostState() outlinesize = 1 if ghostState == "off" then if outlinesize > 0 then for offsetX = - outlinesize, outlinesize, outlinesize do for offsetY = - outlinesize, outlinesize, outlinesize do drawColor("#000000Ghostmode: OFF", (350/800*sx)+offsetX, (50/600)*sy+offsetY, sx, sy, tocolor(0,0,0,255), (sx/800)*0.5, "bankgothic") end end end drawColor("#FFFFFFGhostmode: #FF0000OFF", (350/800*sx), (50/600*sy), sx, sy, tocolor(0, 0, 0, 255), (sx/800)*0.5, "bankgothic") elseif ghostState == "on" then if outlinesize > 0 then for offsetX = - outlinesize, outlinesize, outlinesize do for offsetY = - outlinesize, outlinesize, outlinesize do drawColor("#000000Ghostmode: ON", (350/800*sx)+offsetX, (50/600*sy)+offsetY, sx, sy, tocolor(0,0,0,255), (sx/800)*0.5, "bankgothic") end end end drawColor("#FFFFFFGhostmode: #38FF06ON", (350/800*sx), (50/600)*sy, sx, sy, tocolor(0, 0, 0, 255), (sx/800)*0.5, "bankgothic") elseif ghostState == "none" then end end addEventHandler("onClientRender", getRootElement(), ghostState) function drawColor(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end In meta <script src="ghostmode_display.lua" type="server"/> <script src="ghostmode_display.lua" type="client"/> i've used both ....... when i run this script in server side then a message show's can't get local g_screenX,g_screenY = guiGetScreenSize() Link to comment
Castillo Posted July 1, 2011 Share Posted July 1, 2011 Because these are client-only functions, events. Link to comment
BlackIN Posted July 1, 2011 Author Share Posted July 1, 2011 Because these are client-only functions, events. Not work's with Client Link to comment
qaisjp Posted July 1, 2011 Share Posted July 1, 2011 Also, who do you expect we are? Are we your servants? "Fix it": "Sure I'm your servant and if it's your order so I will fix it". Say PLEASE atleast -.- Link to comment
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