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: 4065 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(plr, cmd, ...)
 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"..message, p, 255, 255, 255, true)
 end
    end
end)


Postaw piwo autorowi tego posta
 

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


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

addCommandHandler("v", function(plr, cmd, ...)
 if getElementData(plr, "player:premium") ~= false or getAdmin(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 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: 4065 dni
Posty: 185

Piwa: 73

Respekt: -149

"Hazmudex" napisał/a:

addCommandHandler("v", function(plr, cmd, ...)
 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"..message, p, 255, 255, 255, true)
 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,1) then
        if not getElementData(plr,"player:admin") then
            giveWeapon(plr,22)
            toggleControl(plr,"fire",true)
            toggleControl(plr,"aim_weapon",true)
            if getAdmin(plr, 1) then
            setElementData(plr,"player:level",1)
            elseif getAdmin(plr, 2) then
            setElementData(plr,"player:level",2)
            elseif getAdmin(plr, 3) then
            setElementData(plr,"player:level",3)
            elseif getAdmin(plr, 4) then
            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.", plr, 192 ,192 ,192)
            --outputChatBox("* "..getPlayerName(plr).." zalogowa?(a) si? do administracji.", root, 255, 0, 0)
        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.", root, 255, 0, 0)
        end
    else
        --outputChatBox("* Nie posiadasz uprawnie?.", plr, 255, 0, 0)
    end
end)


Postaw piwo autorowi tego posta
 

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


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 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: 4065 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(plr, cmd, ...)
 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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3)  then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 end
    end
end)


Postaw piwo autorowi tego posta
 

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


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 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: 4065 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: 25
Na forum: 4325 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

mis14,
addCommandHandler("v", function(plr, cmd, ...)
 if getElementData(plr, "player:premium") ~= false or getAdmin(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 end
    end
end)




Postaw piwo autorowi tego posta
 

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


mis14







Wiek: 25
Na forum: 4065 dni
Posty: 185

Piwa: 73

Respekt: -149

"Hazmudex" napisał/a:

mis14,
addCommandHandler("v", function(plr, cmd, ...)
 if getElementData(plr, "player:premium") ~= false or getAdmin(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 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(plr, cmd, ...)
 if getElementData(plr, "player:premium") ~= false or getAdmin(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) 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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 end
    end
end) 


Postaw piwo autorowi tego posta
 

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


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

addCommandHandler("v", function(plr, cmd, ...)
 if not getElementData(plr, "player:premium") ~= false or not getAdmin(p, 1) or not getAdmin(p, 2) or not getAdmin(p, 3) or not getAdmin(p, 4) 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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 end
    end
end) 


Postaw piwo autorowi tego posta
 

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


mis14







Wiek: 25
Na forum: 4065 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: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

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(plr, cmd, ...)
 if not getElementData(plr, "player:premium") ~= false or not getAdmin(plr, 1) or not getAdmin(plr, 2) or not getAdmin(plr, 3) or not getAdmin(plr, 4) 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(p, 1) or getAdmin(p, 2) or getAdmin(p, 3) or getAdmin(p, 4) then
    outputChatBox("#FFFF00 (Premium) #ffffff("..getElementData(plr,"id")..") #FFFF00"..name..": #FFFFFF"..message, p, 255, 255, 255, true)
 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