local PSP = createTeam("PSP",255,0,0)
function setPlayerCywil()
if getPlayerTeam(source) ==PSP then
setPlayerTeam(source,getTeamFromName("Cywil"))
else
outputChatBox("Obecnie nie pracujesz.",source,255,0,0)
end
end
addEvent("setTeamPSP",true)
addEventHandler("setTeamPSP",root,setPlayerCywil)
Teraz to nawet zalogowa? si? nie mog?..... Chodzi mi o to ?e mam marker pokazuj? mi si? gui jak w niego wejd? i s? 2 opcj? rozpocznij i zako?cz.. Jak nacisn? rozpocznij to mnie wrzuca do PSP jak zako?cz to wrzuca mnie do cywila... Mniej wi?cej o to mi chodzi a co jest ?le to ja sam nwm ju? nie powiem czego dostaj?..
marker = createMarker ( -2297.84,-173.10,34.33, "cylinder", 1.2, 0, 0, 255, 170 )
local wm={}
sx,sy=guiGetScreenSize()
mojeW, mojeH = 1280, 1024
GUI = guiCreateWindow(0/mojeW*sx, 435/mojeH*sy, 232/mojeW*sx, 203/mojeH*sy, "Logowanie Do PSP", false)
guiWindowSetSizable(GUI, false)
guiSetVisible(GUI, false)
przycisk1 = guiCreateButton(15/mojeW*sx, 52/mojeH*sy, 205/mojeW*sx, 52/mojeH*sy, "Rozpocznij", false, GUI)
przycisk2 = guiCreateButton(15/mojeW*sx, 120/mojeH*sy, 205/mojeW*sx, 52/mojeH*sy, "Zako?cz", false, GUI)
-- pokaz gui
addEventHandler("onClientMarkerHit", marker, function(el,md)
if el~=localPlayer then return end
if not guiGetVisible(GUI) then
showCursor(true,false)
guiSetVisible(GUI,true)
end
end)
------------------------------------------------------
--schowaj gui
addEventHandler("onClientMarkerLeave", marker, function(el,md)
if el~=localPlayer then return end
if guiGetVisible(GUI) then
showCursor(false)
guiSetVisible(GUI, false)
end
end)
-------------------------------------------------------------------------------------
--logowanie
addEventHandler("onClientGUIClick", przycisk1, function()
showCursor(false)
guiSetVisible(GUI,false)
triggerServerEvent("setTeamPSP",localPlayer)
end)
-------------------------------------------------------------------------------------
--Logout
addEventHandler("onClientGUIClick", przycisk2, function()
showCursor(false)
guiSetVisible(GUI,false)
triggerServerEvent("setTeamCywil",localPlayer)
end)
Server :
local PSP = createTeam("PSP",255,0,0)
local cywile = createTeam("Cywile",255,255,255)
function setPlayerDuty()
local accName = getAccountName(getPlayerAccount(source))
if isGuestAccount(getPlayerAccount(source)) then
outputChatBox("Tylko zalogowani gracze mog? do??czy? do PSP.",source,255,0,0)
return false
end
if isObjectInACLGroup("user."..accName, aclGetGroup("PSP")) then
if PSP then
setPlayerTeam(source,PSP)
outputChatBox("Pomy?lnie zalogowano do PSP.",source)
end
else
outputChatBox("Nie nale?ysz do PSP.",source,255,0,0)
end
end
addEvent("setTeamPSP",true)
addEventHandler("setTeamPSP",root,setPlayerDuty)
function setPlayerCywil()
local teamCywil = getPlayerTeam(source)
if teamCywil == cywile then
outputChatBox("Jeste? aktualnie cywilem!",source)
return
end
if cywile then
setPlayerTeam(source,cywile)
outputChatBox("Pomy?lnie zako?czono s?u?b?.",source)
end
end
addEvent("setTeamCywil",true)
addEventHandler("setTeamCywil",root,setPlayerCywil)
[ Dodano: 2016-11-20, 23:18 ]
PS : Koledzy wy?ej , lepiej nie piszcie takich g?upot jak macie co? pisa?.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach