addEventHandler("onClientResourceStart", resourceRoot,
function()
wnd = guiCreateWindow(458, 273, 447, 499, "Police Manager Panel | لوحة رئيس الشرطة", false)
guiWindowSetSizable(wnd, false)
guiWindowSetMovable(wnd, false)
guiSetAlpha(wnd, 1.00)
pList = guiCreateGridList(17, 25, 202, 452, false, wnd)
guiGridListAddColumn(pList, "# Players List", 0.9)
slapbtn = guiCreateButton(226, 30, 193, 36, "~# Slap #~", false, wnd)
guiSetProperty(slapbtn, "NormalTextColour", "FFFF1D1D")
desbtn = guiCreateButton(226, 76, 193, 36, "~# Destroy Car #~", false, wnd)
guiSetProperty(desbtn, "NormalTextColour", "FFFF1D1D")
gvbtn = guiCreateButton(226, 118, 193, 36, "~# Give License #~", false, wnd)
guiSetProperty(gvbtn, "NormalTextColour", "FF1BFF03")
tkbtn = guiCreateButton(226, 164, 193, 36, "~# Take License #~", false, wnd)
guiSetProperty(tkbtn, "NormalTextColour", "FFFF0202")
jailOpen = guiCreateButton(226, 215, 193, 36, "~# Jail Player #~", false, wnd)
guiSetProperty(jailOpen, "NormalTextColour", "FFFF0202")
unbtn = guiCreateButton(226, 266, 193, 36, "~# UnJail Player #~", false, wnd)
guiSetProperty(unbtn, "NormalTextColour", "FF1BFF03")
enbtn = guiCreateButton(226, 316, 193, 36, "~# English #~", false, wnd)
guiSetProperty(enbtn, "NormalTextColour", "FF02B4FF")
arbtn = guiCreateButton(226, 367, 193, 36, "~# Arabic #~", false, wnd)
guiSetProperty(arbtn, "NormalTextColour", "FF02B4FF")
Close = guiCreateButton(226, 413, 193, 36, "~# Close #~", false, wnd)
guiSetProperty(Close, "NormalTextColour", "FFFFAE01")
VersionLabel = guiCreateLabel(226, 457, 193, 15, "# Police Manager Panal | V1.5.2", false, wnd)
guiLabelSetColor(VersionLabel, 255, 82, 29)
label2 = guiCreateLabel(227, 474, 193, 15, "# Created By | Sha[D]ow & mIDO", false, wnd)
guiLabelSetColor(label2, 45, 255, 29)
guiSetVisible(wnd,false)
end
)
--------------------------------------------------------------
addEventHandler("onClientResourceStart", resourceRoot,
function()
local screenW, screenH = guiGetScreenSize()
jailWnd = guiCreateWindow((screenW - 337) / 2, (screenH - 238) / 2, 337, 238, "# Jail Information", false)
guiWindowSetMovable(jailWnd, false)
guiWindowSetSizable(jailWnd, false)
guiSetAlpha(jailWnd, 1.00)
tList = guiCreateGridList(23, 24, 140, 151, false, jailWnd)
guiGridListAddColumn(tList, "# Time", 0.9)
jList = guiCreateGridList(175, 24, 138, 152, false, jailWnd)
guiGridListAddColumn(jList, "# Places", 0.9)
jailButton = guiCreateButton(23, 186, 138, 32, "Jail Player", false, jailWnd)
guiSetProperty(jailButton, "NormalTextColour", "FFAAAAAA")
JailClose = guiCreateButton(175, 186, 138, 32, "Close", false, jailWnd)
guiSetProperty(JailClose, "NormalTextColour", "FFAAAAAA")
guiSetVisible(jailWnd,false)
end
)
--------------------------------------------------------------
bindKey ("m","down",
function ()
triggerServerEvent ("check",localPlayer)
end)
addEvent ("openWND",true)
addEventHandler ("openWND",root,
function ()
guiSetVisible(wnd,not guiGetVisible(wnd))
showCursor(guiGetVisible(wnd))
guiSetInputEnabled (guiGetVisible(wnd))
end
)
--------------------------------------------------------------
addEventHandler("onClientGUIClick",resourceRoot, function ( )
if ( source == jailOpen ) then
guiSetVisible(wnd,false)
guiSetVisible(jailWnd,true)
end
end
)
--------------------------------------------------------------
addEventHandler("onClientGUIClick",resourceRoot, function ( )
if ( source == JailClose ) then
guiSetVisible(jailWnd,false)
guiSetInputEnabled (false)
showCursor(false)
end
end
)
--------------------------------------------------------------
addEventHandler("onClientGUIClick",resourceRoot, function ( )
if ( source == Close ) then
guiSetVisible(wnd,false)
guiSetInputEnabled (false)
showCursor(false)
end
end
)
--------------------------------------------------------------
function update ()
guiGridListClear(pList)
for i,v in ipairs (getElementsByType("player")) do
local rp = guiGridListAddRow (pList)
guiGridListSetItemText (pList,rp,1,getPlayerName(v),false,false)
end
end
addEventHandler ("onClientResourceStart",resourceRoot,update)
addEventHandler ("onClientPlayerJoin",root,update)
addEventHandler ("onClientPlayerChangeNick",root,update)
addEventHandler ("onClientPlayerQuit",root,update)
--------------------------------------------------------------
--------------------------------------------------------------
addEventHandler("onClientGUIClick",root,
function ( )
local sel = guiGridListGetSelectedItem( pList )
if source == tkbtn and sel ~= -1 then
local plr = guiGridListGetItemText(pList ,sel,1)
local myPlayer = getPlayerFromName ( plr )
triggerServerEvent ("takecar", localPlayer, myPlayer)
end
end
end
)