Hello everyone.
Can anyone help me with this? I want to make the 2 functions to execute, only when the player who uses it is an admin in the acl.
function duty()
local name = getPlayerName(getLocalPlayer())
local sound = playSound ("files/sound.mp3")
setSoundVolume (sound,0.5)
panel = guiCreateStaticImage(432, 566, 447, 172, "files/bg.png", false)
text = guiCreateLabel(443, 713, 426, 15, name.. " is now on adminduty!", false)
guiSetFont(text, "default-bold-small")
guiLabelSetColor(text, 252, 229, 230)
guiLabelSetHorizontalAlign(text, "center", false)
setTimer ( function() --Időzítőt beállítja//
guiSetVisible (panel, false) --Panel láthatatlan//
guiSetVisible (text, false) --text láthatatlan//
end, 5000, 1 ) --5000=5 mp//
end
function offduty()
local name = getPlayerName(getLocalPlayer())
local sound = playSound ("files/sound.mp3")
setSoundVolume (sound,0.5)
panel = guiCreateStaticImage(432, 566, 447, 172, "files/bg.png", false)
text = guiCreateLabel(443, 713, 426, 15, name.. " is now off adminduty!", false)
guiSetFont(text, "default-bold-small")
guiLabelSetColor(text, 252, 229, 230)
guiLabelSetHorizontalAlign(text, "center", false)
setTimer ( function()
guiSetVisible (panel, false)
guiSetVisible (text, false)
end, 5000, 1 )
end
addCommandHandler ("aduty", duty)
addCommandHandler ("offduty", offduty)
Thanks if anyone can help me.