function kupWaltona(thePlayer)
if getPedOccupiedVehicle(thePlayer) == walton then
if getPlayerMoney(thePlayer) >= rnd10 then
auto = createVehicle(478, -295.38782, 1192.37866, 19.74219)
warpPedIntoVehicle(thePlayer, auto)
takePlayerMoney(thePlayer, rnd10)
konto = getAccountName(getPlayerAccount(thePlayer))
setElementData(auto, "przebieg", rnd)
setElementData(auto, "paliwo", 20)
setElementData(auto, "vehid", vehID())
setElementData(auto, "bak", 35)
id = getElementData(auto, "vehid")
nadaj = "FC 0"..id..""
setVehiclePlateText(auto, nadaj)
setElementData(auto, "owner", konto)
setElementData(auto, "prywatne", true)
setVehicleOverrideLights(auto, 1)
local pojazdID = getElementModel ( auto )
local c1,c2,c3,c4 = getVehicleColor ( auto )
local x,y,z = getElementPosition ( auto )
local rotx, roty, rotz = getElementRotation ( auto )
local owner = getElementData(auto, "owner")
local przebieg = getElementData(auto, "przebieg")
local paliwo = getElementData(auto, "paliwo")
local bak = getElementData(auto, "bak")
local t0 = getVehicleUpgradeOnSlot(auto, 0)
local t1 = getVehicleUpgradeOnSlot(auto, 1)
local t2 = getVehicleUpgradeOnSlot(auto, 2)
local t3 = getVehicleUpgradeOnSlot(auto, 3)
local t4 = getVehicleUpgradeOnSlot(auto, 4)
local t5 = getVehicleUpgradeOnSlot(auto, 5)
local t6 = getVehicleUpgradeOnSlot(auto, 6)
local t7 = getVehicleUpgradeOnSlot(auto, 7)
local t8 = getVehicleUpgradeOnSlot(auto, 8)
local t9 = getVehicleUpgradeOnSlot(auto, 9)
local t13 = getVehicleUpgradeOnSlot(auto, 13)
local t14 = getVehicleUpgradeOnSlot(auto, 14)
local t15 = getVehicleUpgradeOnSlot(auto, 15)
local t16 = getVehicleUpgradeOnSlot(auto, 16)
local felgi = getVehicleUpgradeOnSlot(auto, 12)
local paintjob = getVehiclePaintjob(auto)
local hr, hg, hb = getVehicleHeadLightColor(auto)
local tablica = getVehiclePlateText(auto)
local wariant1, wariant2 = getVehicleVariant(auto)
local vmax = getVehicleHandling(auto).maxVelocity
local acceler = getVehicleHandling(auto).engineAcceleration
local id = getElementData(v, "vehid")
dbExec ( conn, "INSERT INTO OP_Vehicles (id, model, posx, posy, posz, rotx, roty, rotz, color1, color2, color3, color4, owner, przebieg, paliwo, bak, paintjob, hr, hg, hb, felgi, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t13, t14, t15, t16, tablica, wariant1, wariant2, vmax, acceler) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", id, pojazdID, x, y, z, rotx, roty, rotz, c1, c2, c3, c4, owner, przebieg, paliwo, bak, paintjob, hr, hg, hb, felgi, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t13, t14, t15, t16, tablica, wariant1, wariant2, vmax, acceler)
outputChatBox("Zakupi?e? auto marki: Walton za: "..rnd10.." $.", thePlayer, 255, 255, 255)
outputChatBox("?yczymy mi?ego u?ytkowania.", thePlayer, 255, 255, 255)
else
outputChatBox("Nie posiadasz pieni?dzy na t? inwestycj?.", thePlayer, 255, 255, 255)
end
end
end
addCommandHandler("zakupauto", kupWaltona)