Raised This Month: $51 Target: $400
 12% 

CS_OnBuyAttempt


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-13-2016 , 10:21   CS_OnBuyAttempt
Reply With Quote #1

Hi i am again here

A player have reported to me that function is broken:

PHP Code:
public CS_OnBuyAttempt(id,iItem)
{
    if((
iItem == CSI_DEFUSER) && !cs_get_user_defuse(id))
    {
        new 
iMoney cs_get_user_money(id);
        
        if(
iMoney >= 200)
        {
            
cs_set_user_money(id,iMoney 200);
        }
    }

This is a small fix to discount money if player will buy a defuse, but the problem is for Team TR side.
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.

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode