Thread: CS_OnBuyAttempt
View Single Post
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-13-2016 , 19:56   Re: CS_OnBuyAttempt
Reply With Quote #7

Quote:
Originally Posted by Netsys View Post
Smiley you must use CS_OnBuy instead of CS_OnBuyAttempt
Same result bro, the problem is try to buy a item that can used only by CT team like defuser.
I am simple checking if user has defuse or not, but if he is tr i need to add a check to team until here ok.

But in CstrikeHacks.cpp

Code:
if (HasInternalCommandForward && *UseBotArgs && MF_ExecuteForward(ForwardInternalCommand, client, *BotArgs) > 0)
  {
    return;
  }

  if (HasOnBuyAttemptForward && CurrentItemId && MF_ExecuteForward(ForwardOnBuyAttempt, client, CurrentItemId) > 0)
  {
    return;
  }
Someone can try to pass TeamId to forward? that will be welcome in this cases not?
@Arkshine the real problem is case if you will deduce money from player, or cs_get_user_defuse function need to always return FALSE in case of teamTR player.

Sorry again if i cannot explain better.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 02-13-2016 at 19:57.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY