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

Wysłany: 2018-05-07, 13:08


Daybreak







Wiek: 27
Na forum: 3692 dni
Posty: 30

Piwa: 2

Respekt: 50

Witam mam taki problem pobra?em skrypty Its'a z 2k17 bo potrzebowa?em dutyadmin ale jest taki problem ?e jak zabieram prawko to bierze je na sta?e i ju? nie da si? odda? tylko trzeba je robi? odnowa wie kto? mo?e jak to naprawi?? bardzo bym by? wdzi?czny stawiam piwo ka?demu kto jako? pomo?e pozdrawiam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 13:26


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Poka? kod prawa jazdy, kod zabierania prawa jazdy oraz zrzut tabeli bazy danych, szczeg?lnie tam gdzie zapisuje si? zabrane prawko

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 14:09


Daybreak







Wiek: 27
Na forum: 3692 dni
Posty: 30

Piwa: 2

Respekt: 50

Ciastuu?, Witam ju? daje kody

ZPJ

Kod:

addCommandHandler("zpj", 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: /zpj <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
triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
return
end
local v = getPedOccupiedVehicle(target)
local vid = getElementData(v,"vehicle:id")
local query = string.format("SELECT * FROM ogrpg_punish WHERE type = %q AND active = 1 AND serial = %q AND time>NOW() LIMIT 1","prawko", getPlayerSerial(target))
local result = exports["DB2"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type = ? AND active = 1 AND serial = ?", "prawko", getPlayerSerial(plr))
end
if isPedInVehicle(target) then
if not getElementData(v, "vehicle:duty") then
removePedFromVehicle(target)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking = 1,tp_to_parking = ? WHERE id = ?","ZPJ", vid)
exports["iyw_vehicles"]:onSaveVehicle(v)
destroyElement(v)
else
removePedFromVehicle(target)
respawnVehicle(v)
end
end
if tonumber(time) <= 0 then return end
reason = reason..""
if rodzaj == "m" then
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)", getPlayerSerial(target),reason, time, "prawko")
elseif rodzaj == "h" then
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)", getPlayerSerial(target),reason, time, "prawko")
elseif rodzaj == "d" then
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)", getPlayerSerial(target),reason, time, "prawko")
elseif rodzaj == "w" then
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? week,?)", getPlayerSerial(target),reason, time, "prawko")
end
exports["ogrpg-db"]:dbSet("insert into kartoteka (typ,karajacy,data,powod,ofiara) VALUES(?,?,NOW(),?,?)", "ZPJ", plr.name:gsub("#%x%x%x%x%x%x",""), reason, getElementData(target, "player:uid"))
triggerClientEvent(root, "adminRender", root, "Gracz "..getPlayerName(target).." otrzyma? zakaz prowadzenia pojazd?w od "..plr.name..", pow?d: "..reason.." ("..time .. rodzaj..")")
--setElementData(target, "player:license:pjB", false)
--local query = exports['ogrpg-db']:dbSet("UPDATE ogrpg_users SET pjB = 0 WHERE id = ?",getElementData(target,"player:uid"))
--triggerEvent("save:player",root,target)
--local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES ('%s','%s',%s,'%s')", getPlayerSerial(target), reason, result, prawko)
--exports["ogrpg-db"]:dbSet(query)
--outputChatBox("* Dodanych rekord", plr)
end
end)



OPJ

Kod:

addCommandHandler("opj", function(plr,cmd,cel)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
if not cel then
outputChatBox("* U?ycie: /opj <nick/ID> ", plr)
return
end
local target = exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
return
end
local query = string.format("SELECT * FROM ogrpg_punish WHERE type = %q AND active = 1 AND serial = %q AND time>NOW() LIMIT 1","prawko", getPlayerSerial(target))
local result = exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type = ? AND active = 1 AND serial = ?", "prawko", getPlayerSerial(target))
outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." odzyskal swoje prawo jazdy!", plr, 0, 255, 0)
outputChatBox("* "..plr.name:gsub("#%x%x%x%x%x%x","").." oddal Twoje prawo jazdy!", target, 0, 255, 0)
else
outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." nie posiada zabranego prawka!", plr, 0, 255, 0)
end
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_prawka_logs (komu_oddali,kto_oddal,typ) VALUES (?,?,?)", getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr.name:gsub("#%x%x%x%x%x%x",""), "prawo jazdy")
end
end)



a powinno zapisywa? tutaj ale nie zapisuje

https://imgur.com/a/A03TPap

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 15:29


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Posiadasz zas?b o nazwie DB2 oraz w??cz /debugscript 3 podczas zabierania prawa jazdy i sprawd? b??dy, czy si? jakie? pojawiaj?

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 15:55


Daybreak







Wiek: 27
Na forum: 3692 dni
Posty: 30

Piwa: 2

Respekt: 50

Ciastuu?, Tak posiadam zasob DB2 oraz jak zabieram prawko to wyskakuje to

Kod:

[2018-05-07 15:54] ERROR: [skrypty_glowne]/dutyadmin/s_cmd.lua:670: bad argument #4 to 'format' (string expected, got nil)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 16:12


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"Daybreak" napisał/a:

Ciastuu?, Tak posiadam zasob DB2 oraz jak zabieram prawko to wyskakuje to

Kod:

[2018-05-07 15] ERROR: [skrypty_glowne]/dutyadmin/s_cmd.lua:670: bad argument #4 to 'format' (string expected, got nil)


Podaj zawarto?? linijki 670 z s_cmd.lua zasobu dutyadmin

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-05-07, 17:06


KucharSolo







Wiek: 35
Na forum: 3438 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

Mamy co? takiego.

Kod:

local query = string.format("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES ('%s','%s',%s,'%s')", getPlayerSerial(target), reason, result, prawko)


[ Dodano: 2018-05-08, 22:13 ]
ktos cos?

[ Dodano: 2018-05-10, 12:22 ]
?? ?

Postaw piwo autorowi tego posta
 

 
Tagi: ogrpg :: zabiera :: prawko :: stałe
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