Jump to content
Sign in to follow this  
legion7698

Only do x if have magazine y

Recommended Posts

Hey All,

So anouther day and I have anouther problem I'm hoping you kind gents can help me out with.

Trying to make a door breaching addon. The idea is to have a placable door (modeled this bit) that when you move up to will give you the action to breach it. Now to do this you will need a breaching charge in your inventory.

The way I'm planning on doing this is to add an action to the door that when you move near will display it for the player to do. If you have the breaching charge in your inventory then it will play an action, create a bang and all that rubbish, then the door will be gone, simple. If you dont have the breaching charge it will tell you to bugger off or whatever. My problem now comes in with how do I get it to detect if you have the breaching charge. I know the "hasweapon" command but the breaching charge is classed as a magazine for easier use.

So instead of

?(player hasweapon "Breachingcharge"): goto "BREACH"

I need something like

?(player hasmagazine "Breachingcharge"): goto "BREACH"

But as far as I'm aware there is no command "has magazine".

Any imput would be greatly appreciated.

Regards,

LEGION7698.

Share this post


Link to post
Share on other sites

Hey Celery,

Cheers for that, looked for ages but could'nt find anything like that.

Regards,

LEGION7698.

Share this post


Link to post
Share on other sites

Hey all,

Thought I'd bring this topic back up instead of starting a new one. My problem is the same as the above but this time I need to check if I have the type of magazine within a vehicle class. Since the above solution dosn't work I wonder if thier is a similer one for vehicles.

Regards,

LEGION7698.

Share this post


Link to post
Share on other sites

Hey all,

Since I've had no response I'll assume its becouse there is no appropriate command. So what I'll do is post up what I've got and ask for solution work arounds.

#begin
?"RC_GPMGBELT" in magazines _gpmg: goto "TRANS"
goto "end"
#TRANS
_gpmg removemagazine "RC_GPMGBELT"
_gunner addmagazine "JAM_W762M_100mag"
goto "begin"
#end

Now what this is for is a refined version of my deployable GPMG. When placed a slightly altered version of this is run. So if you have 7 mags when you deploy the GPMG you'll get 7 mags when you get into the now deployed GPMG. However I would like to do this in reverse as this stops the problem of having unlimited ammo (barring the amount of rounds left in a magazine). My problem is this

?"RC_GPMGBELT" in magazines _gpmg: goto "TRANS"

dosn't appear to work for a vehicle class. So dos anyone know of a workaround solution to this?

Regards,

LEGION7698.

Edited by LEGION7698

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  

×