Jump to content

need help when i spawn


Recommended Posts

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

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
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
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

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...