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

Wysłany: 2018-04-03, 10:03


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Witam, gdy robie reconnecta wyskakuje mi taki b??d :
WARNING: [skrypty_glowne]/ogrpg-db/s_db.lua:26dbPoll failedNot unique table/alias'ogrpg_organizations'


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-03, 14:56


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"Szym34kKacperQ" napisał/a:

Witam, gdy robie reconnecta wyskakuje mi taki b??d :
WARNING: [skrypty_glowne]/ogrpg-db/s_db.lua:26dbPoll failedNot unique table/alias'ogrpg_organizations'


Nie posiadasz tabeli o nazwie 'ogrpg_organizations'

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-03, 16:39


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

"Szym34kKacperQ" napisał/a:

Witam, gdy robie reconnecta wyskakuje mi taki b??d :
WARNING: [skrypty_glowne]/ogrpg-db/s_db.lua:26dbPoll failedNot unique table/alias'ogrpg_organizations'
Nie posiadasz tabeli 'ogrpg_organizations'. Aby ja wgrac zaloguj sie do Bazy Danych nastepnie przejdz w zakladke Sql i wklej to:
CREATE TABLE IF NOT EXISTS `ogrpg_organizations` (
  `idint(11NOT NULL,
  `nametext NOT NULL,
  `Shortcutvarchar(5NOT NULL,
  `lideridint(11NOT NULL
ENGINE=InnoDB DEFAULT CHARSET=latin1;


Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Fl!k
Wysłany: 2018-04-03, 19:58


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Dalej nie jestem w org. I dalej wyskakuje
WARNING: [skrypty_glowne]/ogrpg-db/s_db.lua:26dbPoll failedNot unique table/alias'ogrpg_organizations'


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-03, 20:04


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3210 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

wy?lij ssa tej tabeli. ( najlepiej struktury )

Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-03, 20:08


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Daj kod od organizacji

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-03, 21:58


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

CREATE TABLE IF NOT EXISTS `ogrpg_organizations` (
  `idint(11NOT NULL,
  `nametext NOT NULL,
  `Shortcutvarchar(5NOT NULL,
  `lideridint(11NOT NULL
ENGINE=InnoDB DEFAULT CHARSET=latin1;

tabela MYSQL

function findPlayer(plr,cel)
    local target=nil
    if (tonumber(cel) ~= nilthen
        for _,thePlayer in ipairs(getElementsByType("player")) do
            if getElementData(thePlayer,"player:uid") == tonumber(celthen target thePlayer end
        end
    else -- podano fragment nicku
        for _,thePlayer in ipairs(getElementsByType("player")) do
            if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if (targetthen
                    outputChatBox("Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter."plr)
                    return nil
                end
                target=thePlayer
            end
        end
    end
    if target and getElementData(target,"p:inv"then return nil end
    return target
end

addEvent("lidero:editUser"true)
addEventHandler("lidero:editUser"resourceRoot, function(text,rank,faction)
    local result1=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"text)
    if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end 
    local result2=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1;"factiontext) -- pobieramy tylko JEDEN rekord
    if not result2 or #result2 < 0 then outputChatBox("*Podany u?ytkownik nie znajduje si? w tej organizacji",client,255,0,0) return end
    local ranke=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1;"factiongetElementData(client,"player:uid")) -- pobieramy tylko JEDEN rekord
    if not ranke or #ranke < 0 then outputChatBox("*Nie znajdujesz si? w tej organizacji!",client,255,0,0) return end
    if tonumber(ranke[1].rank) <= and (tonumber(rank) > 2then outputChatBox("*Posiadasz za ma?? range!",client,255,0,0) return end
    local query1=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_organizations SET rank=? WHERE uid=? AND code=?"ranktextfaction)
    if query1 then
    local resulted=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=?"faction)
        triggerClientEvent(client,"lidero:refresh",resourceRoot,resulted)
        outputChatBox("* Pomy?lnie zmieniono rang? graczowi "..result1[1].login.." o id: "..faction.." na "..rank.." w organizacji."client)
    end
    local target findPlayer(client,text)
    if target then outputChatBox("Twoja przynaleznosc w organizacji :"..faction.." zostala zaaktualizowana. Aby odej?? wpisz /opusc",targetend
end)
addEvent("lidero:addUser"true)
addEventHandler("lidero:addUser"resourceRoot, function(text,faction)
    if string.len(text) < 0 then return end
    local result1=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"text)
    if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
    local result2=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? and code=?"textfaction)
    if result2 and #result2 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w tej organizacji.", client, 255, 0, 0) return end
    local result3=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=?"text)
    if result3 and #result3 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w innej organizacji.", client, 255, 0, 0) return end
    local query1=exports["ogrpg-db"]:dbSet("INSERT ogrpg_organizations (uid,login,code) VALUES (?,?,?)",text,result1[1].loginfaction)
    local resulted=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=?"faction)
        triggerClientEvent(client,"lidero:refresh",resourceRoot,resulted)
        outputChatBox("* Pomy?lnie dodano gracza "..result1[1].login.." o uid: "..text.." w organizacji na 1 poziom"client)
        outputDebugString("Organizacja : "..faction.." UID :"..text)
        local target=findPlayer(client,text)
        if target then
        outputChatBox("Zosta?e? dodany do organizacji o nazwie :"..faction..". Aby odej?? wpisz /opusc",target) 
        setElementData(target,"player:organization",faction)
        exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?"getElementData(target,"player:uid"))
        end
end)
addEvent("lidero:deleteUser"true)
addEventHandler("lidero:deleteUser"resourceRoot, function(text,faction)
    local result1=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"text)
    if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end 
    local result2=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1;"factiontext) -- pobieramy tylko JEDEN rekord
    if not result2 or #result2 < 0 then outputChatBox("*Podany u?ytkownik nie znajduje si? w tej organizacji",client,255,0,0) return end
    local query1=exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_organizations WHERE uid=? AND code=?",textfaction)
    local resulted=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=?"faction)
    triggerClientEvent(client,"lidero:refresh",resourceRoot,resulted)
    outputChatBox("* Pomy?lnie usunieto gracza "..result1[1].login.." o uid: "..text.." z organizacji" client)
    local target findPlayer(client,text)
    if target then outputChatBox("Twoja przynaleznosc w organizacji :"..faction.." zostala zaaktualizowana.",target); setElementData(target,"player:organization",falseend
end)

addCommandHandler("org",function (plr,cmd,...)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local code=getElementData(plr,"player:organization")
    if not code then return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1;"codeuid) -- pobieramy tylko JEDEN rekord
    if result and #result > 0 then
        if result[1].rank <= 2 then outputChatBox("*Brak uprawnien do panelu organizacji",plr) return end
    local resulted=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=?"code)
        triggerClientEvent(plr"lidero:showGUI"resourceRoot,coderesulted)
    end
end)

addCommandHandler("opusc",function (plr,cmd)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local code=getElementData(plr,"player:organization")
    if not code then outputChatBox("Nie jestes w ?adnej organizacji!",plr) return end
    local query1=exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_organizations WHERE uid=? AND code=?",uidcode)
    outputChatBox("Twoja przynaleznosc w organizacji :"..code.." zostala zaaktualizowana.",plr); setElementData(plr,"player:organization",false)
    
end)

addCommandHandler("ustawspawn",function (plr,cmd)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local code=getElementData(plr,"player:organization:id")
    if not code then outputChatBox("Nie jestes w ?adnej organizacji!",plr) return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? and code=?"uid,code) -- pobieramy tylko JEDEN rekord
    if result and #result > 0 then
        if result[1].rank <= 99 then outputChatBox("*Nie jestes g?ownym liderem",plr) return end
    end
    local int getElementInterior(plr)
    local dim getElementDimension(plr)
    local x,y,getElementPosition(plr)
    if int 0 then  outputChatBox("Spawn nie moze byc w interiorze!",plr) return end
    if dim 0 then  outputChatBox("Spawn nie moze byc w innym dimensionie!",plr) return end
    local query1=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_organization_list set spawn=? where id=?", ("%s,%s,%s"):format(x,y,z),code)
    outputChatBox("Spawn w twojej organizacji zostal zaaktualizowany.",plr)
    for _,p in pairs(getElementsByType('player')) do
        local gan getElementData(p,"player:organization:id")
        if gan == code then
            outputChatBox("Spawn w twojej organizacji zostal zaaktualizowany.",p)
        end
    end
end)

function globalMessage(plrcmd, ...)
    local frakcja=getElementData(plr,'player:organization')
    if not frakcja then
        return
    end
    local msg table.concat ( { ... }, " " )
    local admins=getElementsByType('player')
    for i,v in pairs(admins) do
    local pfrakcje=getElementData(v,'player:organization')
        if frakcja == pfrakcje then
            outputChatBox("[ORGANIZACJA]: ("..getElementData(plr,"id")..") "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..msgv255960false)
        end
    end
end
addCommandHandler("organizacja"globalMessage)




addEventHandler("onResourceStart"root, function() 
local players=getElementsByType('player')
for _p in pairs(players) do
bindKey(p"o""down""chatbox""organizacja")
end
end)

addEventHandler"onPlayerSpawn"getRootElement(),
    function (_)
    bindKey(source"o""down""chatbox""organizacja")
    end
)



Organizacja = kod

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-04, 01:51


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Kolumny w kodzie jak i w tabelce kt?r? da?e? r??ni? si? :)

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-04, 15:00


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

A by? mi poda? dobr? tabele mysql?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-04, 15:04


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Ta tabelka powinna by? poprawna. Jak nie b?dzie to powied? jakiej paczki u?ywasz. :)

Kod:

CREATE TABLE IF NOT EXISTS `ms_organizacje` (
`code` varchar(31) CHARACTER SET utf16 COLLATE utf16_polish_ci NOT NULL,
`login` varchar(121) CHARACTER SET utf16 COLLATE utf16_polish_ci NOT NULL,
`uid` int(11) NOT NULL,
`actived` date NOT NULL,
`rank` int(5) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Tagi: organizacje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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