Mam taki ma?y problem mam skrypty na zabieranie prawka po??czone z mysql
Problem le?y w 2 rzeczach 1. Gdy jestem "nowym" graczem moge odrazu do wszystkiego wsiada?.Problem 2 to jest ?e gdy mam zawieszony prawa jazdy nadal moge wsiadac a w db 3 nic nie pisze o bledzie
Daje wam linijki Kod?w oraz ss myqsl
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if seat == 0 then
for i,v in ipairs(categoryA) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=A AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=A AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryB) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=B AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=B AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryL) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=C AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=C AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
end
end)
addEventHandler("onResourceStart", resourceRoot, function() onRespawnVehicles(_,false) end)
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if seat == 0 then
for i,v in ipairs(categoryA) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='A' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='A' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryB) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='B' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='B' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryL) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='C' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='C' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
end
end)
addEventHandler("onResourceStart", resourceRoot, function() onRespawnVehicles(_,false) end)
Bo nigdzie nie masz zablokowanego wsiadania jako nowy gracz - bynajmniej ja takiego kodu tutaj nie widz?.
Edit: Sprawd? czy takie co? zadzia?a, jak nie podaj ewentualne b??dy w DB3.
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if seat == 0 then
if (not getElementData(plr,"player:license:pjA") or getElementData(plr,"player:license:pjB") or getElementData(plr,"player:license:pjL")) then
cancelEvent()
outputChatBox("* Nie posiadasz odpowiednich uprawnie? aby kierowa? tym pojazdem.",plr)
return false
end
for i,v in ipairs(categoryA) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='A' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='A' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryB) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='B' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='B' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
for i,v in ipairs(categoryL) do
if getElementModel(source) == v then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type='C' AND active=1 AND serial=? AND time>NOW()", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason.."", plr)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type='C' AND active=1 AND serial=?", getPlayerSerial(plr))
end
end
end
end
end)
addEventHandler("onResourceStart", resourceRoot, function() onRespawnVehicles(_,false) end)
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