Jump to content
Fr3x

"There isn't a Vehicle near the NPC"

Recommended Posts

Hey everyone, i recently started to make and config a Altis Life server fro Arma 3 and it as everything good.. but when i buy a Modded car in the Car Shop i cannot put it on the Garage! and when the server reboot is not there.. someone can help me? plz? Thanks!

Share this post


Link to post
Share on other sites

Send your Client and Server RPTs from when you tried it (for the not showing after reboot mainly).

As for storing, it sounds like your modded cars aren't considered Air/Car/Ship via the config, so they don't store.
Add their classes, or their base class, to the list here: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/core/actions/fn_storeVehicle.sqf#L13

Share this post


Link to post
Share on other sites
9 hours ago, imthatguyhere said:

Send your Client and Server RPTs from when you tried it (for the not showing after reboot mainly).

As for storing, it sounds like your modded cars aren't considered Air/Car/Ship via the config, so they don't store.
Add their classes, or their base class, to the list here: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/core/actions/fn_storeVehicle.sqf#L13

Ehhhh.. i don´t know if the modded cars are classes or bases?  But there is a pastebin of mine fn_storevehicle

https://pastebin.com/kAMKTx2n

Share this post


Link to post
Share on other sites
10 hours ago, Fr3x said:

Ehhhh.. i don´t know if the modded cars are classes or bases?  But there is a pastebin of mine fn_storevehicle

https://pastebin.com/kAMKTx2n

As I said, you would add the class or base class (base classes are classes that contain other classes, just like you see in my link, "Air" isn't a vehicle's class) to the line I linked.

Share this post


Link to post
Share on other sites
2 hours ago, imthatguyhere said:

As I said, you would add the class or base class (base classes are classes that contain other classes, just like you see in my link, "Air" isn't a vehicle's class) to the line I linked.

So as you say, i need to put the car name? or class? but wich is the class? how i know?

Share this post


Link to post
Share on other sites
41 minutes ago, Fr3x said:

So as you say, i need to put the car name? or class? but wich is the class? how i know?

Not sure what you mean by "Car Name", but no you wouldn't put the display name of the vehicle in there. Classes, like you would put in config_vehicles or exist for any item. Ex: https://community.bistudio.com/wiki/Arma_3_CfgVehicles_WEST

Share this post


Link to post
Share on other sites
1 minute ago, imthatguyhere said:

Not sure what you mean by "Car Name", but no you wouldn't put the display name of the vehicle in there. Classes, like you would put in config_vehicles or exist for any item. Ex: https://community.bistudio.com/wiki/Arma_3_CfgVehicles_WEST

Yeah, i was talking about that, like if i have i bmw mod the name would be probably as an example car_bmw something like that right?

Share this post


Link to post
Share on other sites
Just now, Fr3x said:

Yeah, i was talking about that, like if i have i bmw mod the name would be probably as an example car_bmw something like that right?

It can be whatever they decided to make it.

Share this post


Link to post
Share on other sites
45 minutes ago, Fr3x said:

Yes, so where i put the class of the car?

I told you that first:

On 2/19/2019 at 1:10 PM, imthatguyhere said:

Click the link.

Share this post


Link to post
Share on other sites
28 minutes ago, imthatguyhere said:

So then you know the exact line in that file you need to add your classes to.

Ok, so like ["Car","Air","Ship" , etc.. ? right?

Share this post


Link to post
Share on other sites
On 2/21/2019 at 3:02 PM, imthatguyhere said:

Pastebin your "fn_storeVehicle.sqf" as well as your Client and Server RPTs from when you tried it.

Paste bin from where? what i need to do? please thanks

Share this post


Link to post
Share on other sites
12 hours ago, Fr3x said:

Paste bin from where? what i need to do? please thanks

That file I listed, and the entire Server RPT and Client RPT from when you tried it. Then link the 3 pastes here. Client RPTs are in "%localappdata%\Arma 3" and are timestamped based on when you ran ARMA 3.

Share this post


Link to post
Share on other sites

I've got a similar problem, what happens to me is that when i try saving the car the same message pops up but my mission doesnt have any mods. There are no errors on the RPT log, I dont know what to do...

Edit:

Vehicles cant be saved when bought but can get impounded and once it's on the garage you can store and take it out the times you want without problem

Edited by danesamoide
Adding information

Share this post


Link to post
Share on other sites
On 4/19/2019 at 1:28 AM, danesamoide said:

I've got a similar problem, what happens to me is that when i try saving the car the same message pops up but my mission doesnt have any mods. There are no errors on the RPT log, I dont know what to do...

Edit:

Vehicles cant be saved when bought but can get impounded and once it's on the garage you can store and take it out the times you want without problem

Same thing, when I buy car cant store in garage but if i Impound the car and pull from garage now can store vehicle.

Share this post


Link to post
Share on other sites
On 4/18/2019 at 7:28 PM, danesamoide said:

I've got a similar problem, what happens to me is that when i try saving the car the same message pops up but my mission doesnt have any mods. There are no errors on the RPT log, I dont know what to do...

Edit:

Vehicles cant be saved when bought but can get impounded and once it's on the garage you can store and take it out the times you want without problem

On 4/21/2019 at 10:12 AM, Patrik775702 said:

Same thing, when I buy car cant store in garage but if i Impound the car and pull from garage now can store vehicle.

It sounds like you have added some additional scripts that are causing the vehicle's info not to be correct on the vehicle. Did you install some sort of impound or insurance scripts? Pastebin full Client and Server RPTs from when you try it and get the message.

Share this post


Link to post
Share on other sites

I fixed it by adding:

Quote

player moveInDriver _vehicle;
sleep 1;
[] spawn life_fnc_storeVehicle;

onto your fn_vehicleShopBuy.sqf on core/shops which ends up looking like this:
 

Quote

#include "..\..\script_macros.hpp"
/*
    File: fn_vehicleShopBuy.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Does something with vehicle purchasing.
*/

params [["_mode",true,[true]]];

if ((lbCurSel 2302) isEqualTo -1) exitWith {hint localize "STR_Shop_Veh_DidntPick";closeDialog 0;};

private _className = lbData[2302,(lbCurSel 2302)];
private _vIndex = lbValue[2302,(lbCurSel 2302)];
private _vehicleList = M_CONFIG(getArray,"CarShops",(life_veh_shop select 0),"vehicles");
private _shopSide = M_CONFIG(getText,"CarShops",(life_veh_shop select 0),"side");


private _initalPrice = M_CONFIG(getNumber,"LifeCfgVehicles",_className,"price");

private "_buyMultiplier";
private "_rentMultiplier";

switch (playerSide) do {
    case civilian: {
        _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
        _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_CIVILIAN");
    };
    case west: {
        _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
        _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_COP");
    };
    case independent: {
        _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
        _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_MEDIC");
    };
    case east: {
        _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
        _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_OPFOR");
    };
};

private "_purchasePrice";

if (_mode) then {
    _purchasePrice = round(_initalPrice * _buyMultiplier);
} else {
    _purchasePrice = round(_initalPrice * _rentMultiplier);
};

private _conditions = M_CONFIG(getText,"LifeCfgVehicles",_className,"conditions");

if !([_conditions] call life_fnc_levelCheck) exitWith {hint localize "STR_Shop_Veh_NoLicence";};

private _colorIndex = lbValue[2304,(lbCurSel 2304)];

if (_purchasePrice < 0) exitWith {closeDialog 0;}; //Bad price entry
if (CASH < _purchasePrice) exitWith {hint format [localize "STR_Shop_Veh_NotEnough",[_purchasePrice - CASH] call life_fnc_numberText];closeDialog 0;};

private _spawnPoints = life_veh_shop select 1;
private _spawnPoint = "";

if ((life_veh_shop select 0) == "med_air_hs") then {
    if (nearestObjects[(getMarkerPos _spawnPoints),["Air"],35] isEqualTo []) exitWith {_spawnPoint = _spawnPoints};
} else {
    //Check if there is multiple spawn points and find a suitable spawnpoint.
    if (_spawnPoints isEqualType []) then {
        //Find an available spawn point.
        {
            if ((nearestObjects[(getMarkerPos _x),["Car","Ship","Air"],5]) isEqualTo []) exitWith {_spawnPoint = _x};
            true
        } count _spawnPoints;
    } else {
        if (nearestObjects[(getMarkerPos _spawnPoints),["Car","Ship","Air"],5] isEqualTo []) exitWith {_spawnPoint = _spawnPoints};
    };
};


if (_spawnPoint isEqualTo "") exitWith {hint localize "STR_Shop_Veh_Block"; closeDialog 0;};
CASH = CASH - _purchasePrice;
[0] call SOCK_fnc_updatePartial;
hint format [localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText];

//Spawn the vehicle and prep it.

private "_vehicle";

if ((life_veh_shop select 0) == "med_air_hs") then {
    _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"];
    waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait?
    _vehicle allowDamage false;
    _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0;
    _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]);
    sleep 0.6;
} else {
    _vehicle = createVehicle [_className, (getMarkerPos _spawnPoint), [], 0, "NONE"];
    waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait?
    _vehicle allowDamage false; //Temp disable damage handling..
    _vehicle setPos (getMarkerPos _spawnPoint);
    _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint));
    _vehicle setDir (markerDir _spawnPoint);
};

_vehicle lock 2;

[_vehicle,_colorIndex] call life_fnc_colorVehicle;
[_vehicle] call life_fnc_clearVehicleAmmo;
[_vehicle,"trunk_in_use",false,true] remoteExecCall ["TON_fnc_setObjVar",RSERV];
[_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true] remoteExecCall ["TON_fnc_setObjVar",RSERV];

_vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive.

//Side Specific actions.
switch (playerSide) do {
    case west: {
        [_vehicle,"cop_offroad",true] spawn life_fnc_vehicleAnimate;
    };
    case civilian: {
        if ((life_veh_shop select 2) isEqualTo "civ" && {_className == "B_Heli_Light_01_F"}) then {
            [_vehicle,"civ_littlebird",true] spawn life_fnc_vehicleAnimate;
        };
    };
    case independent: {
        [_vehicle,"med_offroad",true] spawn life_fnc_vehicleAnimate;
    };
};

_vehicle allowDamage true;
life_vehicles pushBack _vehicle;

//Always handle key management by the server
[getPlayerUID player,playerSide,_vehicle,1] remoteExecCall ["TON_fnc_keyManagement",RSERV];


player moveInDriver _vehicle;
sleep 1;
[] spawn life_fnc_storeVehicle;

if (_mode) then {
    if !(_className in LIFE_SETTINGS(getArray,"vehicleShop_rentalOnly")) then {
        if (life_HC_isActive) then {
            [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["HC_fnc_vehicleCreate",HC_Life];
        } else {
            [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["TON_fnc_vehicleCreate",RSERV];
        };
    };
};

if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
    if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
        advanced_log = format [localize "STR_DL_AL_boughtVehicle_BEF",_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];
    } else {
        advanced_log = format [localize "STR_DL_AL_boughtVehicle",profileName,(getPlayerUID player),_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText];
    };
    publicVariableServer "advanced_log";
};

closeDialog 0; //Exit the menu.
true;

 

This part of the script makes you get onto the car and save it automatically to the garage database, that fixed the problem.

Before testing this out check if you can save the vehicle on the garage from inside it, if that works this should work perfectly.

Share this post


Link to post
Share on other sites
On 4/24/2019 at 11:38 AM, danesamoide said:

I fixed it by adding:

Quote

While this hack may be useful for some people who ed up with you specific issue, this is not a thing that happens in the default framework, so this fix is really unique to your situation and is just a workaround for something else that is the real problem.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.