Raised This Month: $ Target: $400
 0% 

Client buy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-24-2017 , 14:51   Client buy
Reply With Quote #1

Dudes, how can I store the weapon's price in an array? And how can I check if the item that you've bought isn't these:

PHP Code:
const INVALID_ITEMS_BOUGH =        ((1<<CSW_DEFUSER)|(1<<CSW_NVGS)|(1<<CSW_SHIELD)|(1<<CSW_PRIMAMMO)|(1<<CSW_SECAMMO)) 
I'm using client_buy forward by Connor.

PHP Code:
public client_buy(idiItem)
{
    if(!(
<< iItem INVALID_ITEMS_BOUGH))
    {
        
PlayerData[id][arItemsBought]++
        if(
PlayerData[id][arItemsBought] > 3)
        {
            new 
randomChance random_num(0,MAX_CHANCE)
            if(
randomChance == MAX_CHANCE)
            {
                
gUserEventName id
                get_user_name
(gUserEventName,PlayerData[id][PlayerName],charsmax(PlayerData[]))
                
eVents ev_ItemsBought
            
}
        }

        if(
PlayerData[id][arMoneyWornOut] >= 4500)
        {
            new 
randomChance random_num(0,MAX_CHANCE)
            if(
randomChance == MAX_CHANCE)
            {
                
gUserEventName id
                get_user_name
(gUserEventName,PlayerData[id][PlayerName],charsmax(PlayerData[]))
                
eVents ev_MoneyWornOut
            
}
        }
    }

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-24-2017 , 16:32   Re: Client buy
Reply With Quote #2

I think you gotta store all price values manually, else i think Orphue would be the only option available, which i know nothing of.

A possible check could be:

PHP Code:
if(!(iItem INVALID_ITEMS_BOUGH)) 
__________________

Last edited by Napoleon_be; 01-24-2017 at 16:33.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-24-2017 , 16:41   Re: Client buy
Reply With Quote #3

I've used print_console for see what iItem returns. And it return numbers, like 31, 37, 36...
But I don't know how to check the weapon's number with that interger.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-24-2017 at 16:52.
EFFx is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-24-2017 , 17:07   Re: Client buy
Reply With Quote #4

Fixed by myself

PHP Code:
new const eItemValue[] =
{
    
9,
    
4,
    
25,
    
31,
    
32,
    
36,
    
37

PHP Code:
    for(new i;sizeof eItemValue;i++)
    {
        if(
eItemValue[i] == iItem)
        {
        }
    } 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Reply



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 20:41.


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