Jump to content

MTA:SA OnClientWasted


Extinction

Recommended Posts

function NameEvent2() 
                addEventHandler("onClientRender", root, spawnMenu) 
                openMe() 
                setElementHealth(source,100) 
end 
addEventHandler("onClientPlayerWasted", root, NameEvent2) 

If I die once it opens, but if I die again, it doesnt open again.

Link to comment
function spawnMenu() 
        dxDrawRectangle(x*44, y*272, x*315, y*282, tocolor(0, 0, 0, 173), false) 
        dxDrawRectangle(x*44, y*244, x*315, y*28, tocolor(150, 0, 0, 173), false) 
         local r,g,c 
            if isMouseInPosition(x*54, y*453, x*111, y*40) then  
            r,g,c = 150, 0, 0 
            else 
            r,g,c = 87, 0, 0 
            end     
        dxDrawRectangle(x*54, y*453, x*111, y*40, tocolor(r, g, c, 173), false) 
                 local r,g,c 
            if isMouseInPosition(x*238, y*453, x*111, y*40) then  
            r,g,c = 150, 0, 0 
            else 
            r,g,c = 87, 0, 0 
            end    
        dxDrawRectangle(x*238, y*453, x*111, y*40, tocolor(r,g,c, 173), false) 
                        local r,g,c 
            if isMouseInPosition(x*54, y*502, x*295, y*34) then  
            r,g,c = 150, 0, 0 
            else 
            r,g,c = 87, 0, 0 
            end   
        dxDrawRectangle(x*54, y*502, x*295, y*34, tocolor(r,g,c, 173), false) 
        dxDrawText("SPAWN", x*53, x*502, y*349, y*536, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
        dxDrawText("<", x*54, y*453, x*165, y*492, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, false, false, false) 
        dxDrawText(">", x*238, y*453, x*349, y*492, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, false, false, false)    
end 
  
function openMe() 
  
showCursor ( true ) 
  
setCameraMatrix (154.35172, -1939.35498, 4.2, 159.35172, -2400.35498, 3.77344) 
spawnPed = createPed ( 29, 154.39813, -1943.67480, 3.77344, 360 ) 
setElementFrozen ( spawnPed, true ) 
  
spawnBtn = guiCreateLabel(x*53, x*502, y*349, y*536, "", false)  
leftBtn = guiCreateLabel(x*54, y*453, x*111, y*40, "", false)  
rightBtn = guiCreateLabel(x*238, y*453, x*111, y*40, "", false)  
  
addEventHandler("onClientRender", getRootElement(), spawnMenu) 
end 
addEvent("showSpawn:true",true) 
addEventHandler("showSpawn:true", getRootElement(), openMe) 
  

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