AdvancedParking v3.11.0 - Persistent vehicles! [ESX] [QB] [Standalone]

I am guessing that most of those happen when you purchase a vehicle, leave it and then restart the server and reconnect?

That is 99% an issue of your vehicle shop.
The plate needs to be set BEFORE your player gets set into it. From what i have seen, most shops set the player inside, and then start a callback to generate a new plate (which takes time in which AP already saved the old plate).

Look in your shop for “taskwarpped”, A few lines below that is “SetVehicleNumberPlateText”. Make sure that TaskWarpPed is BELOW SetvehicleNumberPlateText!

But that is not a 100% fix, as I found out with another buyer. I am working on a solution and will update the script asap (probably tomorrow).

1 Like

I’ll give it a look and see boss, thanks for the quick reply.

1 Like

So that may have fixed the issue. I’ll keep testing to be sure.

Another question, I use a few resources that allow vehicles to be transported on trailers and often I have issues with them going crazy or deleting the trailer if I leave the area while leaving vehicles on them. The developer of the trailers said it has to do with my persistent parking resource. Is there a fix for this?

unknown-4

1 Like

WEEEEEEEEEEEEE I’m in Space. Spaaaaaaaaace

Is it a free resource, so I can take a look at it? If it is a paid resource, point me to the creator. Maybe I can get into contact with him. I know a thing or two about physics / sync issues. Maybe we can just identify the issue together :smiley:

As you might know, I have my own Transport resource and that one does not pose any issues (well at least noone has reported any regarding AP).

AP does not interact with vehicles in any way apart from these:

  • Save their values
  • Spawn them if they don’t exist yet (e.g. after server restart) (which is (in theory) the only point where something like that could happen).

If the latter happens, then the vehicles won’t be attached anymore, as this simply does not get saved. But it looks like they are still attached in your picture, so at least in theory that means that AP has nothing to do with it.

Also AP cannot currently save trailers (as you simply cannot enter / exit them as a player). But I just got an idea on how to fix that.

Actually with addon trailers you can get in them. There’s a fake seat on the tongue of the trailer in which a player can sit in. :joy: I’ll message you the creator and see what can be done.

New update fixing a ton of issues and finally adding callbacks to retrieve vehicle positions from the server!

For this update you will need to install the kimi_callbacks resource (by me and free)

4 Likes

The mod is obfuscated or blocked by ip?
Can I test the mod on any server?

1 Like

None of my resources are IP locked nor obfuscated. Even my two C# scripts include their full source code.
You are allowed to change anything in those scripts or use code for yourself, as long as you don’t re-release any of it :slight_smile:

I currently do not give out test versions.
But if you decide to purchase this, I am available if you should have any problems. So far I got it working for everyone that asked me :smiley:

Does this only save owned vehicles? If it saves all can it be set to only save owned ones?

It saves all vehicles apart from the blacklisted ones as this is a standalone script.

It was made with the purpose in mind, that any vehicle gets saved. Including job vehicles and so on. Even if it saves NPC vehicles, then there is finally something to do for Mechanics :stuck_out_tongue:

But it should be easy to build another function into the blacklist function to only look for owned_vehicles if you want to do that. You are free to modify the script in any way (as long as you don’t re-release anything).

With this update, is the callbacks resource plug & play with AP?

Small update mainly fixing issues with the exports.
“kimi_callbacks” is not mandatory anymore for those that don’t need it but the exports will not work without it!

After this small update, it surely is :smiley:

Any snippet to make it possible to save only owned vehicles (ESX)?

That really depends on your own server. I won’t build that in.

If you use plates like “XXX 000” in your server, it is really easy to do. Look for the “IsVehicleBlacklisted” function in the cl_utils.lua and check for a plate with a space at char 4 and 8. If there is none, return true. That’s basically it.

Good idea to check if the number plate has spaces. In case anyone is interested, I’ve added this to the IsVehicleBlacklisted function.

    -- check plate type
    local plate = GetVehicleNumberPlateText(vehicle)
    a, whiteSpace = string.gsub(plate,"%s","")
    if tonumber(whiteSpace) == 0 then 
        return true
    end
1 Like

This broke my script, not sure why. can you include your config?

Pos your IsVehicleBlacklisted function here.

This should do it :slight_smile:

function IsVehicleBlacklisted(vehicle)
    -- check class
    local class = GetVehicleClass(vehicle)
    for i = 1, #Config.classesBlacklist, 1 do
        if (class == Config.classesBlacklist[i]) then
            return true
        end
    end

    -- check model
    local modelHash = GetEntityModel(vehicle)
    for i = 1, #Config.vehiclesBlacklist, 1 do
        if (modelHash == Config.vehiclesBlacklist[i]) then
            return true
        end
    end

    -- check plate type
    local plate = GetVehicleNumberPlateText(vehicle)
    local a, whiteSpace = string.gsub(plate,"%s","")
    if tonumber(whiteSpace) == 0 then 
        return true
    end

    return false
end

that plate type does not work throws a error when you add it