Jump to content

Impavido

Member
  • Content Count

    249
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Impavido

  • Rank
    Staff Sergeant
  1. I just got it working with your suggestions Bon! The first problem was less so due to your code and more so due to me not using ' or "" inside the string for the setvehicleinit command. So a silly oversight on my part wasted your time. However I now have it working because of your help. Thank you very much Bon.
  2. Thanks for the input Bon, but that does not appear to be working. The items stated in the setvehicelinit command do not appear at all.
  3. _box = nearestobject [player,"USSpecialWeaponsBox"] _box addweaponcargo ["M16A2",1]; _box addweaponcargo ["M16A2GL",1]; _box addweaponcargo ["M16A4",1]; _box addweaponcargo ["m16a4_acg",1]; _box addweaponcargo ["m16a4_acg_gl",1]; _box addweaponcargo ["m4a1",1]; _box addweaponcargo ["mp5a5",1]; _box addweaponcargo ["m4a1_aim",1]; _box addweaponcargo ["G36a",1]; _box addmagazinecargo ["30rnd_556x45_stanag",30]; _box addmagazinecargo ["30Rnd_556x45_G36",30]; _box addmagazinecargo ["30rnd_9x19_mp5",16]; _box addmagazinecargo ["1rnd_he_m203",16]; _box addmagazinecargo ["flarewhite_m203",6]; _box addmagazinecargo ["1Rnd_Smoke_M203",6]; I use the nearestobject command to compensate for the init of a newly placed box being only activated on the client of the player who built/placed it.
  4. I have a localized script on a MP client that will add weapons and ammo to the crate in front of the player. It adds the items to the crate and the player can see the items on the GEAR list, but they cannot pick the items up. Has anybody experienced this problem before?
  5. should it be: onplayerconnected [] exec "JIP.sqf" or onplayerconnected "[] exec ""JIP.sqf"""
  6. I already have created the group using creategroup. I put that ~1 delay before the creation of the WP thinking it would help, but it didnt.
  7. In-script, I create a group on the east team. I then spawn vehicles and add the crew. At the bottom of the script, I add waytpoints for the group that gets the position of a game logic named WHQLogic. (highlighted in RED) When I use a similar script to spawn infantry, they are created and follow the WP just fine. But if I spawn ARMOR, the vehicles just sit there with engines idle. What is the nature of this problem? :confused: _veh1 = createVehicle [_class, _start, [], 0, "none"]; ~.1 _veh2 = createVehicle [_class, _start2, [], 0, "none"]; ~.1 _gun1 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _drive1 = AQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _comm1 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _gun1 assignAsgunner _veh1; _gun1 moveingunner _veh1; _comm1 assignascommander _veh1; _comm1 moveincommander _veh1; _drive1 assignAsdriver _veh1; _drive1 moveindriver _veh1; _gun1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; _drive1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; _comm1 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; _gun2 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _drive2 = AQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _comm2 = HQAtt1 createUnit ["RU_Soldier_Crew", _start, [], 0, "NONE"]; _gun2 assignAsgunner _veh2; _gun2 moveingunner _veh2; _comm2 assignascommander _veh2; _comm2 moveincommander _veh2; _drive2 assignAsdriver _veh2; _drive2 moveindriver _veh2; _gun2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; _drive2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; _comm2 addeventhandler ["killed", {_this exec "respawn\hidenow.sqs"}]; ~1 [color="Red"] _WHQ = (getpos WHQlogic) _AS1WP = HQAtt1 addwaypoint [_WHQ,50] _AS1WP setwaypointtype "SAD"[/color]
  8. Thanks for the clarification shk and whisper. ---------- Post added at 10:05 PM ---------- Previous post was at 09:51 PM ---------- Oh, and this is a minor detail evading me: JIP.sqf is run on the server automatically when a player connects?
  9. Forgive my poor SQF syntax knowledge but I want to make sure I follow this part: The above code essentially defines JIP as a variable that becomes TRUE if the client is not the server and the player slot chosen is empty. Then the following part waits until the slot is filled. Am I correct in this?
  10. Impavido

    Saving Weapons

    I've added the eventhandler as suggested above, and am using the script below: _unit = _this select 0; //the killed unit _weapons=weapons _unit; //get weapons _magazines=magazines _unit; //get mags waituntil {alive _unit}; //waits for the unit to respawn (is alive again) removeallitems _unit; removeallweapons _unit; {_unit addweapon _x;}foreach _weapons; //add weapons {_unit addmagazine _x;}foreach _magazines; //add magazines The player does not respawn with their pre-death weapons. What am I missing?
  11. I am attempting to make a JIP.sqf, and this is both the first time I've trie to use one AND I am very fuzzy on sqf format. I have tried to adapt Xeno's example to my own needs. I have a map in which each player receives a score as the game proceeds. I would like that score to be reset to 10000 when they JIP. Will this butcher-job syntax work? i_am_a_server = false; i_am_a_client = false; player_initialized = false; if (player==General) then { Wgencash=10000; publicvariable "Wgencash"; }; }; } else { // I'm a client but the player object may not be initialized yet i_am_a_client = true; [] spawn { waitUntil {!isNull player}; player_initialized = true; }; }; if (player==WENG) then { WENGcash=10000; publicvariable "Wengcash"; }; }; } else { // I'm a client but the player object may not be initialized yet i_am_a_client = true; [] spawn { waitUntil {!isNull player}; player_initialized = true; }; }; if (player==pilot1) then { WPIL1cash=10000; publicvariable "Wpil1cash"; }; }; } else { // I'm a client but the player object may not be initialized yet i_am_a_client = true; [] spawn { waitUntil {!isNull player}; player_initialized = true; }; }; if (player==w1) then { W1cash=10000; publicvariable "W1cash"; }; }; } else { // I'm a client but the player object may not be initialized yet i_am_a_client = true; [] spawn { waitUntil {!isNull player}; player_initialized = true; }; };
  12. What syntax would I use for SetVehicleInit if the string has a string in it? Would it be: unit setVehicleInit "[unit] exec "nameofscript.sqs"" ??
  13. Thanks very much for the example dfear!
×