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

Wysłany: 2017-11-22, 22:12


NorbiNorbi







Wiek: 29
Na forum: 3345 dni
Posty: 3
Nick w MP: NorbiTTT



Respekt: 50

Cze??, mam problem z pewn? komend?.. ./zpA/zpB i /zbC prosz? pom??cie, gdy wpisze komendy zeby zabrac prawo jazdy jakiejs kategori to nawet po zabraniu nadal mozna wsiadac i jezdzic

addCommandHandler("zpA", function(plr,cmd,cel,time,rodzaj,...) 
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then 
local reason=table.concat({...}, " ") 
if not cel or not tonumber(time) or not rodzaj or not reason then 
outputChatBox("U?ycie: /zpA <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr) 
return 
end 
local target=exports["ogrpg-core"]:findPlayer(plr,cel) 
if not target then 
outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 0, 0) 
return 
end 
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","A", getPlayerSerial(target)) 
local result=exports["ogrpg-db"]:pobierzWyniki(query) 
if (result) then 
return exports["1"]:outputNotificationBox (plr, "#cc0000Gracz Posiada zawieszone prawo jazdy do #00cccc"..result["time"]..", #cc0000za: #00cccc"..result["reason"]) 
else 
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "A", getPlayerSerial(plr)) 
end 
if isPedInVehicle(target) then 
removePedFromVehicle(target) 
end 
if tonumber(time) <= 0 then return end 
local result = "DATE()" 
if rodzaj == "m" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d MINUTE)',time) 
elseif rodzaj == "h" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d HOUR)',time) 
elseif rodzaj == "d" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d DAY)',time) 
elseif rodzaj == "w" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d WEEK)',time) 
end 
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|" 
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w (kat. A) "..reason.."("..time .. rodzaj ..")") 
local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES ('%s','%s',%s,'%s')", getPlayerSerial(target), reason, result, "A") 
exports["ogrpg-db"]:dbSet(query) 
triggerEvent("save:player",root,target) 
end 
end) 

addCommandHandler("zpB", function(plr,cmd,cel,time,rodzaj,...) 
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then 
local reason=table.concat({...}, " ") 
if not cel or not tonumber(time) or not rodzaj or not reason then 
outputChatBox("U?ycie: /zpB <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr) 
return 
end 
local target=exports["ogrpg-core"]:findPlayer(plr,cel) 
if not target then 
outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 0, 0) 
return 
end 
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","B", getPlayerSerial(target)) 
local result=exports["ogrpg-db"]:pobierzWyniki(query) 
if (result) then 
return exports["1"]:outputNotificationBox (plr, "#cc0000Gracz Posiada zawieszone prawo jazdy do #00cccc"..result["time"]..", #cc0000za: #00cccc"..result["reason"]) 
else 
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "B", getPlayerSerial(plr)) 
end 
if isPedInVehicle(target) then 
removePedFromVehicle(target) 
end 
if tonumber(time) <= 0 then return end 
local result = "DATE()" 
if rodzaj == "m" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d MINUTE)',time) 
elseif rodzaj == "h" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d HOUR)',time) 
elseif rodzaj == "d" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d DAY)',time) 
elseif rodzaj == "w" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d WEEK)',time) 
end 
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|" 
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w (kat. B) "..reason.."("..time .. rodzaj ..")") 
local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES ('%s','%s',%s,'%s')", getPlayerSerial(target), reason, result, "B") 
exports["ogrpg-db"]:dbSet(query) 
triggerEvent("save:player",root,target) 
end 
end) 

addCommandHandler("zpC", function(plr,cmd,cel,time,rodzaj,...) 
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then 
local reason=table.concat({...}, " ") 
if not cel or not tonumber(time) or not rodzaj or not reason then 
outputChatBox("U?ycie: /zpC <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr) 
return 
end 
local target=exports["ogrpg-core"]:findPlayer(plr,cel) 
if not target then 
outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 0, 0) 
return 
end 
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","C", getPlayerSerial(target)) 
local result=exports["ogrpg-db"]:pobierzWyniki(query) 
if (result) then 
return exports["1"]:outputNotificationBox (plr, "#cc0000Gracz Posiada zawieszone prawo jazdy do #00cccc"..result["time"]..", #cc0000za: #00cccc"..result["reason"]) 
else 
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "C", getPlayerSerial(plr)) 
end 
if isPedInVehicle(target) then 
removePedFromVehicle(target) 
end 
if tonumber(time) <= 0 then return end 
local result = "DATE()" 
if rodzaj == "m" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d MINUTE)',time) 
elseif rodzaj == "h" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d HOUR)',time) 
elseif rodzaj == "d" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d DAY)',time) 
elseif rodzaj == "w" then 
result = string.format('DATE_ADD(NOW(), INTERVAL %d WEEK)',time) 
end 
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|" 
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w (kat. C) "..reason.."("..time .. rodzaj ..")") 
local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES ('%s','%s',%s,'%s')", getPlayerSerial(target), reason, result, "C") 
exports["ogrpg-db"]:dbSet(query) 
triggerEvent("save:player",root,target) 
end 
end)


Ostatnio zmieniony przez _Haze 2017-11-26, 16:07, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-23, 15:01


DawajDyszke







Wiek: 27
Na forum: 3637 dni
Posty: 28
Nick w MP: Shaky

Piwa: 431

Respekt: 35,8

Ostrzeżeń: 60%
dodales do acl?

Podpis
local pseudol = createElement("nanKy"):setModel(0)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-24, 20:32


LightMen







Wiek: 28
Na forum: 3382 dni
Posty: 12
Nick w MP: LightMen



Respekt: 25,8

..

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działa :: komenda
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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