I've been trying to get cargo weapons/magazines to respawn via various vehicle respawn scripts on a dedicated server and have failed miserably thus far. Â This modification I made to the above script seemed to almost do it, however it only seems to spawn the list of weapons from "weapon.sqs", and I cannot actually equip any of them. Â I thought locality was the issue all along but I just don't know what else to do. Â Is it possible to even do what I am attempting? Â Below are examples of the mpmission that I am running on a dedicated linux server, and then testing it from a game client. Â
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
[this] exec "first_weapons.sqs"; v = [this, "hum2", 10] execVM "vrs_AI_general.sqf"
Part of first_weapons.sqs
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_vehicle = _this select 0
; Add the items to the _vehicle
clearWeaponCargo _vehicle
clearMagazineCargo _vehicle
_vehicle addWeaponCargo ["M16A2", 24]
_vehicle addWeaponCargo ["M16A2GL", 24]
_vehicle addWeaponCargo ["M4", 24]
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">/*
VEHICLE RESPAWN SCRIPT SQF
Respawns vehicles when they are destroyed or cannot move
© May 2007 - norrin (norrins_nook@iprimus.com.au), based upon KaRRiLLioN's original vrs.sqf script.
Version: Â 1.0 Â Â Â Â Â Â Â Â Â Â Â
******************************************************************************************
*********************************
IMPORTANT: ADD A GAMELOGIC NAMED Server to the mission to prevent multispawn
To run this script place the following code in the init line of the vehicle:
v = [this, "vehicle name", x] execVM "vrs_AI_general.sqf"
where x is the time you wish to set for the vehicle destroyed respawn delay
Note: the vehicle name must be in quotation marks eg. if vehicle name's Hmm1 it must appear in the init line as "Hmm1"
******************************************************************************************
**********************************
Start VRS_Move.sqf
*/
private ["_vcl","_respawndelay","_dir","_pos","_type","_run","_delay"];
if (!local Server) exitWith {};
_vcl = _this select 0;
_name_vcl = _this select 1;
_respawndelay = _this select 2;
_dir = Getdir _vcl;
_pos = Getpos _vcl;
_type = typeOf _vcl;
_run = TRUE;
sleep 5;
for [{}, {_run}, {_run}] do
{
while {canMove _vcl} do Â
{
  sleep 1;
_delay = Time + _respawndelay;
};
_delay = Time + _respawndelay;
 while {!canMove _vcl && Time < _delay} do
{
  sleep 1;
};
if (!canMove _vcl && Time >= _delay) then
{
   deleteVehicle _vcl;
    _vcl = _type createVehicle _pos;
   _vcl setVehicleVarName _name_vcl;
    _vcl setdir _dir;
    sleep 1;
    _vcl setvelocity [0,0,0];
    _vcl setpos _pos;
 _InitString = "this addAction [""Load Weapons"", ""weapon.sqs"", this, 0, false, false, """"]";
 _vcl SetVehicleInit _InitString;
 processInitCommands;
    sleep 1;
    _vcl setvelocity [0,0,0];
   sleep 2;
 };
};
Part of weapon.sqs:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_vehicle = _this select 3
; Add the items to the _vehicle
clearWeaponCargo _vehicle
clearMagazineCargo _vehicle
_vehicle addWeaponCargo ["M16A2", 24]
_vehicle addWeaponCargo ["M16A2GL", 24]
_vehicle addWeaponCargo ["M4", 24]
Thanks in advance for any helpful input.