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)
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)
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)
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)
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)
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)
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