Pr?bowa?em doda? tutaj opcj? banowania na czas, ale nie posz?o co?. Pomo?ecie mi zrobi? tak, ?e wpisze np. /ban Fanciak 1 h test to po up?ywie tego 1h mnie odbanowywa?o?
addCommandHandler ( "aban", function ( plr, cmd, gracz, czas, rodzaj, ... )
if not isObjectInACLGroup ( "user."..getPlayerName ( plr ), aclGetGroup ( "Admin" ) ) then return end
if not gracz and not rodzaj and not czas and not ... or not gracz == nil or rodzaj == nil or czas == nil then
return outputChatBox ( "U?yj: /aban <gracz> <czas> <rodzaj : m,s,h> <pow?d>", plr ) end
player = gracz
if not player then return end
txt = table.concat ( {...}, " " )
outputChatBox ( "Gracz "..getPlayerName(player).." zosta?/a zbanowany/a przez "..getPlayerName(plr).."", root )
outputChatBox ( "Pow?d : "..txt, root )
if rodzaj == "m" then
rodzaj = "minut"
czas1 = czas * 60
elseif rodzaj == "s" then
rodzaj = "sekund"
czas1 = czas
elseif rodzaj == "h" then
rodzaj = "godzin"
czas1 = czas * 60 * 60
end
outputChatBox ( "Czas: "..czas.." "..rodzaj.."", root )
banPlayer ( player, true, true, true, plr, txt, czas1 )
end)
DB3 wywala taki b??d:
8 linijka - WARNIG - Bad argument @ 'getPlayerName' [Expected element at argument 1, got string 'Fanta']
ERROR - attempt to concatenate a boolean value
addCommandHandler ( "aban", function ( plr, cmd, gracz, czas, rodzaj, ... )
if not isObjectInACLGroup ( "user."..getPlayerName ( plr ), aclGetGroup ( "Admin" ) ) then return end
if not gracz and not rodzaj and not czas and not ... or not gracz == nil or rodzaj == nil or czas == nil then
return outputChatBox ( "U?yj: /aban <gracz> <czas> <rodzaj : m,s,h> <pow?d>", plr ) end
player = getPlayerFromName(gracz)
if not player then return end
txt = table.concat ( {...}, " " )
outputChatBox ( "Gracz "..getPlayerName(player).." zosta?/a zbanowany/a przez "..getPlayerName(plr).."", root )
outputChatBox ( "Pow?d : "..txt, root )
if rodzaj == "m" then
rodzaj = "minut"
czas1 = czas * 60
elseif rodzaj == "s" then
rodzaj = "sekund"
czas1 = czas
elseif rodzaj == "h" then
rodzaj = "godzin"
czas1 = czas * 60 * 60
end
outputChatBox ( "Czas: "..czas.." "..rodzaj.."", root )
banPlayer ( player, true, true, true, plr, txt, czas1 )
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