Jump to content
  • 0

Help Please with calling a script from a script for static weapons.


shay2020

Question

/////NONE OF THESE SCRIPTS ARE MINE. FULL CREDIT TO THOSE THAT CREATED THEM???

 

Hi all, hopefully you'll be able to solve this for me.Although I've been playing for years, i'm relatively new to the scripting side. And before anyone says use the search function, I've been trying that for 4 days with no help. I am trying to call a script from within a script but it doesn't seem to work. The best thing I can do is post the code and hope someone points me in the proper direction. Many thanks in advance.

 

The reason I am trying to call this particular script is it spawns the weapon where the player is located, either on the ground or on my base. Other scripts for this don't seem to have that sorted.

I'm using RC option to call the first script, with an M240 as the trigger. If I call the second script from the RC option it works fine, but obviously doesn't look for required items, just takes from inventory.

 

so this is what i have. I'm trying to call from here. It tells me I need the items if I don't have, but when I do have it does nothing

 

  Reveal hidden contents

and this is what I'm trying to call

  Reveal hidden contents

Again, thanks for any help.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi Mig, thanks for the reply. Tried and still doesn't work. Here's how it goes:-

empty all items from inv into backpack

RC on m240 and click build dshkm, tells me i need 3 poles, good

add poles, RC on m240, tells me i need 1 scrap, good

add scrap, RC on m240 tells me i need 4 mags, good

add 4 mags Rc on m240 and nothing happens, hence the slight confusion right now

Thanks again.

 

Link to comment
Share on other sites

  • 0
  On 11/10/2020 at 9:56 PM, shay2020 said:

Hi Mig, thanks for the reply. Tried and still doesn't work. Here's how it goes:-

empty all items from inv into backpack

RC on m240 and click build dshkm, tells me i need 3 poles, good

add poles, RC on m240, tells me i need 1 scrap, good

add scrap, RC on m240 tells me i need 4 mags, good

add 4 mags Rc on m240 and nothing happens, hence the slight confusion right now

Thanks again.

 

Expand  

Change this

_hasitems = [["ItemPole",3], "PartGeneric", ["100Rnd_762x51_M240",4]] call player_checkItems;

 

if(_hasitems} then {

     
      execVM "dshkm\DSHkM_Gue.sqf";         
 
        
    };

To this :

_hasitems = [["ItemPole",3], "PartGeneric", ["100Rnd_762x51_M240",4]] call player_checkItems;

 

if(_hasitems) then {

     
      execVM "dshkm\DSHkM_Gue.sqf";         
 
        
    };

and try.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...