• 0
imdam

Failed To purchase vehicle:13

Question

Hello guys, I recently made a server for me and some friends to play on, I have been looking for hours now how to fix this dumb problem. >>
I added RHS,MAS,TRYK,HLC on my server, Added items and vehicle to the trader, But The vehicle trader (air/land) give me the error 13 . I tried some fix on this forum but nothings seems to do it, I have absolutely no clue and im getting desperate , The Guns,Ammo,clothes and stuff works well, But cant get the vehicle to spawn by the trader :/

Going to make my post clearer a bit 

--------Mod installed on my server and client-----------
[ASDG_JR  /// Exile ///Hlcmods /// infistar /// mas weapon and vehicle /// Both RHS // Tryk/]

Everything works except for the vehicles spawn by trader.

-----------------------------------------------------------------------------------------------------------

Here is my  ExileServer_system_trading_network_purchaseVehicleRequest

Spoiler

/**
 * ExileServer_system_trading_network_purchaseVehicleRequest
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_sessionID","_parameters","_vehicleClass","_pinCode","_playerObject","_salesPrice","_playerMoney","_position","_vehicleObject","_responseCode"];
_sessionID = _this select 0;
_parameters = _this select 1;
_vehicleClass = _parameters select 0;
_pinCode = _parameters select 1;
try 
{
    _playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
    if (isNull _playerObject) then
    {
        throw 1;
    };
    if !(alive _playerObject) then
    {
        throw 2;
    };
    if (_playerObject getVariable ["ExileMutex",false]) then
    {
        throw 12;
    };
    _playerObject setVariable ["ExileMutex", true];
    if !(isClass (missionConfigFile >> "CfgExileArsenal" >> _vehicleClass) ) then
    {
        throw 3;
    };
    _salesPrice = getNumber (missionConfigFile >> "CfgExileArsenal" >> _vehicleClass >> "price");
    if (_salesPrice <= 0) then
    {
        throw 4;
    };
    _playerMoney = _playerObject getVariable ["ExileMoney", 0];
    if (_playerMoney < _salesPrice) then
    {
        throw 5;
    };
    if !((count _pinCode) isEqualTo 4) then
    {
        throw 11;
    };
    if (_vehicleClass isKindOf "Ship") then 
    {
        _position = [(getPosATL _playerObject), 80, 10] call ExileClient_util_world_findWaterPosition;
        _vehicleObject = [_vehicleClass, _position, (random 360), true, _pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
    }
    else 
    {
        _position = (getPos _playerObject) findEmptyPosition [80, 175, _vehicleClass];
        if (_position isEqualTo []) then 
        {
            throw 13;
        };
        _vehicleObject = [_vehicleClass, _position, (random 360), true, _pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
    };    
    _vehicleObject setVariable ["ExileOwnerUID", (getPlayerUID _playerObject)];
    _vehicleObject setVariable ["ExileIsLocked",0];
    _vehicleObject lock 0;
    _vehicleObject call ExileServer_object_vehicle_database_insert;
    _vehicleObject call ExileServer_object_vehicle_database_update;
    _playerMoney = _playerMoney - _salesPrice;
    _playerObject setVariable ["ExileMoney", _playerMoney];
    format["setAccountMoney:%1:%2", _playerMoney, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
    [_sessionID, "purchaseVehicleResponse", [0, netId _vehicleObject, str _playerMoney]] call ExileServer_system_network_send_to;
}
catch 
{
    _responseCode = _exception;
    [_sessionID, "purchaseVehicleResponse", [_responseCode, "", ""]] call ExileServer_system_network_send_to;
};
if !(isNull _playerObject) then 
{
    _playerObject setVariable ["ExileMutex", false];
};
true

So I tried editing the number of ''else'' below the ship class , it didnt work , higher and lower . 
Im not a dev, im only a guy that wants to play with his friend on a cool server :)  Please ask any information you need to help , If its easier for you , my skype is : xueruomal 

Edited by imdam

Share this post


Link to post
Share on other sites

8 answers to this question

  • 0

i am kinda desperate, I removed all the mods i had on my server and im still getting the same error, I tried to get all the config i could find to original and somehow its still does this error O-o I have absolutely no clue.

Share this post


Link to post
Share on other sites
  • 0

is  there enough space for the vehicles to spawn around the traders? If the area is cluttered the script cant find a place to put the vehicle.

Share this post


Link to post
Share on other sites
Advertisement
  • 0

In your mission file, open config.cpp. Did you add the new items to BOTH sections? They need to be listed in the price section:

class B_mas_cars_Hilux_MG                           { quality = 1; price = 15000; };

and in the section that lists the items sold by the traders:

    class Trucks
    {
        name = "Trucks";
        icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
        items[] = 
        {

 

Share this post


Link to post
Share on other sites
  • 0

Change this: 

_position = (getPos _playerObject) findEmptyPosition [80, 175, _vehicleClass];

To this:

_position = (getPos _playerObject) findEmptyPosition [10, 300, _vehicleClass];

The first number (10) represents the radius in meters that needs to be clear for the vehicle to be placed. You have 80m as your setting. This is more than likely what's causing the problem. The server can't find a spot with an 80m radius that has no obstructions. And if you think about it, 80m radius is a 160m diameter. There's not a lot of places that have 160m that are clear of obstructions.

The second number (300) is the distance from the trader it will look for a clearing with a 10m radius. 175 is probably OK, but 300 gives you that extra bit of randomness and can offer the server more options of placing the purchased vehicle further away.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0
28 minutes ago, canuckbrian said:

Change this: 


_position = (getPos _playerObject) findEmptyPosition [80, 175, _vehicleClass];

To this:


_position = (getPos _playerObject) findEmptyPosition [10, 300, _vehicleClass];

The first number (10) represents the radius in meters that needs to be clear for the vehicle to be placed. You have 80m as your setting. This is more than likely what's causing the problem. The server can't find a spot with an 80m radius that has no obstructions. And if you think about it, 80m radius is a 160m diameter. There's not a lot of places that have 160m that are clear of obstructions.

The second number (300) is the distance from the trader it will look for a clearing with a 10m radius. 175 is probably OK, but 300 gives you that extra bit of randomness and can offer the server more options of placing the purchased vehicle further away.

Thanks for answering, yeah i tried changing those, didnt work :/ i finally managed to fix it by deleting my server and made a new one. 

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, BetterDeadThanZed said:

In your mission file, open config.cpp. Did you add the new items to BOTH sections? They need to be listed in the price section:


class B_mas_cars_Hilux_MG                           { quality = 1; price = 15000; };

and in the section that lists the items sold by the traders:


    class Trucks
    {
        name = "Trucks";
        icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
        items[] = 
        {

 

Yep i did ! , And i fixed it , Thanks for answering

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, r0fus said:

is  there enough space for the vehicles to spawn around the traders? If the area is cluttered the script cant find a place to put the vehicle.

yes, Thanks for answering, managed to fix it by deleting everything and try again :)

Share this post


Link to post
Share on other sites
  • 0

//////////////SOLVED/////////////
(I messed up somewhere,Deleted everything i tried again.)

Share this post


Link to post
Share on other sites
Advertisement

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.