Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-02-25, 17:01


ShaonicPL







Wiek: 29
Na forum: 4207 dni
Posty: 25
Nick w MP: ShaonicPL



Respekt: 50

Witam
Mam problem gdy? chcia?bym aby okno z wyborem dru?yny wyskakiwa?o dopiero po zalogowaniu, a nie zakrywa?o panelu logowania. Za pomoc leci piwko.
Kod:
Kod:

addEventHandler("onClientResourceStart",resourceRoot,
function()
dm_window = guiCreateWindow(0.1556,0.1597,0.5575,0.4144,"",true)
grove_button = guiCreateButton(125,108,100,100,"Grove Street",false,dm_window)
police_button = guiCreateButton(225,108,100,100,"Policja",false,dm_window)
rifa_button = guiCreateButton(325,108,100,100,"Rifa",false,dm_window)
blood_button = guiCreateButton(25,108,100,100,"Bloods",false,dm_window)
teams_label = guiCreateLabel(50,33,70,25,"Druzyny",false,dm_window)
showCursor(true)
end
)

function openguiwindow ()
thePlayer = getLocalPlayer()
guiSetVisible(dm_window, true)
showCursor(true)
end
addEvent("opengui1window", true)
addEventHandler("opengui1window", getRootElement(), openguiwindow)
addCommandHandler("changeteam", openguiwindow)

function grovego (state)
if state == "left" then
if source == grove_button then
guiSetVisible(dm_window, false)
thePlayer = getLocalPlayer()
showCursor(false)
triggerServerEvent("grove", getLocalPlayer(), thePlayer, grove)
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), grovego)

function gotopolice (state)
if state == "left" then
if source == police_button then
guiSetVisible(dm_window, false)
showCursor(false)
thePlayer = getLocalPlayer()
triggerServerEvent("police", getLocalPlayer(), thePlayer, police)
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), gotopolice)


function gotorifa (state)
if state == "left" then
if source == rifa_button then
guiSetVisible(dm_window, false)
showCursor(false)
thePlayer = getLocalPlayer()
triggerServerEvent("rifa", getLocalPlayer(), thePlayer, rifa)
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), gotorifa)

function gotoblood (state)
if state == "left" then
if source == blood_button then
guiSetVisible(dm_window, false)
showCursor(false)
thePlayer = getLocalPlayer()
triggerServerEvent("blood", getLocalPlayer(), thePlayer, blood)
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), gotoblood)

function onSpawnFirstTime()
triggerClientEvent(source,"onLogin",source,firstTime)
end
addEventHandler("onPlayerLogin",root,onSpawnFirstTime)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-25, 17:36


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Po stronie serwera piszesz event, kt?ry b?dzie triggerowa? event na stron? klienta z otwarciem okna wyboru dru?yny po zalogowaniu.

Więcej informacji znajdziesz w Wikipedii MTA:

onPlayerLogin


Więcej informacji znajdziesz w Wikipedii MTA:

triggerClientEvent


Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: okno :: zalogowaniu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Okno po zalogowaniu Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku