Jump to content
Sign in to follow this  
dan9of9

Respawn with x Weapon only

Recommended Posts

How can i get the playables to spawn with just handguns?

i found a few scripts for them,but they dont work.

i worked out how to do ctf with all the triggers and .sqs files,but this spawn with just x weapons is doing my head in.

pls help.

Share this post


Link to post
Share on other sites

been trying this in the unitspawn.sqs

but i cannot get it working,and im not sure if its from the init code on the player in the editor that is screwed,or this coding below in the .sqs that is wrong,

so i end up going round in circles ,,LOTS sad_o.gif

its also pretty difficult cos you have to quit the editor,load the multiplayer,just to try it. back forth back forth. (load times are pretty slow)

pls help

_unit = _this select 0

_unit removealleventhandlers "Killed"

_weapArray = weapons _unit

_magArray = magazines _unit

_primary = primaryweapon _unit

removeallweapons _unit

_unit addmagazine "15Rnd_9x19_M9"

_unit addmagazine "15Rnd_9x19_M9"

_unit addmagazine "15Rnd_9x19_M9"

_unit addweapon "M9"

Share this post


Link to post
Share on other sites

Init.sqf/sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addeventhandler ["killed",{_this execVM "unitrespawn.sqf"}];

Unitrespawn.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if((_this select 0) == player)then{

waitUntil {alive player};

_mags = ["15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9"];

_weaps = ["M9"];

removeallweapons player;

{player addmagazine _X} foreach _mags;

{player addweapon _X} foreach _weaps;

player addeventhandler ["killed",{_this execVM "unitrespawn.sqf"}];

};

Let me know if this works. wink_o.gif

Share this post


Link to post
Share on other sites

wow thanks for the response smile_o.gif

but it didnt work,i dont have .sqf files,so i tried this

in the player init i changed it to

player addeventhandler ["killed",{_this execVM "unitrespawn.sqs"}];

and the code in the unitrespawn.sqs i changed to:

if((_this select 0) == player)then{

waitUntil {alive player};

_mags = ["15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd

_9x19_M9"];

_weaps = ["M9"];

removeallweapons player;

{player addmagazine _X} foreach _mags;

{player addweapon _X} foreach _weaps;

player addeventhandler ["killed",{_this execVM "unitrespawn.sqf"}];

};

but they still spawn with m16 sad_o.gif

Share this post


Link to post
Share on other sites
Init.sqf/sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addeventhandler ["killed",{_this execVM "unitrespawn.sqf"}];

sorry,do i need to put this line in the players init field in the editor or in the init.sqs file i have?

Share this post


Link to post
Share on other sites

you star,it worked by me making an init.sqs file smile_o.gif thanks mate smile_o.gif

i will make a template up with your name on it for download ready to copy paste for everyone smile_o.gif

Share this post


Link to post
Share on other sites
...i dont have .sqf files...

Why don't you just use them then? Sqs is considered deprecated, you should at least try and get used to sqf. Just save the unitrespawn script as an .sqf, and put that first line of code in your Init.sqs (that doesn't have to be an .sqf though if you already have an Init.sqs, it's only one line after all), and then it should work. Besides I already provided the whole script, if you need to change the weapons just use the arrays I provided so you don't have to edit anything else (and possibly break it).

Edit: You're welcome then.

Share this post


Link to post
Share on other sites

A very simple way to have new weapons on respawn is to add a trigger with condition alive player and activates with [] exec "rearmscript.sqs".

Inside the script I write something like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

removeallweapons player

player setdammage 0

player setcaptive true

player addRating 1000000

;setdammage to counter the wounded on respawn bug

;setcaptive and rating for CTF play

player AddMagazine "15Rnd_9x19_M9"

player AddMagazine "15Rnd_9x19_M9"

player AddMagazine "15Rnd_9x19_M9"

player AddMagazine "15Rnd_9x19_M9"

player AddMagazine "15Rnd_9x19_M9"

player AddMagazine "15Rnd_9x19_M9"

player AddWeapon "M9"

player SelectWeapon "M9"

exit

Remember that a guy can carry six pistol mags, don't settle for less! Bullets can run low really quickly with such inaccurate toys.

Share this post


Link to post
Share on other sites

Why even bother with weapons?

Use this script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

removeAllWeapons Player

~1

player playMove "AmovPercMstpSnonWnonDnon_exerciseKata"

Exit

Now, sit back and watch your guy fight with Kung-Fu!

;p

Share this post


Link to post
Share on other sites
A very simple way to have new weapons on respawn is to add a trigger with condition alive player and activates with [] exec "rearmscript.sqs".

That doesn't work (not as desired at least), and no offense but my script is still better (especially since it's in .sqf). Speaking of that, I must say that I've only seen one or two other people using .sqf format, and it's disappointing. Sorry to say this but if you intend to continue scripting seriously you'll need to learn how to use .sqf sooner or later. And I mean, it's not like it's all that different than .sqs, and it's easy to learn if you already know how to do things right in .sqs format.

Also, KaRRiLLioN, are you honestly telling me that you have nothing better to do than spam? wow_o.gif

Share this post


Link to post
Share on other sites

What is the desired result and how does the sqs script not satisfy it, and how is my seriousness on the line if I don't use sqf?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×