Jump to content
  • 0

Spawn Vehicle help


Guffmaker

Question

Guys,
 
Trying to use a mix of Dirty Sanchez and Ghostrider scripts to spawn specific vehicles at permanent AI bases on Chernarus.
My test script is below and worked for a day and then stopped.  Now the Vehicle spawns but disappears when I get within 200m of it.

if (isServer) then {

_vehicle_99 = objNull;

if (true) then
{
_veh = createVehicle ["B_G_Offroad_01_armed_EPOCH", [12693.5,10058.6,0], [], 0, "CAN_COLLIDE"];
_veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
_veh setVariable["LAST_CHECK",1000000000000];
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
_slot = EPOCH_VehicleSlots select 0;
_item setVariable ['VEHICLE_SLOT',_slot,true];
EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
publicVariable 'EPOCH_VehicleSlotCount';
_veh call EPOCH_server_setVToken;



};

 

}:
The .rpt log points to the EPOCH_VehicleSlotsLimit line but I can't see anything wrong.

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

:(Thx 1Man, didn't help
 
The only reference to it in the rpt is:
9:15:22 Error in expression <00000000000];
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_Vehic>
9:15:22 Error position: <EPOCH_VehicleSlotsLimit + 1;
EPOCH_Vehic>
9:15:22 Error Undefined variable in expression: epoch_vehicleslotslimit
9:15:22 File x\addons\custom\serverside\vehicle2.sqf, line 10

 

Like I said weirdly it was working fine for multiple vehicles then it just stopped!

Link to comment
Share on other sites

  • 0

:(Thx 1Man, didn't help

 

The only reference to it in the rpt is:

9:15:22 Error in expression <00000000000];

EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;

EPOCH_Vehic>

9:15:22 Error position: <EPOCH_VehicleSlotsLimit + 1;

EPOCH_Vehic>

9:15:22 Error Undefined variable in expression: epoch_vehicleslotslimit

9:15:22 File x\addons\custom\serverside\vehicle2.sqf, line 10

 

Like I said weirdly it was working fine for multiple vehicles then it just stopped!

 

must spawn it serverside, else they going to be deleted!

Link to comment
Share on other sites

  • 0

I'm using nedfox's Community.pbo framework in @epochhive/addons.

 

I add the sqf to a folder called serverside and add a compile line to fn_init.sqf to call it.

I'm running 2 scripts from there - one to call containers with specific contents and their markers that is working perfectly, the other one is to place specific vehicles at specific places - as above - broken.

I've never actually tried calling it from the mission file..... (might be worth a test I suppose)

 

Thanks again.

Link to comment
Share on other sites

  • 0

I'm using nedfox's Community.pbo framework in @epochhive/addons.

 

I add the sqf to a folder called serverside and add a compile line to fn_init.sqf to call it.

I'm running 2 scripts from there - one to call containers with specific contents and their markers that is working perfectly, the other one is to place specific vehicles at specific places - as above - broken.

I've never actually tried calling it from the mission file..... (might be worth a test I suppose)

 

Thanks again.

 

This is how i spawn vehicles

if (isServer) then {
_veh = ObjNull;
    _veh = createVehicle["B_Heli_Light_01_EPOCH", [14273.1, 13115.7, 8.35157], [], 0, "NONE"];
	_veh setDir 353.965;
    _veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh setVariable["LAST_CHECK",1000000000000];
                _veh call EPOCH_server_setVToken;    
            addToRemainsCollector[_veh];	
        clearWeaponCargoGlobal    _veh;
        clearMagazineCargoGlobal  _veh;
        clearBackpackCargoGlobal  _veh;
    clearItemCargoGlobal       _veh;
};
Link to comment
Share on other sites

  • 0

Sorry Sadboy - same thing - its there but when I close to 200m or less it despawns....killing my brain!

 

then it is not server side vehicle.

 

I run it from mpmission init.sqf

if (isDedicated) then {

	[] execVM "\q\addons\vehicles\spawn.sqf";
			
};
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...