greu

CUSTOM HARDPOINTS

Recommended Posts

Hello
I am adding new items to the store,
everything appears and is sold, but the amount is not deducted, that is, you can buy endlessly

    

code/hardpoints.gsx

///////////////////////////////////////
    //    YOUR CUSTOM HARDPOINTS HERE    //
    
   addHardpoint( "arm", "Protection", ps\_killstreak::arm, undefined );
    
    ///////////////////////////////////////

code/dvars.gsx

    // Hardpoints shop - required credits
    addDvar( "arm_shop", "int", 10, 1 );  <-------
    addDvar( "radar_shop", "int", 30, 1 );
    addDvar( "airstrike_shop", "int", 700, 1 );
    addDvar( "helicopter_shop", "int", 1800, 1 );
    addDvar( "artillery_shop", "int", 1000, 1 ); 
    addDvar( "asf_shop", "int", 1000, 1 );
    addDvar( "agm_shop", "int", 150, 1 );
    addDvar( "predator_shop", "int", 2800, 1 );
    addDvar( "ac130_shop", "int", 3800, 1 );
    addDvar( "mannedheli_shop", "int", 5000, 1 );
    addDvar( "nuke_shop", "int", 6000, 1 );
    addDvar( "carepackage_shop", "int", 70, 1 );
    addDvar( "cuav_shop", "int", 30, 1 );

 

_killstreak.gsx

arm()
{   
    wait 0,5;
    self SetPerk( "specialty_armorvest" );
    self.maxhealth=100;
    self.health = self.maxhealth;
    wait 0.5;
    self waittill("death");
    self unSetPerk( "specialty_armorvest" );
    self.maxhealth=30;
    self.health = self.maxhealth;
}

How to fix it?

thanks

Edited by greu

Share this post


Link to post
Share on other sites

You need to return a boolean if the buy was successful. You need an entry function and from there thread your arm() function and return true.

entry()
{
  // Whatever checks you might want
  
  thread arm();
  
  return true;
}

arm()
{
  ...
}

 

Obviously "addHardpoint( "arm", "Protection", ps\_killstreak::arm, undefined );" has to be changed to "addHardpoint( "arm", "Protection", ps\_killstreak::entry, undefined );"

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.