CS_OnBuyAttempt
Hi i am again here :D
A player have reported to me that function is broken: PHP Code:
The money will be deduced if TR not have defuse, and i know that i can add a team check to fix that. But the real problem is that player have defuser command in autobuy.txt, and CS is trying to buy a defuse even if he is TR. Ps. It is possible to add a team in function header, soo i not need to retreive cs_get_user_team? Thanks for read, and sorry if is not a valid issue here. :bee: |
Re: CS_OnBuyAttempt
Have you tried using CS_OnBuy instead?
|
Re: CS_OnBuyAttempt
Can you try to rephraze your issue? I really don't get.
Remember this: - CS_OnBuyAttempt: called when player issue a command (basically that would be the same as using ClientCommand). So, it's called before anything else, before any game checks to see if you can actually buy the item and such. - CS_OnBuy: called when player is about to get the item. Game checks are done, and you can sure to receive what you bought. Money is not yet taken. So, what are you trying to do, what is the actual issue with those two forwards? |
Re: CS_OnBuyAttempt
He's trying to reduce $200 for those who purchase defuse-kit (CTs Only). As he states, for some reason T-Side can simulate a defuse-kit purchase through "autobuy". So it would just keep reducing $200 each time a T-side player autobuys.
|
Re: CS_OnBuyAttempt
I don't see how it can happen. Server-side, there is a team check, whatever you're using old-menu with or alias "defuser".
I've tried myself, putting autobuy.txt in my Steam\steamapps\common\Half-Life\czero ; then typing "autobuy" in the console, result: I can buy it when I'm CT, I can't when I'm T (and money is not taken) Did I miss something? |
Re: CS_OnBuyAttempt
Smiley you must use CS_OnBuy instead of CS_OnBuyAttempt
|
Re: CS_OnBuyAttempt
Quote:
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) @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. |
Re: CS_OnBuyAttempt
Quote:
Or are you trying to give free defuser or something? if so, then use CS_OnBuy, forward will not be called if you are T and you try to buy defuser. |
Re: CS_OnBuyAttempt
I will test it again, but basically is using autobuy.txt
|
Re: CS_OnBuyAttempt
here is a fix for my problem, a guy that tested this have not used lest amxx dev versions.
https://github.com/alliedmodders/amx...c81c2b658d7905 Ps. Thanks for help |
All times are GMT -4. The time now is 21:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.