sckatchof Posted March 6, 2012 Share Posted March 6, 2012 hi guys i have problem it this script when i die it not show Client side : function HospitalLS() local screenWidth, screenHeight = guiGetScreenSize() local SW,Sh = guiGetScreenSize( ) local rootElement = getRootElement() local x,y = guiGetScreenSize() dxDrawRectangle ( x/3.3, y/1.59, x/3.5, y/7, tocolor( 0,0,0,250 ) ) dxDrawText("Hospitals Ls",Sw/3, Sh/1.57, Sw, Sh,tocolor(0,255,255,185),0.7,"bankgothic","left","top",false,false,false) dxDrawText("you will respawn after 5 seconds",Sw/3, Sh/1.47, Sw, nSh,tocolor(255,255,0,255),0.55,"bankgothic","left","top",false,false,false) end function Hospitalrespawn () addEventHandler("onClientRender",root,HospitalLS) end end addEventHandler( "onClientPlayerWasted",root,Hospitalrespawn ) Link to comment
Kenix Posted March 6, 2012 Share Posted March 6, 2012 Learn lua viewtopic.php?f=91&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction You have syntax errors in each scripts. Link to comment
sckatchof Posted March 6, 2012 Author Share Posted March 6, 2012 Learn lua viewtopic.php?f=91&t=40809 https://wiki.multitheftauto.com/wiki/Scr ... troduction You have syntax errors in each scripts. i have fix it but it show when i restart my script i want when i die it show local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() function respawnLS () dxDrawRectangle ( x/3.3, y/1.59, x/3.5, y/7, tocolor( 0,0,0,250 ) ) dxDrawText("Hospitals Ls",Sw/3, Sh/1.57, Sw, Sh,tocolor(0,255,255,185),0.7,"bankgothic","left","top",false,false,false) dxDrawText("you will respawn after 5 seconds",Sw/3, Sh/1.47, Sw, nSh,tocolor(255,255,0,255),0.55,"bankgothic","left","top",false,false,false)) end addEventHandler("onClientRender", rootElement, respawnLS) Link to comment
Kenix Posted March 6, 2012 Share Posted March 6, 2012 Again syntax error. in 8 line you create 2 )) And you use not define variables x,y,Sw,Sh Link to comment
sckatchof Posted March 6, 2012 Author Share Posted March 6, 2012 Again syntax error.in 8 line you create 2 )) And you use not define variables x,y,Sw,Sh Fixed again local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() function helpText () dxDrawRectangle (((screenWidth/2)-200), (screenHeight-80), 400, 80, tocolor( 0, 0, 0, 150 )) dxDrawText ("/kill when you are buged", 0, 0, screenWidth, screenHeight-40, tocolor (255, 255, 255, 255), 0.7, 'bankgothic', "center", "bottom", false, false, false ) dxDrawText ("dont ask admin for password!", 0, 0, screenWidth, screenHeight-20, tocolor (255, 255, 255, 255), 0.7, 'bankgothic', "center", "bottom", false, false, false ) end addEventHandler("onClientRender", rootElement, helpText) Link to comment
Kenix Posted March 6, 2012 Share Posted March 6, 2012 So it work? Can you tabulate your code? Link to comment
sckatchof Posted March 6, 2012 Author Share Posted March 6, 2012 So it work?Can you tabulate your code? Yes it work when i restart script but what i want when i die it show for 5 second Link to comment
Kenix Posted March 6, 2012 Share Posted March 6, 2012 local screenWidth, screenHeight = guiGetScreenSize( ) local bShow, uTimer function helpText ( ) if bShow then dxDrawRectangle ( ( ( screenWidth / 2 )-200 ), ( screenHeight - 80 ), 400, 80, tocolor( 0, 0, 0, 150 ) ) dxDrawText ( "/kill when you are buged", 0, 0, screenWidth, screenHeight - 40, tocolor ( 255, 255, 255, 255 ), 0.7, 'bankgothic', "center", "bottom", false, false, false ) dxDrawText ( "dont ask admin for password!", 0, 0, screenWidth, screenHeight - 20, tocolor ( 255, 255, 255, 255 ), 0.7, 'bankgothic', "center", "bottom", false, false, false ) end end addEventHandler( "onClientRender", root, helpText ) addEventHandler( 'onClientPlayerWasted', root, function( ) bShow = true if isTimer( uTimer ) then killTimer( uTimer ) end uTimer = setTimer( function( ) bShow = false end, 5000, 1 ) end ) Updated. Link to comment
sckatchof Posted March 6, 2012 Author Share Posted March 6, 2012 work thaaank you Keniiiix for help 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