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

Wysłany: 2017-07-23, 18:30


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4044 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

addEvent("join"true)
addEventHandler("join"getRootElement(), function()
if isPlayerInPoliceFaction(elthen
  if not getElementData(el,'player:duty'then
   setElementModel(el,71)
   --setPlayerNametagColor(el,0,0,255)
    exports['frakcja']:rozpocznijnaliczanie(el)
   setElementData(el,'player:duty','SAPD')
    local rank exports['frakcja']:getPlayerFactionRank(el,'SAPD')
    setElementData(el,"player:rank",rank)
    giveWeapon(el,23,9999)
    giveWeapon(el,32,9999)
    setElementData(el,"last:nick",getPlayerName(el))
    setElementData(el,"last:color",tostring(getPlayerNametagColor(el)))
    setPlayerName(el,"#0000CD"..getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
    --setPlayerNametagColor(el,0,191,255)
    executeCommandHandler("setblipcolor",el,0,0,205)
  else
   takeWeapon(el,23)
   takeWeapon(el,32)
    exports['frakcja']:zatrzymajnaliczanie(el)
   setElementData(el'player:duty'false)
    setElementData(el,"player:rank",false)
   local skin=getElementData(el,"player:skin")
   setElementModel(elskin)
   setPlayerName(el,getElementData(el,"last:nick"))
    executeCommandHandler("setblipcolor",el,255,255,255)
  end
 else
  outputChatBox('* Nie jeste? zatrudniony jako SAPD.'el25500)
 end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-07-23, 18:55


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

okej tyle ze to frakcja psp ;) juz sprawdzam i zdaje raport

[ Dodano: 2017-07-23, 19:03 ]
wchodze w marker i nic sie nie wyswietla

[ Dodano: 2017-07-23, 19:15 ]
sluchajcie zrobilem tak strone clienta :


local screenWscreenH guiGetScreenSize()
we guiCreateButton(54445414343"Wejd? na s?u?b?"false)
ze guiCreateButton(82145514742"Zejd? ze s?u?by"false)
wy guiCreateButton(68451013733"Zamknij"false)  

guiSetVisible(wefalse)
guiSetProperty(we"NormalTextColour""FFAAAAAA"guiSetVisible(zefalse)
guiSetProperty(ze"NormalTextColour""FFAAAAAA"guiSetVisible(wyfalse)
guiSetProperty(wy"NormalTextColour""FFAAAAAA"addEvent("showPlayerGui"trueaddEventHandler("showPlayerGui"getRootElement(), function() 
    guiSetVisible(wetrue)
    addEventHandler("onClientRender"getRootElement(), drawPanel) 
    showCursor(trueend)  

addEvent("showPlayerGui"trueaddEventHandler("showPlayerGui"getRootElement(), function() 
    guiSetVisible(zetrue)
    addEventHandler("onClientRender"getRootElement(), drawPanel) 
    showCursor(trueend)  

addEvent("showPlayerGui"trueaddEventHandler("showPlayerGui"getRootElement(), function() 
    guiSetVisible(wytrue)
    addEventHandler("onClientRender"getRootElement(), drawPanel) 
    showCursor(trueend)  





function drawPanel() 
       dxDrawImage(320357763288":frakcja-psp/tlofrakcji.png"000tocolor(255255255255), false)
        dxDrawImage(424432125113":syrenkapsp/logo2.png"000tocolor(255255255255), false)
        dxDrawText("Frakcja Pa?stwowa Stra? Po?arna"4093791001422tocolor(2542929255), 1.50"pricedown""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Designed & Created by KilusTv"833532986539tocolor(255255255255), 0.90"arial""left""top"falsefalsefalsefalsefalse)
                
end 

addEventHandler("onClientGUIClick"root, function()
    if source == we then
        guiSetVisible(wefalse) 
        removeEventHandler("onClientRender"getRootElement(), drawPanel) 
        showCursor(false)
        setElementData(localPlayer,"player:duty"false)
        triggerServerEvent("join"localPlayer)
    elseif source == wy then
        guiSetVisible(wefalse) 
        removeEventHandler("onClientRender"getRootElement(), drawPanel) 
        showCursor(false) 
    elseif source == ze then
        guiSetVisible(zefalse) 
        removeEventHandler("onClientRender"getRootElement(), drawPanel) 
        showCursor(false)
        triggerServerEvent("join"localPlayer)
    end
endfalse


a tak strone servera:





function isPlayerInFaction(plr)
    local uid=getElementData(plr,'player:uid')
    if not uid then return end

    local result=exports['ogrpg-db']:dbGet('SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;'"PSP"uid)
    if result[1then
        return true
    else
        return false
    end
end
local licz = {}

marker createMarker(1090.60,2376.77,10"cylinder"1000170addEventHandler("onMarkerHit"marker, function(he) 
    triggerClientEvent(he"showPlayerGui"he)
end)

    
addEvent("join"true)
addEventHandler("join"getRootElement(), function()
    if isPlayerInFaction(elthen
        if getElementData(he"player:duty"then 
            setElementModel(el,201)
            setPlayerNametagColor(el,0,0,255)
            exports['frakcja']:rozpocznijnaliczanie(el)
            setElementData(el,'player:duty','PSP')
            local rank exports['frakcja']:getPlayerFactionRank(el,'PSP')
            setElementData(el,"player:rank",rank)
            giveWeapon(el,42,9999)
        else
            exports['frakcja']:zatrzymajnaliczanie(el)
            takeWeapon(el,42)
            removeElementData(el'player:duty')
            removeElementData(el,"player:rank")
            local skin=getElementData(el,"player:skin")
            setElementModel(elskin)
        end
    else
        outputChatBox('Nie jeste? pracownikiem frakcji PSP.'el25500)
    end
end)

function naliczanie(el)
    if isElement(elthen
   local x getElementData(el,"player:workinjob") or 0
   setElementData(el,"player:workinjob",x+1)
   else
    if isTimer(licz[el]) then
    killTimer(licz[el])
    licz[el] = nil
    end
   end
end






Sprawa wyglada nastepujaco. Po wejsciu w marker pojawia sie moje gui jednak zaden guzik nie dziala. Klikam kazdy i nic sie nie dzieje. Moze cos po c-side jest zle.

[ Dodano: 2017-07-24, 17:19 ]
to pomoze ktos? prosze ;c Oczywiscie zaraz wszystkim piwko i respekt dam. Niech ktos odpowie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-25, 21:41


Szymczu

Programista bo tak






Wiek: 27
Na forum: 3434 dni
Posty: 194
Nick w MP: Szymczu

Piwa: 36

Respekt: 120
Respekt: 120

Usu? false na ko?cu zdarzenia "onClientGUIClick".

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-07-25, 22:12


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

nie dziala :( dobra starczy tego spamu. Poprobuje sb sam. I tak mi juz wiele pomogliscie. Stawiam wszystkim browca i respekta. Mozna zamknac

Postaw piwo autorowi tego posta
 

 
Tagi: gui :: wchodzenie :: sluzbe
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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