Witam mam Problem ze po klknieciu comboboxa np:Pogotowie loguje do Pogotowia oto skrypt:
client:
GUIEditor_Window = {}
Z_Button = {}
ComboBox = {}
GUIEditor_Window[1] = guiCreateWindow(496,235,287,200,"Logowanie Do Teamu",false)
Z_Button[1] = guiCreateButton(26,93,232,50,"Zaloguj",false,GUIEditor_Window[1])
ComboBox[1] = guiCreateComboBox (28,31,234,200,"Wybierz Team",false,GUIEditor_Window[1])
ComboBox[2] = guiCreateComboBox (28,64,234,100, "Wybierz Stanowisko",false,GUIEditor_Window[1])
guiSetVisible(GUIEditor_Window[1], false)
teamy =
{
"Policja",
"Pogotowie",
"Salon",
"Taxi",
"Cywile"
}
Stanowisko =
{
"Rekrut",
"Pracownik",
"Vice Szef",
"Szef",
"Admin"
}
function log()
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
for k,v in ipairs(teamy) do
guiComboBoxAddItem(ComboBox[1],v)
end
for i,v in ipairs(Stanowisko) do
guiComboBoxAddItem(ComboBox[2],v)
end
end
addEvent("log",true)
addEventHandler ( "log", getRootElement(), log)
function logowanie()
local team = guiGetText(ComboBox[1])
local Stanowisko = guiGetText(ComboBox[2])
triggerServerEvent ( "Zaloguj",getLocalPlayer(),team,Stanowisko)
end
addEventHandler( "onClientGUIClick",Z_Button[1],logowanie)
server:
Policja = createTeam ( "Policja",0,0, 255 )
Salon = createTeam ( "Salon",0,255,0 )
function logs (player)
triggerClientEvent(player,"log", getRootElement())
end
addCommandHandler ("log", logs)
function Zaloguj(team,Stanowisko)
accountname = getAccountName (getPlayerAccount(source))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( team ) ) then
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( Stanowisko ) ) then
outputChatBox(" Zalogowales Sie Jako:"..team.." Na Stanowisku:"..Stanowisko,source,255,0,0)
else
outputChatBox("Nie Jestes Na Stanowisku:"..Stanowisko,source,255,0,0)
end
else
outputChatBox("Nie Pracujesz w:"..team, source,255,0,0)
end
end
addEvent( "Zaloguj",true)
addEventHandler( "Zaloguj",getRootElement(),Zaloguj)
|