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

Wysłany: 2021-12-07, 22:15


Erczi







Wiek: 27
Na forum: 2371 dni
Posty: 17
Nick w MP: ewwe

Piwa: 4

Respekt: 50

Potrzebuje pomocy
Gdy wpisuje np. /k 3 to kickuje mnie samego siebie
tak samo jest z banami oraz warnami



Kod:

addCommandHandler("k", function(plr,cmd,cel,...)
if getAdmin(plr,5) or getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not reason then
exports.dmta_interface:showPlayerNotification(plr, "/k [nick/id] [powod]", "error", 1, 3000)
return
end
local target=exports["dmta_core"]:findPlayer(plr,cel)
if not target then
exports.dmta_interface:showPlayerNotification(plr, "Nie znaleziono gracza", "error", 1, 3000)
return
end

if getAdmin(target, 5) then
target = plr
end

triggerClientEvent(root, "admin:rendering", root, ""..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." ["..getElementData(target,"id").."] zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." z powodu: "..reason.."")
local desc = "[#ff6600KICK#FFFFFF] ["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". PowĂłd: "..reason..""
exports["dmta_db"]:dbSet("INSERT INTO logs_penalty_list (uid,nick,typ,powod,date,nadajacy,serial) VALUES (?,?,?,?,NOW(),?,?)", getElementData(target, "player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), "Kick", reason, getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc:gsub("#%x%x%x%x%x%x",""))

outputConsole("=================", target)
outputConsole("Zosta?‚e?›/a?› wyrzucony/a z serwera", target)
outputConsole("Przez: "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target)
outputConsole("PowĂłd: "..reason.."", target)
outputConsole("=================", target)

outputConsole(""..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." ["..getElementData(target,"id").."] zosta?‚(a) wyrzucony(a) przez ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." z powodu: "..reason.."")
kickPlayer(target, plr, "Zosta?‚e?›/a?› wyrzucony/a z serwera, otwĂłrz konsole (`) aby uzyska?‡ wi?™cej informacji.")
end
end)

addCommandHandler("warn", function(plr,cmd,cel, ...)
if getAdmin(plr,5) or getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
local target=exports["dmta_core"]:findPlayer(plr,cel)
if (not target) then
exports.dmta_interface:showPlayerNotification(plr, "Nie znaleziono gracza", "error", 1, 3000)
return
end
local tresc = table.concat(arg, " ")
if (string.len(tresc)<=1) then
exports.dmta_interface:showPlayerNotification(plr, "Wpisz tre?›?‡ ostrzeĹĽenia!", "error", 1, 3000)
return
end

if getAdmin(target, 5) then
target = plr
end

outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Otrzyma?‚e?›(a?›) ostrzeĹĽenie od #ffffff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox("PowĂłd: #ffffff"..tresc:gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0, true)
outputChatBox(" ", target, 255, 0, 0)
triggerClientEvent("onPlayerWarningReceived", target, tresc)
triggerClientEvent(root, "admin:rendering", root, "["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzyma?‚(a) ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..", powĂłd: "..tresc.."")
exports["dmta_db"]:dbSet("INSERT INTO logs_penalty_list (uid,nick,typ,powod,date,nadajacy,serial) VALUES (?,?,?,?,NOW(),?,?)", getElementData(target, "player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), "OstrzeĹĽenie", tresc, getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
local desc = "[#ff6600WARN#FFFFFF] ["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymuje ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". PowĂłd: "..tresc..""
triggerEvent("admin:addText", resourceRoot, desc)
outputServerLog(desc:gsub("#%x%x%x%x%x%x",""))
outputConsole("["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzyma?‚(a) ostrzeĹĽenie od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..", powĂłd: "..tresc.."")
end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
m4rvelka
Wysłany: 2021-12-07, 22:26


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
dodaj if targer == plr then return end

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Erczi
Wysłany: 2021-12-08, 19:24


Erczi







Wiek: 27
Na forum: 2371 dni
Posty: 17
Nick w MP: ewwe

Piwa: 4

Respekt: 50

"Matikmontana" napisał/a:

dodaj if targer == plr then return end

W kt?rym miejscu mam to dodac?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-12-08, 22:21


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
po local target=exports["dmta_core"]:findPlayer(plr,cel)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-12-09, 14:41


Erczi







Wiek: 27
Na forum: 2371 dni
Posty: 17
Nick w MP: ewwe

Piwa: 4

Respekt: 50

"Matikmontana" napisał/a:

po local target=exports["dmta_core"]:findPlayer(plr,cel)

Dzi?kuje dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: banuje :: kickuje :: lub :: warnuje :: samego :: siebie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Banuje, kickuje lub warnuje samego siebie 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