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

Wysłany: 2023-09-15, 19:17


WitekPL







Wiek: 20
Na forum: 1387 dni
Posty: 5

Piwa: 5

Respekt: 50

Witam serdecznie, co mo??e by?? nie tak z zpj poniewa?? gdy chce komus da? prawko to pisze ,,Nie mo?na ?abrac prawa jazdy graczowi o SID 1"


addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) or getAdmin(plr,5) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "/zpj [nick/id] [czas] [m/h/d] [powod]", {25, 175, 255})
return
end
local target=exports["dmta_core"]:findPlayer(plr,cel)
if not target then
exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "Nie znaleziono gracza", {25, 175, 255})
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end


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


if getElementData(target,"player:uid") == 1 or 2 then exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "Nie można zabrać prawo jazdy graczowi o SID: 1 !", {25, 175, 255}, plr) return end
result=pobierzDate(type,time)
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSerial(target), reason, result, "C")

if type=="m" or type=="h" or type=="d" then
if type=="m" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)",getPlayerSerial(target), reason, time, "C")
end
if type=="h" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)",getPlayerSerial(target), reason, time, "C")
end
if type=="d" then
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "A")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "B")
exports["dmta_db"]:dbSet("INSERT INTO dmta_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)",getPlayerSerial(target), reason, time, "C")
end
end

triggerClientEvent(root, "admin:rendering", root, "["..getElementData(target,"id").."] "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymał(a) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."("..time .. type ..")")
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",""), "Prawo jazdy", ""..reason.." ("..time..""..type..")", getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getPlayerSerial(target))
outputChatBox(" ", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Otrzymałeś(aś) zakaz prowadzenia pojazdów od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Powód: "..reason:gsub("#%x%x%x%x%x%x","").."", target, 255, 255, 255)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox("Czas: "..time .. type .."", target, 255, 255, 255)
outputChatBox(" ", target, 255, 0, 0)
outputChatBox(" ", target, 255, 0, 0)
local desc = "[#ff6600ZPJ#FFFFFF] (Czas: #ff6600"..time .. type .."#ffffff) ["..getElementData(target,"id").."]"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." otrzymał(a) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."]"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..". Powód: "..reason..""
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) zakaz prowadzenia pojazdów kat. A,B,C od ["..getElementData(plr,"id").."] "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."("..time .. type ..")")
end
end)

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-09-21, 10:10


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

if getElementData(target,"player:uid") == or 2 then exports['al_notify']:addNotification(plr'admin''Komendy Administracyjne'"Nie można zabrać prawo jazdy graczowi o SID: 1 !", {25175255}, plr) return end


Ta linijka za to odpowiada. Zapewne autor zasobu z paczki zablokowal sobie swoje UID zeby mu nikt prawa jazdy nie zabral. Usun ta linijke

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-11-19, 15:29


Adas410







Wiek: 25
Na forum: 1855 dni
Posty: 6
Nick w MP: Adas410

Piwa: 4

Respekt: 50

ewentualnie popraw,
Kod:

if getElementData(target,"player:uid") == 1 or getElementData(target,"player:uid") == 2 then
exports['al_notify']:addNotification(plr, 'admin', 'Komendy Administracyjne', "Nie można zabrać prawa jazdy graczowi o SID: 1 !", {25, 175, 255}, plr)
return
end


Dzięki temu warunek będzie sprawdzał, czy getElementData(target,"player:uid") wynosi 1 lub 2, co powinno rozwiązać problem

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: proble? :: zabieraniem :: prawka
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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