Jump to content
Sign in to follow this  
Heatseeker

Available weaponry = unit class?

Recommended Posts

Hi there.

I would like to encourage the members of a playable squad to stick to their roles (grenadier, assault riflemen, ATspecialist, etc), at base i would like to have a crate where each player would be able to retrieve a weapon that matches his class (incase he looses his weapon in the field).

[*] Only a grenadier could take a M16A2GL or a M16A4_GL.

[*] Only the ATspecialist could take a M136 launcher.

But im a bit confused about how to achieve this... i was thinking about running a weapon loadout script on a crate (local to the player) and checking for class but i dont know if the contents of a crate can even be local?

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

{

_cratew addweaponcargo ["M136",1]

};

Im a bit lost betwean syntax, locality and JIP..

Any pointers would be apretiated smile_o.gif .

Share this post


Link to post
Share on other sites

How do i check if a crate has a specific weapon in it?

Can the content of a crate (placed in the editor) be local to the player? If not can i createvehicle a crate local to the player only?

Why doesnt Arma have removeweapon(s)cargo/removemagazine(s) cargo comands?

Where are my gurus?

whistle.gif .

Share this post


Link to post
Share on other sites

I don't comment on anything else but the "can contents of the crate be local".

You can fake the contents of the ammo box. Do not have anything created initially, but only after a player has requested weapons, and has been given the appropriate choices, you can start then creating only the weapon the player selects (from his limited selection).

Could require a custom dialog. OR detection of which player is close to the crate, and then quickly modify the contents of the crate before the player gets close-enough to look into it.

You can include into that a system in which the server keeps book what weapons & ammo have been given away, if you want to have a limited, fixed number of certain weapons and ammo. Or if you want to live your life simple, just forget about this and give the players as many weapons (of the types accepted to them) as they want.

Edit: and what does createVehicleLocal do to your problem? Help or not? But the weapons can't be local I think: other players must see your weapon so it can't be local. But yeah, maybe the crate can be local? But are the weapons inside it then local or global? If a weapon inside a local crate is taken out of the crate, will it become global if it was originally local? I never used createVehicleLocal so this is speculation.

Share this post


Link to post
Share on other sites

A dialog with an adaction atached to a barrack would be nice but i dont want to discard the crate idea that easily.

If i createvehiclelocal a crate on a marker position i will create 1 crate for each client, correct?

If each crate is local to its client only said client will have access to its content, correct?

I'll have more time to think about it tomorrow goodnight.gif ..

edit:

If we had a comand: removeweaponcargo ["weaponname",amount] this simple block would work, no?

Quote[/b] ]

if ("SoldierWPILOT" == typeOf player) then

{

_crate addweaponcargo ["MP5A5",1];

}

else

{

_crate <span style='color:red'>removeweaponcargo</span> ["MP5A5",1];

};

I cant imagine why removeweaponcargo doesnt exist??

Also, if i only want to add an MP5A5 to a crate if one isnt already in there i have no way to check this and use it as a condition confused_o.gif .

Share this post


Link to post
Share on other sites
I cant imagine why removeweaponcargo doesnt exist??

It does, but in form of clearWeaponCargo.

createVehicleLocal to create unique crates for every player seems to be good solution for me.

Or you can add action to every player and they'll be rearmed in script (using addweapon and addmagazine). But it's bypass of problem, not solution.

Share this post


Link to post
Share on other sites
I cant imagine why removeweaponcargo doesnt exist??

It does, but in form of clearWeaponCargo.

createVehicleLocal to create unique crates for every player seems to be good solution for me.

Or you can add action to every player and they'll be rearmed in script (using addweapon and addmagazine). But it's bypass of problem, not solution.

Clearweaponcargo removes all weapons from a vehicle or crate, not a specific one.

createVehicleLocal would be tricky because i would need to ensure that the crate would only have 1 weapon of its type (how could i do that? ).

Add action workaround should do fine though smile_o.gif .

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  

×