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

Wysłany: 2017-07-22, 16:17


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

Mam problem poniewa? jak gracz wejdzie na serwer to pojawia si? mu gui
https://zapodaj.net/5cf4b6bed36ed.png.html

Server


function refreshgui(element)
    local uid=getElementData(element,"player:uid")
    if not uid then return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=?"uid)
    triggerClientEvent(element"org:refresh"resourceRootresult)
end

addEvent("org:check"true)
addEventHandler("org:check"resourceRoot, function(id,name)
    -- Pobieramy UID gracza
    local uid=getElementData(client,"player:uid")
    if not uid then return end
    -- Sprawdzamy czy jest jeszcze w?‚a?›cicielem
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?"iduid)
    if #result < 0 then 
        outputChatBox("* Nie jeste?&#8250; w?&#8218;a?&#8250;cicielem pojazdu."client25500)
        return
    end
    local org getElementData(client,"player:organization")
    if not org then outputChatBox("Nie jeste?&#8250; w frakcji!",client,255,0,0) return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND parking=0"idorg)
    if #result > 0 then 
        outputChatBox("* Pojazd nie jest w przechowalni!."client25500)
        return
    end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?"iduid)
    if #result > 0 then 
        if result[1].ownedGroup ~= "0" then 
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=0 WHERE id=? AND ownedPlayer=?"iduid)
            outputChatBox("* Zmieni?&#8218;e?&#8250; pojazdowi "..name.."("..id..") przypis na siebie"client)
            refreshgui(client)
            return
        end
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=? WHERE id=? AND ownedPlayer=?"orgiduid)
    if query then
        outputChatBox("* Zmieni?&#8218;e?&#8250; pojazdowi "..name.."("..id..") przypis na frakcje"client)
        refreshgui(client)
    end
    end
end)

addEvent("org:download"true)
addEventHandler("org:download"resourceRootrefreshgui)

Client

local marker=createMarker(358.26,185.35,1008.38-0.9"cylinder"1255255255155)
setElementInterior(marker3)

local screenWscreenH guiGetScreenSize()
panelorga false

function PanelUrzad49() 
local AlphaAlpha2 interpolateBetween(0002551800, ((getTickCount() - tickorga) / 2500), "Linear"dxDrawImage(screenW 0.0743screenH 0.0804screenW 0.9400screenH 0.8352":ogrpg-core/okn.png"000tocolor(000Alpha2), false)
dxDrawText("PRZEPISYWANIE POJAZDOW NA ORGANIZACJE!"screenW 0.1038screenH 0.2702screenW 0.9625screenH 0.1500tocolor(255,0,0), 3.00"default""center""center"falsefalsefalsefalsefalse)        
end

local wmor={}
wmor.window=guiCreateStaticImage(0.120.0370.840.9":ogrpg-core/okn1.png"true)
guiSetVisible(wmor.windowfalse)
wmor.label=guiCreateLabel(0.020.190.960.05"Z ponizszej listy wybierz pojazd ktory chesz przepisac na organizacje a nastepnie kliknij przycisk Przepisz/Wypisz"truewmor.window)
guiLabelSetHorizontalAlign(wmor.label"center"false)
guiLabelSetVerticalAlign(wmor.label"center")
wmor.gridlist=guiCreateGridList(0.250.230.530.5truewmor.window)
guiGridListAddColumn(wmor.gridlist"ID"0.2)
guiGridListAddColumn(wmor.gridlist"Nazwa"0.5)
guiGridListAddColumn(wmor.gridlist"Organizacja"0.5)
wmor.submit=guiCreateButton(0.040.740.270.11"Przepisz / Wypisz"truewmor.window)
wmor.close=guiCreateButton(0.680.740.280.11"Zamknij Panel"truewmor.window)

addEventHandler("onClientGUIClick"root, function(btn,state)
    if source == wmor.submit then
        local selectedRow=guiGridListGetSelectedItem(wmor.gridlist)
        if selectedRow 0 then return end
        local id=tostring(guiGridListGetItemText(wmor.gridlistselectedRow1))
        local name=tostring(guiGridListGetItemText(wmor.gridlistselectedRow2))
        triggerServerEvent("org:check"resourceRootidname)
    end
    if source == wmor.close then
        if guiGetVisible(wmor.window) == true then
            showCursor(false)
              removeEventHandler("onClientRender",root,PanelUrzad49)
            panelorga false
            guiSetVisible(wmor.windowfalse)
        end
    end
end)
 
addEvent("org:refresh"true)
addEventHandler("org:refresh"resourceRoot, function(result)
    guiGridListClear(wmor.gridlist)
    for i,v in pairs(result) do
        if string.len(v.plateText) < 1 then v.plateText="Brak" end
        local row=guiGridListAddRow(wmor.gridlist)
        if tostring(v.ownedGroup) == "0" then v.ownedGroup "Brak" end
        guiGridListSetItemText(wmor.gridlistrow1v.idfalsefalse)
        guiGridListSetItemText(wmor.gridlistrow2getVehicleNameFromModel(v.model), falsefalse)
        guiGridListSetItemText(wmor.gridlistrow3v.ownedGroup falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if not getElementData(el,"player:organization"then outputChatBox("* Nie posiadasz organizacji!") return end
    if not guiGetVisible(wmor.gridlistthen
        tickorga getTickCount()
        panelorga true
        addEventHandler("onClientRender",root,PanelUrzad49)
        guiSetVisible(wmor.windowtrue)
        showCursor(true)
        triggerServerEvent("org:download"resourceRootel)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 16:21


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

Jakie? b??dy DB3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 16:22


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

Brak

Jest tylko w innym skrypcie w tym folderze.

Error: Loading script failed" ogrpg-offices\c_org4.lua:102:')' expected (to close '(' at line 92) near 'end'

Ostatnio zmieniony przez P.Wiśnia 2017-07-22, 16:24, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 16:24


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

tutaj nigdzie nie masz guiCreateWindow.

[ Dodano: 2017-07-22, 16:25 ]
je?eli jest to w?a?nie to ustaw na false

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 16:25


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

guiCreateStaticImage

[ Dodano: 2017-07-22, 16:32 ]
wmor.window=guiCreateStaticImage(0.12, 0.037, 0.84, 0.9, ":ogrpg-core/okn1.png", true)
guiSetVisible(wmor.window, false)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 16:43


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

to nie jest okno tylko obrazek

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 18:15


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

A da si? zrobi? zeby tworzy?o niewidzialne okno zamiast obrazka?>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 20:13


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

Aidis, no pewnie ?e tak

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-22, 23:55


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

A mo?na pokaza? jak to wygl?da.

Postaw piwo autorowi tego posta
 

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


psychol.







Wiek: 23
Na forum: 3502 dni
Posty: 225
Nick w MP: psychol.

Piwa: 2998

Respekt: 244,5
Respekt: 244,5Respekt: 244,5

"Aidis" napisał/a:

Mam problem poniewa? jak gracz wejdzie na serwer to pojawia si? mu gui
https://zapodaj.net/5cf4b6bed36ed.png.html

Server


function refreshgui(element)
    local uid=getElementData(element,"player:uid")
    if not uid then return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=?"uid)
    triggerClientEvent(element"org:refresh"resourceRootresult)
end

addEvent("org:check"true)
addEventHandler("org:check"resourceRoot, function(id,name)
    -- Pobieramy UID gracza
    local uid=getElementData(client,"player:uid")
    if not uid then return end
    -- Sprawdzamy czy jest jeszcze w?&#8218;a?&#8250;cicielem
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?"iduid)
    if #result < 0 then 
        outputChatBox("* Nie jeste?&#8250; w?&#8218;a?&#8250;cicielem pojazdu."client25500)
        return
    end
    local org getElementData(client,"player:organization")
    if not org then outputChatBox("Nie jeste?&#8250; w frakcji!",client,255,0,0) return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND parking=0"idorg)
    if #result > 0 then 
        outputChatBox("* Pojazd nie jest w przechowalni!."client25500)
        return
    end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?"iduid)
    if #result > 0 then 
        if result[1].ownedGroup ~= "0" then 
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=0 WHERE id=? AND ownedPlayer=?"iduid)
            outputChatBox("* Zmieni?&#8218;e?&#8250; pojazdowi "..name.."("..id..") przypis na siebie"client)
            refreshgui(client)
            return
        end
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=? WHERE id=? AND ownedPlayer=?"orgiduid)
    if query then
        outputChatBox("* Zmieni?&#8218;e?&#8250; pojazdowi "..name.."("..id..") przypis na frakcje"client)
        refreshgui(client)
    end
    end
end)

addEvent("org:download"true)
addEventHandler("org:download"resourceRootrefreshgui)

Client

local marker=createMarker(358.26,185.35,1008.38-0.9"cylinder"1255255255155)
setElementInterior(marker3)

local screenWscreenH guiGetScreenSize()
panelorga false

function PanelUrzad49() 
local AlphaAlpha2 interpolateBetween(0002551800, ((getTickCount() - tickorga) / 2500), "Linear"dxDrawImage(screenW 0.0743screenH 0.0804screenW 0.9400screenH 0.8352":ogrpg-core/okn.png"000tocolor(000Alpha2), false)
dxDrawText("PRZEPISYWANIE POJAZDOW NA ORGANIZACJE!"screenW 0.1038screenH 0.2702screenW 0.9625screenH 0.1500tocolor(255,0,0), 3.00"default""center""center"falsefalsefalsefalsefalse)        
end

local wmor={}
wmor.window=guiCreateStaticImage(0.120.0370.840.9":ogrpg-core/okn1.png"true)
guiSetVisible(wmor.windowfalse)
wmor.label=guiCreateLabel(0.020.190.960.05"Z ponizszej listy wybierz pojazd ktory chesz przepisac na organizacje a nastepnie kliknij przycisk Przepisz/Wypisz"truewmor.window)
guiLabelSetHorizontalAlign(wmor.label"center"false)
guiLabelSetVerticalAlign(wmor.label"center")
wmor.gridlist=guiCreateGridList(0.250.230.530.5truewmor.window)
guiGridListAddColumn(wmor.gridlist"ID"0.2)
guiGridListAddColumn(wmor.gridlist"Nazwa"0.5)
guiGridListAddColumn(wmor.gridlist"Organizacja"0.5)
wmor.submit=guiCreateButton(0.040.740.270.11"Przepisz / Wypisz"truewmor.window)
wmor.close=guiCreateButton(0.680.740.280.11"Zamknij Panel"truewmor.window)

addEventHandler("onClientGUIClick"root, function(btn,state)
    if source == wmor.submit then
        local selectedRow=guiGridListGetSelectedItem(wmor.gridlist)
        if selectedRow 0 then return end
        local id=tostring(guiGridListGetItemText(wmor.gridlistselectedRow1))
        local name=tostring(guiGridListGetItemText(wmor.gridlistselectedRow2))
        triggerServerEvent("org:check"resourceRootidname)
    end
    if source == wmor.close then
        if guiGetVisible(wmor.window) == true then
            showCursor(false)
              removeEventHandler("onClientRender",root,PanelUrzad49)
            panelorga false
            guiSetVisible(wmor.windowfalse)
        end
    end
end)
 
addEvent("org:refresh"true)
addEventHandler("org:refresh"resourceRoot, function(result)
    guiGridListClear(wmor.gridlist)
    for i,v in pairs(result) do
        if string.len(v.plateText) < 1 then v.plateText="Brak" end
        local row=guiGridListAddRow(wmor.gridlist)
        if tostring(v.ownedGroup) == "0" then v.ownedGroup "Brak" end
        guiGridListSetItemText(wmor.gridlistrow1v.idfalsefalse)
        guiGridListSetItemText(wmor.gridlistrow2getVehicleNameFromModel(v.model), falsefalse)
        guiGridListSetItemText(wmor.gridlistrow3v.ownedGroup falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if not getElementData(el,"player:organization"then outputChatBox("* Nie posiadasz organizacji!") return end
    if not guiGetVisible(wmor.gridlistthen
        tickorga getTickCount()
        panelorga true
        addEventHandler("onClientRender",root,PanelUrzad49)
        guiSetVisible(wmor.windowtrue)
        showCursor(true)
        triggerServerEvent("org:download"resourceRootel)
    end
end)


Wystarczy ?e dodasz pod tworzeniem obrazka:
guiSetVisible(wmor.windowfalse)

Schowa to okno, a one si? pojawi kiedy gracz wejdzie w marker.

Podpis


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-23, 13:05


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

Ale ja to ju? mam.

Dodam ze to si? pojawia na laptopie u mnie na komputerze nie.

Postaw piwo autorowi tego posta
 

 
Tagi: pojawianie :: sie :: gui :: wejsciu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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