Patryk545
Wiek: 25 Na forum: 2224 dni Posty: 36
Nick w MP: Patryk545
Piwa : 1
Mam taki problem, ?e po wpisaniu komendy /b i /k poka?e si? komunikat o tym, ?e kto? zosta? zbanowany lub wyrzucony ale nie wywala to ich lub nie banuje na serwerze czyli tak jakby te komendy nie dzia?a?y.
function cmd_pkick ( plr , cmd , target , ...)
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) or getAdmin ( plr , 5 ) or getAdmin ( plr , 6 ) then
if not target or not ... then
outputChatBox ( "#007aff(ⓘ) #FFFFFFU?yj /k [ID/Nazwa gracza] [Pow?d]" , plr , 255 , 255 , 255 , true )
return
end
local player = exports [ "pystories-core" ]: findPlayer ( plr , target )
local text = table . concat ({...}, " " )
if player then
triggerClientEvent ( getRootElement (), "notiBig" , getRootElement (), "Gracz " .. getPlayerName ( player ): gsub ( "#%x%x%x%x%x%x" , "" ).. " zostaje wykopany/a przez " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " z powodu: " .. text , text )
outputConsole ( " " , player )
outputConsole ( "Zosta?e? wykopany z serwera!" , player )
outputConsole ( "Osoba wyrzucaj?ca: " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), player )
outputConsole ( "Pow?d: " .. text , player )
outputConsole ( " " , player )
kickPlayer ( player , getPlayerName ( plr ), "Sprawd? swoj? konsol? (~)" )
end
end
end
addCommandHandler ( "k" , cmd_pkick )
addCommandHandler ( "b" , function( plr , cmd , cel , x , bantype ,...)
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) or getAdmin ( plr , 5 ) or getAdmin ( plr , 4 ) then
local reason = table . concat ({...}, " " )
if not cel or not tonumber ( x ) or not bantype or not reason then
outputChatBox ( "#007aff(ⓘ) #FFFFFFU?ycie: /b <nick/ID> <ilo??> <m/h/d> <pow?d>" , plr , 255 , 255 , 255 , true )
outputChatBox ( "m - minuty/h - godziny/d - dni" , plr )
return
end
local target = exports [ "pystories-core" ]: findPlayer ( plr , cel )
if not target then
outputChatBox ( "#bf0101(✖) #FFFFFFNie znaleziono podanego gracza." , plr , 255 , 255 , 255 , true )
return
end
if ( getAdmin ( plr , 4 ) == false ) and getAdmin ( target , 4 ) then return end
reason = reason .. " |od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "|"
if bantype == "m" or bantype == "h" or bantype == "d" then
if bantype == "m" then
exports [ "pystories-db" ]: dbSet ( "INSERT INTO pystories_ban (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)" , getPlayerSerial ( target ), reason , x , "ban" )
end
if bantype == "h" then
exports [ "pystories-db" ]: dbSet ( "INSERT INTO pystories_ban (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)" , getPlayerSerial ( target ), reason , x , "ban" )
end
if bantype == "d" then
exports [ "pystories-db" ]: dbSet ( "INSERT INTO pystories_ban (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)" , getPlayerSerial ( target ), reason , x , "ban" )
end
end
-- triggerClientEvent ( getRootElement (), "notiBig" , getRootElement (), "Gracz " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " zosta?(a) zbanowany(a) za: " .. reason .., " na: " .. x .. """, text)
triggerClientEvent(getRootElement(), " notiBig ", getRootElement(), " Gracz "..getPlayerName(target):gsub(" #%x%x%x%x%x%x","").." zostaje zbanowany/a przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").. " z powodu: "..reason.." na "..x.." "..bantype, text)
kickPlayer ( target , plr , "Zosta?e?(a?) zbanowany(a), po??cz si? ponownie." )
end
end )
Ostatnio zmieniony przez PatryKK. 2020-10-27, 23:05, w całości zmieniany 1 raz