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

Wysłany: 2015-11-11, 15:56


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam mam problem z frakcjami gui



local frakcjamarker = createMarker(-2013.81,761.32,44.60, "cylinder", 5, 25, 111,25,25)
okno = guiCreateWindow(381, 296, 515, 144, "PANEL LOGOWANIA FRAKCJI", false)
sfpd  = guiCreateButton(9, 26, 161, 48, "SFPD", false, okno)
sfmc  = guiCreateButton(176, 26, 161, 48, "SFMC", false, okno)
sffd  = guiCreateButton(345, 26, 160, 48, "SFFD", false, okno)
wyloguj  = guiCreateButton(345, 84, 160, 47, "WYLOGUJ", false, okno)
zamknij  = guiCreateButton(10, 87, 160, 47, "ZAMKNIJ", false, okno)

guiSetVisible(sfpd, false)
guiSetVisible(sfmc, false)
guiSetVisible(sffd, false)
guiSetVisible(wyloguj, false)
guiSetVisible(zamknij, false)
guiSetVisible(okno, false)

addEventHandler("onClientGUIClick", zamknij,
 function(el, md)
    if el ~= localPlayer then return end
    if guiGetVisible(okno)  == true then
        guiSetVisible(sfpd, false)
        guiSetVisible(sfmc, false)
        guiSetVisible(sffd, false)
        guiSetVisible(wyloguj, false)
        showCursor(false) 
    end
end
)

addEventHandler('onClientMarkerHit', frakcjamarker, function()
            guiSetVisible(sffd, true)
            guiSetVisible(sfmc, true)
            guiSetVisible(sfpd, true)
            guiSetVisible(wyloguj, true)
            showCursor(true)
            guiSetVisible(zamknij, true)
            guiSetVisible(okno, true)
            
end)


function Policja ( thePlayer ) 
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Policja" ) ) then 
setPlayerTeam ( thePlayer, politeamx ) 
giveWeapon ( thePlayer, 22, 5000 ) 
setElementModel ( thePlayer, 282 ) 
setElementPosition ( thePlayer, -2014.43,780.85,45.45) 
else 
outputChatBox( "Nie jestes pracownikiem SFPD", thePlayer, 0, 100, 255, false) 
end 
end 
addEventHandler("onClientGUIClick",sfpd,Policja)

function Pogotowie ( thePlayer ) 
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Pogotowie" ) ) then 
setPlayerTeam ( thePlayer, pogoteamx )  
setElementModel ( thePlayer, 275 ) 
setElementPosition ( thePlayer, -318.97,1048.24,20.34) 
else 
outputChatBox( "Nie jestes pracownikiem SFMC", thePlayer, 0, 100, 255, false) 
end 
end 
addCommandHandler ( "loginfcmc", Pogotowie )


function Straz ( thePlayer ) 
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Straz" ) ) then 
setPlayerTeam ( thePlayer, strazteamx )  
setElementModel ( thePlayer, 277 ) 
giveWeapon ( thePlayer, 42)
setElementPosition ( thePlayer, 22.87,1370.73,9.25) 
else 
outputChatBox( "Nie jestes pracownikiem SFFD", thePlayer, 0, 100, 255, false) 
end 
end 
addCommandHandler ( "loginfcfd", Straz )

jezeli klikam w GUI ( same okno ) lub w SFPD to mam takie db
DB3 :
linijka 43 attemp to call global 'getPlayerAccount' (a nil value)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-11, 16:19


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

Funkcja ta dzia?a tylko po stronie serwera.

Postaw piwo autorowi tego posta
 

 
Tagi: funkcja :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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