Jump to content

Help Respawn Cars


HUNDEAD

Recommended Posts

[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1736: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1737: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1738: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1739: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1740: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1741: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1742: Bad argument @ 'gettok' [Expected string at argument 1, got nil]
[2023-09-24 15:32:17] WARNING: [RevivedRP]\factionsCrp\factionsFunc.lua:1743: Bad argument @ 'createVehicle' [Expected vector3 at argument 2, got boolean]
[2023-09-24 15:32:17] ERROR: [RevivedRP]\factionsCrp\factionsFunc.lua:1744: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]

 

function spawnCar ( Faction, tablePoz, tableCars, Data, r, g, b )
local vladelec = tostring( Faction )
local result = executeSQLQuery("SELECT ID, PLATE, PROBEG FROM Cars WHERE VLADELEC=?", tostring(vladelec))
    for i, v in ipairs(result) do
    local x = gettok ( tablePoz, 1, string.byte(", ") )
    local y = gettok ( tablePoz, 2, string.byte(", ") )
    local z = gettok ( tablePoz, 3, string.byte(", ") )
    local rx = gettok ( tablePoz, 4, string.byte(", ") )
    local ry = gettok ( tablePoz, 5, string.byte(", ") )
    local rz = gettok ( tablePoz, 6, string.byte(", ") )
    local rang = gettok ( tablePoz, 8, string.byte(", ") )
    tableCars = createVehicle ( v.ID, x, y, z, rx, ry, rz )
    setElementData ( tableCars, "Rang", tonumber(rang) )
    setElementData ( tableCars, "FactionCar", tostring(Faction) )
    setTimer(setElementRotation,1100,1,tableCars, rx, ry, rz )
    setElementData (tableCars, "Fuel", 20 )
    setElementData (tableCars, "Probeg", tonumber( v.PROBEG ) )
    setVehiclePlateText( tableCars, tostring( v.PLATE ) )
    addVehicleUpgrade ( tableCars, 1086 )
        if Faction == "HLS" or Faction == "HSF" or Faction == "HLV" then
        setVehicleColor( tableCars, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255 )
        elseif Faction == "RM" or Faction == "Meria" or Faction == "LKN" then
        setVehicleColor( tableCars, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255 )
        elseif Faction == "FBI" then
        setVehicleColor( tableCars, 50, 50, 50, 50, 50, 50, 255, 255, 255, 255, 255, 255 )
        local fload = ( ( 90 * 0.6 ) / 100 ) + 0.4
        setElementData ( tableCars, "toner", fload )
        exports.auto:setTonCar ( tableCars )
        elseif Faction ~= "RM" or Faction ~= "HLS" or Faction ~= "HSF" or Faction ~= "HLV" then
        setVehicleColor( tableCars, r, g, b, 255, 255, 255, 255, 255, 255, 255, 255, 255 )
        end
        if v.ID == 415 then
        exportHand ( tableCars )
        local UpVeh = getVehicleOriginalProperty ( tableCars, "engineAcceleration" )
        setVehicleHandling ( tableCars, "engineAcceleration", UpVeh+10 )
        local UpVeh2 = getVehicleOriginalProperty ( tableCars, "suspensionLowerLimit" )
        setVehicleHandling ( tableCars, "suspensionLowerLimit", UpVeh2+0.1 )
        addVehicleUpgrade ( tableCars, 1001 )
        addVehicleUpgrade ( tableCars, 1085 )
        end
    toggleVehicleRespawn ( tableCars, true )
    setVehicleIdleRespawnDelay ( tableCars, 60000*60 )
    setVehicleLocked ( tableCars, true )
    setElementData (tableCars, Data, true )
        if getElementModel ( tableCars ) == 451 and getElementData ( tableCars, "FBI" ) then
        addVehicleSirens(tableCars, 1, 2, true, true, true, false)
        end
    end
end

 

Help Please :<

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...