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

Wysłany: 2024-05-23, 12:55


dwadiwad







Wiek: 18
Na forum: 884 dni
Posty: 2



Respekt: 50

zaraz podesle skryp
Kod:


,


local vehicles = "BRAK"
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]

if value then
return value
end
end

return false
end

whitelist = {
['pystories-admins'] = true,
['p_detune'] = true,
['p_wheels'] = true,
['psrpg-ogranicznik'] = true,
['p_wheels'] = true,
['bakmontaz'] = true,
['enginemontaz'] = true,
['neon'] = true,
['tune'] = true,
['Qmix_Przechowywalnia'] = true,
['enonek-przechowywalnia'] = true,
['enonek-pp'] = true,
['suszarka'] = true,
}


function refresh_command()
whitelist = {}
local result=exports["pystories-db"]:dbGet("SELECT * FROM Qmix_vehicles_Whitelist")
for i,v in ipairs(result) do
whitelist[v.skrypt] = true
end
end
setTimer(function()
refresh_command()
end,20000,0)






function create_veh(_,id,poss,buyed,player)
Settings (QUERY)
if sourceResource and not whitelist[getResourceName(sourceResource)] then return end
if id then
result=exports["pystories-db"]:dbGet("SELECT * FROM Qmix_vehicle WHERE parking=1 AND id=?", id)
query=exports["pystories-db"]:dbSet("UPDATE Qmix_vehicle SET parking=0 WHERE id=?", id)
else
result=exports["pystories-db"]:dbGet("SELECT * FROM Qmix_vehicle WHERE parking=0")
end

Pairs
--for ile,vehicle in pairs(result) do
if vehicle["police"] == 0 then
vehicles=ile

if id then pos={poss[1], poss[2], poss[3], poss[4], poss[5], poss[6]}
else pos=split(vehicle["pos"], ",") end

local color=split(vehicle["color"], ",")
local lights=split(vehicle["headlights"], ",")

local veh=createVehicle(vehicle["model"], pos[1], pos[2], pos[3], pos[4], pos[5], pos[6])
if buyed then
warpPedIntoVehicle(player,veh)
end
setVehicleColor(veh, color[1], color[2], color[3], color[4],color[5], color[6], color[7], color[8],color[9], color[10], color[11], color[12])
setVehicleHeadLightColor(veh, lights[1], lights[2], lights[3])
if vehicle["plateText"] ~= "" then
setVehiclePlateText(veh, vehicle["plateText"])
else
setVehiclePlateText(veh, tostring("PL "..vehicle["id"]))
end
setElementFrozen(veh, (vehicle["frozen"]) > 0)
if vehicle["paintjob"] ~= 3 then
setVehiclePaintjob(veh, vehicle["paintjob"])
end
setElementHealth(veh, vehicle["health"])
setElementData(veh,"vehicle:spawn",true)
setElementData(veh,"vehicle:id", vehicle["id"])
if tostring(vehicle.electric) ~= "false" and tostring(vehicle.electric) == "true" then
setElementData(veh, "vehicle:electric", true)
setElementData(veh, "vehicle:energy", vehicle.energy)
else
setElementData(veh,"vehicle:fuel", vehicle["fuel"])
end
setElementData(veh,"vehicle:desc", vehicle["text"] or false)
setElementData(veh,"vehicle:mileage", vehicle["mileage"])
setElementData(veh,"vehicle:driver", vehicle["driver"])
setElementData(veh,"vehicle:ownedGroup", vehicle["ownedGroup"])
setElementData(veh,"vehicle:ownedPlayer", vehicle["ownedPlayer"])
setElementData(veh,"vehicle:mk1", vehicle["mk1"])
setElementData(veh,"vehicle:mk2", vehicle["mk2"])
setElementData(veh,"vehicle:mk3", vehicle["mk3"])
setElementData(veh,"vehicle:mk4", vehicle["mk4"])
setElementData(veh,"vehicle:rh", vehicle["rh"])
setElementData(veh,"vehicle:pojemnosc", vehicle["silnik"])
setElementData(veh,"vehicle:bak", vehicle["bak"])
setElementData(veh,"vehicle:enginetype", vehicle["engine"])
setElementData(veh,"vehicle:lgbt", vehicle["lgbt"])
setElementData(veh,"taxi:addon", vehicle["taxi"])
if not (vehicle["licznik"] == "brak") then
setElementData(veh,"veh:licznik",vehicle["licznik"])
end
if not (vehicle["Custom_PaintJob"] == "brak") then
exports["Qmix_PaintJob"]:Install_PaintJob(veh,vehicle["Custom_PaintJob"])
setElementData(veh,"veh:Custom_PaintJob",vehicle["Custom_PaintJob"])
end

if tonumber(vehicle["maskownice"]) == 1 then
exports["Qmix_PaintJob"]:loadNeverToPedalMaska2(veh)
setElementData(veh,"veh:maskownice",true)
end
if tonumber(vehicle["colorVeh"]) == 1 then
setElementData(veh,"vehicle:color",true)
end

setVehicleHandling(veh, "engineType", vehicle['engine'])
neoQ=split(vehicle["neony"], ",")
if tonumber(neoQ[1]) == 1 then
setElementData(veh,"vehicle:neon",{
color = {neoQ[2],neoQ[3],neoQ[4]},
left = true,
right = true,
front = true,
rear = true,
type = neoQ[5],
})
end

neoQ1=split(vehicle["felgi_mal"], ",")
if tonumber(neoQ1[1]) == 1 then
setElementData(veh,"vehicle:wheelColor",{neoQ1[2],neoQ1[3],neoQ1[4],neoQ1[5]})
end


if tonumber(vehicle["deluxomode"]) == 1 then
setElementData(veh,"vehicle:deluxo",{state=true,mode=false})
else
setElementData(veh,"vehicle:deluxo",{state=false,mode=false})
end

if tonumber(vehicle["hovermode"]) == 1 then
setElementData(veh,"vehicle:hover",{state=true,mode=false})
else
setElementData(veh,"vehicle:hover",{state=false,mode=false})
end

if tonumber(vehicle["ogranicznik"]) == 1 then
setElementData(veh,"vehicle:ogranicznik",{state=true,mode=false})
else
setElementData(veh,"vehicle:ogranicznik",{state=false,mode=false})
end
local mk1 = vehicle['mk1']
local mk2 = vehicle['mk2']
local mk3 = vehicle['mk3']
local mk4 = vehicle['mk4']
local poj = vehicle["silnik"]
local xfour = vehicle['naped']

if tonumber(xfour) == 1 then
setVehicleHandling(veh,"driveType","awd")
end

local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")

if poj == '1.4' then
setVehicleHandling(veh,"engineAcceleration",fast-0.5)
setVehicleHandling(veh,"maxVelocity",maxfast-20)
setVehicleHandling(veh,"mass",masa)
setVehicleHandling(veh,"tractionMultiplier",xd)
setVehicleHandling(veh,"steeringLock",40)
elseif poj == '1.6' then
setVehicleHandling(veh,"engineAcceleration",fast)
setVehicleHandling(veh,"maxVelocity",maxfast)
setVehicleHandling(veh,"mass",masa)
setVehicleHandling(veh,"tractionMultiplier",xd)
setVehicleHandling(veh,"steeringLock",40)
elseif poj == '1.8' then
setVehicleHandling(veh,"engineAcceleration",fast+2)
setVehicleHandling(veh,"maxVelocity",maxfast+30)
setVehicleHandling(veh,"mass",masa+100)
setVehicleHandling(veh,"tractionMultiplier",xd)
setVehicleHandling(veh,"steeringLock",40)
elseif poj == '2.0' then
setVehicleHandling(veh,"engineAcceleration",fast+3.2)
setVehicleHandling(veh,"maxVelocity",maxfast+40)
setVehicleHandling(veh,"mass",masa+100)
setVehicleHandling(veh,"tractionMultiplier",xd)
setVehicleHandling(veh,"steeringLock",40)
elseif poj == '2.2' then
setVehicleHandling(veh,"engineAcceleration",fast+4.5)
setVehicleHandling(veh,"maxVelocity",maxfast+50)
setVehicleHandling(veh,"mass",masa+110)
setVehicleHandling(veh,"tractionMultiplier",xd)
setVehicleHandling(veh,"steeringLock",40)
end

if tonumber(mk1) ~= 0 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh,"engineAcceleration",fast+1.5)
setVehicleHandling(veh,"maxVelocity",maxfast+16)
setVehicleHandling(veh,"mass",masa+100)
setVehicleHandling(veh,"tractionMultiplier",xd+0.1)
setVehicleHandling(veh,"steeringLock",47)
setVehicleHandling(veh,"dragCoeff",coef-0.15)
end

if tonumber(mk2) ~= 0 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh,"engineAcceleration",fast+1.7)
setVehicleHandling(veh,"maxVelocity",maxfast+20)
setVehicleHandling(veh,"tractionMultiplier",xd+0.2)
setVehicleHandling(veh,"mass",masa+150)
setVehicleHandling(veh,"steeringLock",47)
setVehicleHandling(veh,"dragCoeff",coef-0.21)
end

if tonumber(mk3) ~= 0 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh,"engineAcceleration",fast+2.7)
setVehicleHandling(veh,"maxVelocity",maxfast+15)
setVehicleHandling(veh,"tractionMultiplier",xd+0.2)
setVehicleHandling(veh,"mass",masa+150)
setVehicleHandling(veh,"steeringLock",47)
setVehicleHandling(veh,"dragCoeff",coef-0.21)
end

if tonumber(mk4) ~= 0 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh,"engineAcceleration",fast+3.3)
setVehicleHandling(veh,"maxVelocity",maxfast+30)
setVehicleHandling(veh,"tractionMultiplier",xd+0.2)
setVehicleHandling(veh,"mass",masa+150)
setVehicleHandling(veh,"steeringLock",47)
setVehicleHandling(veh,"dragCoeff",coef-0.21)
end
local wariant = getElementModel(veh)

local variants=split(vehicle["variants"], ",")
--
if tonumber(vehicle["model"]) == 410 then
if tonumber(variants[1]) == 1 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh, "engineAcceleration", fast+30)
setVehicleHandling(veh, "maxVelocity", maxfast+270)
setVehicleHandling(veh,"mass",masa+350)
setVehicleHandling(veh, "numberOfGears", 5)
setVehicleHandling(veh, "tractionLoss", 1.3)
setVehicleHandling(veh, "dragMultiplier", 1.7)


end
if tonumber(variants[1]) == 0 then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh, "engineAcceleration", fast+30)
setVehicleHandling(veh, "maxVelocity", maxfast+270)
setVehicleHandling(veh,"mass",masa+350)
setVehicleHandling(veh, "numberOfGears", 5)
setVehicleHandling(veh, "tractionLoss", 1.3)
setVehicleHandling(veh, "dragMultiplier", 1.7)


end
end
setVehicleVariant(veh, variants[1], variants[2])
if wariant == 429 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 562 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 415 then
setVehicleVariant(veh, 4, 4)
end
if wariant == 477 then
setVehicleVariant(veh, 0, 1)
end
if wariant == 480 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 579 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 559 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 411 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 561 then
setVehicleVariant(veh, 0, 0)
end

[[if vehicle["blokada"] == "true" then
setElementData(veh,"vehicle:block", true)
setVehicleWheelStates(veh, 2, 2, 2, 2)
else
setElementData(veh,"vehicle:block", false)
end]]


for i,v in ipairs(split(vehicle["tuning"], ",")) do addVehicleUpgrade(veh, v) end
for i,v in ipairs(split(vehicle["panelstates"], ",")) do setVehiclePanelState(veh, i, tonumber(v)) end
setVehicleDamageProof(veh, true)
triggerClientEvent("enonek-veh-blips:createBlip", root, veh)
exports["Qmix_Tuning"]:Load_Tune(veh,vehicle)
end
end
outputDebugString("[Qmix_Vehicle] załadowano "..vehicles.." pojazdów.")
end
create_veh()
function save_veh(vehicle)
if getElementData(vehicle,"vehicle:spawn") then
if sourceResource and not whitelist[getResourceName(sourceResource)] then return end
-- Setting
local panelstates={}
local health=getElementHealth(vehicle)
local x,y,z=getElementPosition(vehicle)
local rx,ry,rz=getElementRotation(vehicle)
local desc=getElementData(vehicle,"vehicle:desc") or ""
local id=getElementData(vehicle,"vehicle:id")
if getElementData(vehicle, "vehicle:electric") then
energy = getElementData(vehicle, "vehicle:energy") or 0
fuel = 0
else
fuel = getElementData(vehicle,"vehicle:fuel")
energy = 0
end
local mileage=getElementData(vehicle,"vehicle:mileage")
local c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12=getVehicleColor(vehicle, true)
local driver=getElementData(vehicle,"vehicle:driver") or ""
local rent=getElementData(vehicle,"vehicle:rent") or ''
local player=getElementData(vehicle,"vehicle:ownedPlayer")
local group=getElementData(vehicle,"vehicle:ownedGroup")
local blokada=getElementData(vehicle,"vehicle:block")
local neon=getElementData(vehicle,"neony") or 0
local h1,h2,h3=getVehicleHeadLightColor(vehicle)
local paintjob=getVehiclePaintjob(vehicle)
local rear="Brak"
local frozen= isElementFrozen(vehicle) and 1 or 0
for i=0,6 do table.insert(panelstates, getVehiclePanelState(vehicle,i)) end
panelstates=table.concat(panelstates,",")
upgrades=getVehicleUpgrades(vehicle)
if not upgrades then upgrades={} end
upgrades=table.concat(upgrades, ",")
if getElementData(vehicle, "vehicle:lpg") then
lpg = getElementData(vehicle, 'vehicle:lpg')
else
lpg = 0
end
-- Query

local xyz = x..", "..y..", "..z..", "..rx..", "..ry..", "..rz
local color = c1..", "..c2..", "..c3..", "..c4..", "..c5.." ,"..c6..", "..c7..", "..c8..", "..c9..", "..c10..", "..c11..", "..c12
local color_lamp = h1..", "..h2..", "..h3
local query = exports['pystories-db']:dbSet("UPDATE Qmix_vehicle SET pos=?, rent=?, text=?, health=?, fuel=?, mileage=?, frozen=?, driver=?, color=?, panelstates=?, paintjob=?, tuning=?, headlights=?, ownedPlayer=?, neon=?, lpg=?, energy=? WHERE id=?",xyz,"0",desc,health,fuel,mileage,frozen,"Brak",color,panelstates,paintjob,upgrades,color_lamp,player,neon,lpg,energy,id)





--

local resname = sourceResource and getResourceName(sourceResource)
[[ if sourceResource then
outputServerLog("["..resname.."] | Aktulizacja pojazdów Qmix_Vehicle")
else
outputServerLog("[Qmix_Vehicle] | Aktulizacja pojazdów Qmix_Vehicle")
end]]
if (type(rent) == "table") then
local rr = string.format("%s", table.concat(rent, ',') )
local query2= exports['pystories-db']:dbSet("UPDATE Qmix_vehicle SET rent=? WHERE id=?",rr,id)
end
end
end

addCommandHandler("doprzechoauta", function(plr, cmd)
if getElementData(plr, "player:sid") == 1 then
for i,v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "vehicle:id") then
save_veh(v)
destroyElement(v)
end
end
end
end)


function getSettings(plr,code,value)
local sid=getElementData(plr,"player:sid")
if not sid then return end
if value == "faction" then
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=? AND sid=?", code, sid)
if result and #result > 0 then
return result[1].code
else
return false
end
end
if value == "organization" then
local result=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje WHERE uid=?", sid)
if result and #result > 0 then
return result[1].code
else
return false
end
end
if value == "owner" then
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=?", sid)
if result and #result > 0 then
return result[1].id
else
return false
end
end
end

addEventHandler("onVehicleExit", root, function(plr,seat)
if seat ~= 0 then return end
setVehicleEngineState(source, false)
setVehicleDamageProof(source, true)
save_veh(source)
end)

addEventHandler("onPlayerQuit", root, function()
local veh=getPedOccupiedVehicle(source)
if veh then
setVehicleDamageProof(source, true)
end
end)

addEventHandler("onResourceStop", resourceRoot, function()
for i,v in ipairs(getElementsByType("vehicle")) do
save_veh(v)
end
outputDebugString("[Qmix_Vehicle] Pojazdy zapisane!")
end)

--[[addEventHandler("onVehicleEnter", root, function(plr,seat)
if seat ~= 0 then return end
--setVehicleEngineState(source, false)
setElementData(source,"vehicle:driver",getElementData(plr, "player:nickname"))
end)]]

addEventHandler("onVehicleStartEnter", getRootElement(), function(plr,seat,jacked)
if seat == 0 then
local rent=getElementData(source, "vehicle:rent")
local group=getElementData(source, "vehicle:ownedGroup")
if group == "0" then group = "Brak" end
local player=getElementData(source, "vehicle:ownedPlayer")
if getElementData(plr, "player:level") == 4 then
return
end
if rent and (type(rent) == "table") then
for i,s in pairs(rent) do
if tonumber(s) == getElementData(plr,"player:sid") then
return end
end
end

local plrgroup = getElementData(plr,"player:organization")
if plrgroup then
if getSettings(plr,false,"organization") == group then return end
end
if player and player ~= getSettings(plr,false,"owner") then
outputChatBox("* Nie posiadasz kluczyków do tego pojazdu.", plr)
cancelEvent()
end
end
end)

addEventHandler("onVehicleStartEnter", getRootElement(), function(plr,seat,jacked)
if jacked then
if getElementData(source,"vehicle:ownedPlayer") == getElementData(plr,"player:sid") then return end
cancelEvent()
end
end)


addEventHandler('onVehicleStartEnter', getRootElement(), function(player, seat, jacked)
if seat ~= 0 then return end
if not getElementData(source, 'vehicle:id') then return end

local serial = getPlayerSerial(player)
local result = exports['pystories-db']:dbGet('select * from pystories_punish where serial = ? AND time>NOW()', serial)


if #result > 0 then
cancelEvent()
else
exports['pystories-db']:dbSet('delete from pystories_punish where serial = ?', serial)
end


end)

local categoryA={[463] = true,[462] = true,[461] = true,[581] = true,[448] = true,[468] = true,[471] = true,[521] = true,[522] = true,[523] = true}
local categoryB={[602] = true,[545] = true,[496] = true,[517] = true,[401] = true,[410] = true,[518] = true,[600] = true,[527] = true,[436] = true,[589] = true,[580] = true,[419] = true,[439] = true,[533] = true,[549] = true,[526] = true,[491] = true,[474] = true,[445] = true,[467] = true,[604] = true,[426] = true,[507] = true,[547] = true,[585] = true,[405] = true,[587] = true,[409] = true,[466] = true,[550] = true,[492] = true,[566] = true,[546] = true,[540] = true,[551] = true,[421] = true,[516] = true,[529] = true,[488] = true,[460] = true,
[510] = true,[509] = true,[481] = true,[586] = true,[472] = true,[473] = true,[493] = true,[595] = true,[484] = true,[430] = true,[453] = true,[452] = true,[446] = true,[454] = true,[485] = true,[552] = true,
[438] = true,[574] = true,[420] = true,[525] = true,[408] = true,[596] = true,[597] = true,[427] = true,[599] = true,[490] = true,[432] = true,[528] = true,[601] = true,[407] = true,[544] = true,[470] = true,[598] = true,[588] = true,
[532] = true,[443] = true,[486] = true,[531] = true,[543] = true,[422] = true,[583] = true,[478] = true,[605] = true,[554] = true,[530] = true,[418] = true,[572] = true,[582] = true,[536] = true,[575] = true,[534] = true,
[567] = true,[535] = true,[576] = true,[412] = true,[402] = true,[542] = true,[603] = true,[475] = true,[449] = true,[537] = true,[570] = true,[441] = true,[464] = true,[501] = true,[465] = true,[564] = true,[568] = true,[557] = true,[424] = true,[504] = true,[495] = true,[457] = true,[539] = true,[483] = true,[571] = true,[500] = true,
[444] = true,[556] = true,[429] = true,[411] = true,[541] = true,[559] = true,[415] = true,[561] = true,[480] = true,[560] = true,[562] = true,[506] = true,[565] = true,[451] = true,[434] = true,[558] = true,[494] = true,[555] = true,[502] = true,[477] = true,[503] = true,[579] = true,[400] = true,[404] = true,[489] = true,[505] = true,[479] = true,[442] = true,[458] = true,
[606] = true,[607] = true,[610] = true,[590] = true,[569] = true,[611] = true,[584] = true,[608] = true,[435] = true,[450] = true,[591] = true,[594] = true}
local categoryC={[403] = true,[406] = true,[413] = true,[414] = true,[416] = true,[423] = true,[428] = true,[431] = true,[433] = true,[437] = true,[440] = true,[455] = true,[456] = true,[459] = true,[482] = true,[498] = true,[499] = true,[508] = true,[514] = true,[515] = true,[524] = true,[538] = true,[573] = true}
local categoryL={[469] = true, [487] = true, [593] = true, [519] = true, [513] = true}
addEventHandler("onVehicleStartEnter", getRootElement(), function(plr,seat,jacked)
if seat == 0 then
if categoryA[getElementModel(source)] then
if exports["pystories-ustawienia-praca"]:getVehicleLicense(plr,"A",source) then
cancelEvent()
end
elseif categoryB[getElementModel(source)] then
if exports["pystories-ustawienia-praca"]:getVehicleLicense(plr,"B",source) then
cancelEvent()
end
elseif categoryC[getElementModel(source)] then
if exports["pystories-ustawienia-praca"]:getVehicleLicense(plr,"C",source) then
cancelEvent()
end
elseif categoryL[getElementModel(source)] then
if exports["pystories-ustawienia-praca"]:getVehicleLicense(plr,"L",source) then
cancelEvent()
end
end
end
end)

addEventHandler("onVehicleEnter", getRootElement(), function(plr,seat,jacked)
if seat ~= 0 then return end
if getElementData(source, "vehicle:id") and getElementData(source, "vehicle:spawn") then
local mk4 = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND mk4=?",getElementData(source, "vehicle:id"), "1")
local mk3 = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND mk3=?",getElementData(source, "vehicle:id"), "1")
local mk2 = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND mk2=?",getElementData(source, "vehicle:id"), "1")
local mk1 = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND mk1=?",getElementData(source, "vehicle:id"), "1")
local rh = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND rh=?",getElementData(source, "vehicle:id"), "1")
local np = exports['pystories-db']:dbGet("SELECT * FROM Qmix_vehicle WHERE id=? AND naped=?",getElementData(source, "vehicle:id"), "1")
if #mk1 > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00MK1",plr,255, 255, 255, true) end
if #mk2 > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00MK2",plr,255, 255, 255, true) end
if #mk3 > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00MK3",plr,255, 255, 255, true) end
if #mk4 > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00MK4",plr,255, 255, 255, true) end
if #rh > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00RH1",plr,255, 255, 255, true) end
if #np > 0 then outputChatBox("#ff8c00(ⓘ) #FFFFFFPomyślnie zaprogramowano #ff8c00Napęd 4x4",plr,255, 255, 255, true) end
end
end)










Ostatnio zmieniony przez N0TH1NG 2024-12-08, 10:31, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2024-05-23, 14:23


Leszek

Programista lua $ Mapper






Wiek: 21
Na forum: 2002 dni
Posty: 99
Nick w MP: Leszek

Piwa: 393

Respekt: 50

Jakie błąd dostaniesz? Co ci nie działa?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2024-05-23, 20:25


dwadiwad







Wiek: 18
Na forum: 884 dni
Posty: 2



Respekt: 50

Leszek, we dodaj na dc zadymiarz_122

Postaw piwo autorowi tego posta
 

 
Tagi: witam :: potszebuje :: cos :: nie :: dziala
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