Witam ,Wi?c sprawa wygl?da tak : Mam skrypt na pojazdy kt?ry sprawdza licencje kat .A i chodzi mi o to aby robi? on wyj?tek na pojazd faggio o id 462 ,tzn aby by?o mo?na tylko nim je?dzi? bez prawka kat A..
Za pomoc Stawiam Zimne Pozdrawiam
Gdzie mam to konkretnie dopisa? bo co? mi nie dzia?a ?
addEventHandler("onVehicleStartEnter", getRootElement(), function(plr, seat, jacked)
if seat == 0 then
if getVehicleType(source) == "Bike" then
if getElementData(plr, "player:license:pjA") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori A", plr, 0, 255, 131)
cancelEvent()
end
elseif getVehicleType(source) == "Automobile" then
if getElementData(plr, "player:license:pjB") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori B", plr, 0, 255, 131)
cancelEvent()
end
elseif getVehicleType(source) == "Plane" then
if getElementData(plr, "player:license:pjL") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori L", plr, 0, 255, 131)
cancelEvent()
end
end
end
end)
-- Tutaj dalsza cze?c kodu
addEventHandler("onVehicleStartEnter", getRootElement(), function(plr,seat,jacked)
if seat ~= 0 then return end
if categoryA[getElementModel(source)] then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=? AND active=0 AND serial=? AND time>NOW()", "A", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason, plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "A", getPlayerSerial(plr))
end
end
if categoryB[getElementModel(source)] then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=? AND active=1 AND serial=? AND time>NOW()", "B", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason, plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "B", getPlayerSerial(plr))
end
end
if categoryC[getElementModel(source)] then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=? AND active=1 AND serial=? AND time>NOW()", "C", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo jazdy do "..result[1].time..", za: "..result[1].reason, plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "C", getPlayerSerial(plr))
end
end
if categoryL[getElementModel(source)] then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=? AND active=1 AND serial=? AND time>NOW()", "L", getPlayerSerial(plr))
if #result > 0 then
cancelEvent()
outputChatBox("* Posiadasz zawieszone prawo lotnicze do "..result[1].time..", za: "..result[1].reason, plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "L", getPlayerSerial(plr))
end
end
end)
addEventHandler("onVehicleStartEnter", getRootElement(), function(plr, seat, jacked)
if seat == 0 then
if getVehicleType(source) == "Bike" then
if getElementData(plr, "player:license:pjA") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori A", plr, 0, 255, 131)
cancelEvent()
end
elseif getVehicleType(source) == "Automobile" then
if getElementData(plr, "player:license:pjB") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori B", plr, 0, 255, 131)
cancelEvent()
end
elseif getVehicleType(source) == "Plane" then
if getElementData(plr, "player:license:pjL") ~= 1 then
outputChatBox("* Nie posiadasz prawa jazdy kategori L", plr, 0, 255, 131)
cancelEvent()
end
end
end
end)
addEventHandler("onVehicleStartEnter", getRootElement(),
function(plr, seat, jacked)?
if seat == 0 then?if getVehicleType(source) == "Bike" then
if getElementData(plr, "player:license:pjA") ~= 1 then?
outputChatBox("* Nie posiadasz prawa jazdy kategori A", plr, 0, 255, 131)?
if not getElementModel(source) == id then return
cancelEvent()?
end
end
Powinno dzia?a?.
Tylko zamiast id wpisz id faggio.
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