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

Wysłany: 2017-07-15, 15:20


MicHaLeQZ







Wiek: 37
Na forum: 3595 dni
Posty: 5
Nick w MP: RussianDoge



Respekt: 50

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(0343130213"Rozpocz?cie pracy"false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 1.00)
        guiSetProperty(GUIEditor.window[1], "CaptionColour""FF0101FC")

        GUIEditor.button[1] = guiCreateButton(181539550"Rozpocz?cie pracy"falseGUIEditor.window[1])    
    end
 
local marker=createMarker(2327.132535.241027.81'cylinder'1.5050255,255)
setElementInterior(marker0)

local licz = {}
local t=createElement('text')
setElementData(t,'name','San Andreas Police Department\n Praca Policjanta')
setElementInterior(t0)
setElementPosition(t,2327.132535.241027.81)

local Panel guiCreateWindow(565271336207"Rozpocz?cie pracy"false)
      guiWindowSetSizable(Panelfalse)
   
local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel
end

      guiWindowSetSizable(Paneltrue)
     guiSetVisible (Paneltrue)
     showCursor (true)
end
addEventHandler ("onClientMarkerHit"markeropen_panel)

function Close_panel (thePlayer)
      guiWindowSetSizable(panelfalse)
     guiSetVisible (panel2false)
     showCursor (false)
end
addEventHandler ("onClientMarkerLeave"markerClose_panel)

----------------------------
function isPlayerInPoliceFaction(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;'"SAPD"uid)
 if result[1then
  return true
 else
  return false
 end

 addEventHandler('onMarkerHit'marker, function(el,md)
 if isPlayerInPoliceFaction(elthen
 if getElementData(hitElement,"player:duty") == "SAPD" then
  if not getElementData(el,'player:duty'then
   setElementModel(el,280)
 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,22,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",""))
 executeCommandHandler("setblipcolor",el,0,0,205)
  else
   takeWeapon(el,23)
   takeWeapon(el,22)
 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)

 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

local bronie2 createMarker (-1612.94695.8513.90-0.90"cylinder"1.0000255 )
setElementDimension(bronie20)
setElementInterior(bronie20)
local t=createElement("text")
setElementData(t,"name""WYPOSA?ENIE\nSAPD\nOBOWI?ZKOWE")
setElementPosition(t,-1612.94695.8513.90-0.5)
setElementDimension(t0)
setElementInterior(t0)

end
  end
[color=yellow][/color]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 15:23


BoCzKu

Mapper & Lua






Wiek: 24
Na forum: 3465 dni
Posty: 87
Nick w MP: BoKu

Piwa: 331

Respekt: 135
Respekt: 135

Jakie? b??dy z DB3 ?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 15:46


Szymczu

Programista bo tak






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

Piwa: 36

Respekt: 120
Respekt: 120

Stawiasz za du?o end'?w :P


GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart"resourceRoot, function()
        GUIEditor.window[1] = guiCreateWindow(0343130213"Rozpocz?cie pracy"false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 1.00)
        guiSetProperty(GUIEditor.window[1], "CaptionColour""FF0101FC")
        GUIEditor.button[1] = guiCreateButton(181539550"Rozpocz?cie pracy"falseGUIEditor.window[1])    
end)
 
local marker=createMarker(2327.132535.241027.81'cylinder'1.5050255,255)
setElementInterior(marker0)
local licz = {}
local t=createElement('text')
setElementData(t,'name','San Andreas Police Department\n Praca Policjanta')
setElementInterior(t0)
setElementPosition(t,2327.132535.241027.81)
local Panel guiCreateWindow(565271336207"Rozpocz?cie pracy"false)
    guiWindowSetSizable(Panelfalse)   
local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel
    guiWindowSetSizable(Paneltrue)
    guiSetVisible (Paneltrue)
    showCursor (true)
end
addEventHandler ("onClientMarkerHit"markeropen_panel)

function Close_panel (thePlayer)
     guiWindowSetSizable(panelfalse)
     guiSetVisible (panel2false)
     showCursor (false)
end
addEventHandler ("onClientMarkerLeave"markerClose_panel)

----------------------------
function isPlayerInPoliceFaction(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;'"SAPD"uid)
    if result[1then return true
    else return false
    end
    addEventHandler('onMarkerHit'marker, function(el,md)
        if isPlayerInPoliceFaction(elthen
            if getElementData(hitElement,"player:duty") == "SAPD" then
                if not getElementData(el,'player:duty'then
                    setElementModel(el,280)
                    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,22,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",""))
                    executeCommandHandler("setblipcolor",el,0,0,205)
                else
                    takeWeapon(el,23)
                    takeWeapon(el,22)
                    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)

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


local bronie2 createMarker (-1612.94695.8513.90-0.90"cylinder"1.0000255 )
setElementDimension(bronie20)
setElementInterior(bronie20)
local t=createElement("text")
setElementData(t,"name""WYPOSA?ENIE\nSAPD\nOBOWI?ZKOWE")
setElementPosition(t,-1612.94695.8513.90-0.5)
setElementDimension(t0)
setElementInterior(t0)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 15:49


BoCzKu

Mapper & Lua






Wiek: 24
Na forum: 3465 dni
Posty: 87
Nick w MP: BoKu

Piwa: 331

Respekt: 135
Respekt: 135

W linijce 27 jest te? b??d...

Zamie?
 local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel 


Na
 local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel


Niby ma?y b??d, lecz chwilka nie uwagi i skrypt le?y ;D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 17:21


MicHaLeQZ







Wiek: 37
Na forum: 3595 dni
Posty: 5
Nick w MP: RussianDoge



Respekt: 50

"BoCzKu" napisał/a:

W linijce 27 jest te? b??d...

Zamie?
 local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel 


Na
 local panel2 guiCreateButton(93113767"Rozpocz?cie\npracy"falsePanel


Niby ma?y b??d, lecz chwilka nie uwagi i skrypt le?y ;D


Tylo ten kod mia? za zadanie otwiera? GUI do rozpoczynania pracy we frakcji SAPD. Prosze o poprawienie kodu aby dzia?a? w ten spos?b.
Za pomoc przy tym kodzie daje Respekt oraz stawiam zimne :piwo: :mrgreen: :mrgreen:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 19:15


BoCzKu

Mapper & Lua






Wiek: 24
Na forum: 3465 dni
Posty: 87
Nick w MP: BoKu

Piwa: 331

Respekt: 135
Respekt: 135

To ponawiam pytanie, Jakie? b??dy w DB3?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-15, 19:17


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

MicHaLeQZ, dodaj warunek, kt?ry sprawdza czy policjant jest wpisany w frakcji w evencie on marker hit

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działające :: gui :: prosze :: poprawienie :: kodu
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