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

Wysłany: 2017-05-17, 15:36


Cjalis







Wiek: 35
Na forum: 3684 dni
Posty: 26
Nick w MP: Cejot

Piwa: 36

Respekt: 70

Witam nie dzia?a mi system administracji.Brak b??du w db3



function Pomocnik(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), Pomocnik)
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function Administrator(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), Administrator)
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function HeadAdministrator(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), HeadAdministrator)
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function AdministratorRcon(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), AdministratorRcon)
    if result and #result > 0 then
        return true
    else
        return false
end
end






function loadPlayerData (plr)
           if Pomocnik(plr) or Administrator(plr) or HeadAdministrator(plr) or AdministratorRcon(plr) then
        if not getElementData(plr,"ekipa") then
            giveWeapon(plr,22)
                    if Pomocnik(plr) then
                setPlayerNametagColor(plr, 255, 255, 255)
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Pomocnika.",plr,0,255,0)
            elseif Administrator(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Administratora",plr,0,0,255)
            elseif HeadAdministrator(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Head Administratora",plr,0,0,255)
            elseif AdministratorRcon(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Administratora Rcon",plr,0,0,255)
            end
            setElementData(plr,"ekipa",true)
                    end
    end
end
addEventHandler("onPlayerSpawn", root, function() loadPlayerData(source) end)





Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-17, 15:40


Emm

***** ***






Wiek: 32
Na forum: 4021 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6171

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Opisz dok?adniej co ci nie dzia?a? Nie loguje Ci? na rang? po wbiciu na serwer?

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-17, 15:42


eject

kurdebele






Wiek: 30
Na forum: 3800 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%

function Pomocnik(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), "Pomocnik")
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function Administrator(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), "Administrator")
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function HeadAdministrator(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), "HeadAdministrator")
    if result and #result > 0 then
        return true
    else
        return false
    end
end

function AdministratorRcon(plr,ranga)
    local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), "AdministratorRcon")
    if result and #result > 0 then
        return true
    else
        return false
end
end






function loadPlayerData (plr)
           if Pomocnik(plr) or Administrator(plr) or HeadAdministrator(plr) or AdministratorRcon(plr) then
        if not getElementData(plr,"ekipa") then
            giveWeapon(plr,22)
                    if Pomocnik(plr) then
                       setPlayerNametagColor(plr, 255, 255, 255)
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Pomocnika.",plr,0,255,0)
            elseif Administrator(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Administratora",plr,0,0,255)
            elseif HeadAdministrator(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Head Administratora",plr,0,0,255)
            elseif AdministratorRcon(plr) then
                        outputChatBox("* Pomy?lnie zalogowano na rang?: Administratora Rcon",plr,0,0,255)
            end
            setElementData(plr,"ekipa",true)
            else
            setElementData(plr,"ekipa",false)
            outputChatBox("* Wylogowales sie z rangi ekipy serwera!",plr,0,0,255)
                    end
    end
end
addEventHandler("onPlayerSpawn", root, function() loadPlayerData(source) end)

Licze na :piwo: , przy okazji dorobilem ci wylogowanie z rangi

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Cjalis
Wysłany: 2017-05-17, 16:02


Cjalis







Wiek: 35
Na forum: 3684 dni
Posty: 26
Nick w MP: Cejot

Piwa: 36

Respekt: 70

Dzi?ki za Pomoc Eject :)

Postaw piwo autorowi tego posta
 

 
Tagi: system :: administracji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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