Jump to content

question about window


Chaos

Recommended Posts

  
function gui()  
triggerServerEvent ("checkforadmins", getLocalPlayer())  
end  
bindKey ("F2", "down", gui)  
  
  
  
    addEvent ( "ok", true ) 
    addEventHandler ( "ok", getRootElement(), 
        function () 
        if (guiGetVisible (okno) == false) then  
guiSetVisible(okno, true)  
showCursor(true)  
else  
guiSetVisible(okno, false)  
showCursor(false)  
end  
end 
) 
  
  

why the window will show for all players when some one press f2 i need it appear for one player only

Link to comment

addEvent ( "checkforadmins", true )

addEventHandler ( "checkforadmins", getRootElement(),

function ()

local accName = getAccountName ( getPlayerAccount ( source ) )

if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then

triggerClientEvent ("ok", source)

end

end

)

Link to comment
  
GUIEditor = {  
button = {},  
window = {},  
label = {}  
}  
addEventHandler("onClientResourceStart", resourceRoot,  
function()  
okno = guiCreateWindow(553, 303, 494, 466, "Admin Panel by Chaos", false)  
guiWindowSetSizable(okno, false)  
guiWindowSetMovable(okno, false)  
guiSetVisible(okno, false)  
  
  
szeryf = guiCreateButton(181, 109, 126, 65, "Give Me Minigun", false, okno)  
guiSetProperty(szeryf, "NormalTextColour", "FFAAAAAA")  
lekarz = guiCreateButton(180, 199, 127, 68, "Full Health", false, okno)  
guiSetProperty(lekarz, "NormalTextColour", "FFAAAAAA")  
robotnik = guiCreateButton(182, 293, 125, 67, "Clear The Main Chat", false, okno)  
guiSetProperty(robotnik, "NormalTextColour", "FFAAAAAA")  
strazak = guiCreateButton(325, 109, 133, 65, "Give me infernus", false, okno)  
guiSetProperty(strazak, "NormalTextColour", "FFAAAAAA")  
mechanik = guiCreateButton(326, 201, 132, 66, "Nitro", false, okno)  
guiSetProperty(mechanik, "NormalTextColour", "FFAAAAAA")  
pilot = guiCreateButton(325, 293, 133, 67, "Fix My Vehicle", false, okno)  
guiSetProperty(pilot, "NormalTextColour", "FFAAAAAA")  
  
  
  
addEventHandler ( "onClientGUIClick", lekarz, lekarzz) 
addEventHandler ( "onClientGUIClick", strazak, strazakk) 
addEventHandler ( "onClientGUIClick", szeryf, szeryff)  
addEventHandler ( "onClientGUIClick", pilot, pilott)  
addEventHandler ( "onClientGUIClick", mechanik, mechanikk) 
addEventHandler ( "onClientGUIClick", robotnik, robotnikk) 
end  
)  
  
  
function gui()  
triggerServerEvent ("checkforadmins", getLocalPlayer())  
end  
bindKey ("F2", "down", gui)  
  
  
  
    addEvent ( "ok", true ) 
    addEventHandler ( "ok", getRootElement(), 
        function () 
        if (guiGetVisible (okno) == false) then  
guiSetVisible(okno, true)  
showCursor(true)  
else  
guiSetVisible(okno, false)  
showCursor(false)  
end  
end 
) 
  

Link to comment
addEventHandler ( "onClientGUIClick", lekarz, lekarzz) 
addEventHandler ( "onClientGUIClick", strazak, strazakk) 
addEventHandler ( "onClientGUIClick", szeryf, szeryff) 
addEventHandler ( "onClientGUIClick", pilot, pilott) 
addEventHandler ( "onClientGUIClick", mechanik, mechanikk) 
addEventHandler ( "onClientGUIClick", robotnik, robotnikk) 

You forgot about the "getPropagated" argument.

addEventHandler ( "onClientGUIClick", lekarz, lekarzz, false) 
addEventHandler ( "onClientGUIClick", strazak, strazakk, false) 
addEventHandler ( "onClientGUIClick", szeryf, szeryff, false) 
addEventHandler ( "onClientGUIClick", pilot, pilott, false) 
addEventHandler ( "onClientGUIClick", mechanik, mechanikk, false) 
addEventHandler ( "onClientGUIClick", robotnik, robotnikk, false) 

Link to comment

Thanks mate I want to add another button called unlimited health but the problem is when I press it all will have unlimited health

  
  
function stopMinigunDamage (  )      
        cancelEvent() --cancel the event   
  end 
 addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) 
  
  
  

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