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

Wysłany: 2017-01-02, 17:34


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

witam nie wiem jak zrobi? aby administracja mia?a wgl?d do tego czatu i zapis pod ogrpg jestem nowy w lua
addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") == false then outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium"then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 17:42


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") ~= false or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)




Ostatnio zmieniony przez _Haze 2017-01-02, 18:02, w całości zmieniany 3 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 17:48


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

"Hazmudex" napisał/a:

addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") == false then outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
    acc getAccountName(getPlayerAccount(p))
 if getElementData(p,"player:premium") or isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)

lecz ja nie chc? pod acl tylko mysql



addCommandHandler("duty", function(plr,cmd)
    if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not getElementData(plr,"player:admin"then
            giveWeapon(plr,22)
            toggleControl(plr,"fire",true)
            toggleControl(plr,"aim_weapon",true)
            if getAdmin(plr1then
            setElementData(plr,"player:level",1)
            elseif getAdmin(plr2then
            setElementData(plr,"player:level",2)
            elseif getAdmin(plr3then
            setElementData(plr,"player:level",3)
            elseif getAdmin(plr4then
            setElementData(plr,"player:level",4)
            end
            setElementData(plr,"player:admin",true)
            outputChatBox("* Zalogowa?e?(a?) si? na rang? (/admins)."plr)
            outputChatBox("* Wpisz /konsola by wyswietlic twoj interfejs."plr192 ,192 ,192)
            --outputChatBox("* "..getPlayerName(plr).." zalogowa?(a) si? do administracji."root25500)
        else
            takeWeapon(plr,22)
            toggleControl(plr,"fire",false)
            toggleControl(plr,"aim_weapon",false)
            removeElementData(plr,"player:admin")
            removeElementData(plr,"player:level")
            outputChatBox("* Wylogowa?e?(a?) si? z rangi (/admins)."plr)
            setPlayerName(plr,getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
            --outputChatBox("* "..getPlayerName(plr).." wylogowa?(a) si? z administracji."root25500)
        end
    else
        --outputChatBox("* Nie posiadasz uprawnie?."plr25500)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 17:52


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Ju? edytowa?em kod powinno ?miga? ^^

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 20:20


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

przerobi?em kod ten administracja ma podgl?d ale nie mog? pisa? bo wywala
outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0)

addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") == false then outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3)  then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 20:26


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Edytowa? em kod zobacz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 20:32


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

"Hazmudex" napisał/a:

Edytowa? em kod zobacz
lecz ten kod co da?e? nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 20:37


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

mis14,
addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") ~= false or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)




Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 20:49


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

"Hazmudex" napisał/a:

mis14,
addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") ~= false or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end)



dobrze doda?em ten kod z dodaniem outputChatBox i mam normalnie premium i admina i pisz? Musisz posiada? status premium by pisa? na czacie globalnym



addCommandHandler("v", function(plrcmd, ...)
 if getElementData(plr"player:premium") ~= false or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then  outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 21:00


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

addCommandHandler("v", function(plrcmd, ...)
 if not getElementData(plr"player:premium") ~= false or not getAdmin(p1) or not getAdmin(p2) or not getAdmin(p3) or not getAdmin(p4then  outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-02, 21:09


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

to samo jest mo?e poprostu trzeba doda? if getAdmin(p) then

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-03, 16:39


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8



function getAdmin(plr,level)
    --if getElementData(plr,"Kuba:>"then return true end
    if level then
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?"getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?"getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end



addCommandHandler("v", function(plrcmd, ...)
 if not getElementData(plr"player:premium") ~= false or not getAdmin(plr1) or not getAdmin(plr2) or not getAdmin(plr3) or not getAdmin(plr4then  outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",plr,78,255,0) return end
    local message table.concat ( { ... }, " " )
    local name getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
    for _,p in pairs(getElementsByType("player")) do
 if getElementData(p,"player:premium") or getAdmin(p1) or getAdmin(p2) or getAdmin(p3) or getAdmin(p4then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..messagep255255255true)
 end
    end
end


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: premium
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