Raised This Month: $32 Target: $400
 8% 

How can i return the whole team money value ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-17-2017 , 04:14   How can i return the whole team money value ?
Reply With Quote #1

I'm trying to make a stock to return the whole team money, idk why is not currentyl working ..

Idk what methot should i add, however here's the code:
PHP Code:
#include <amxmodx>
#include <cstrike>

new iTeMoney;

public 
plugin_init( )
{
    
register_clcmd"say /test""test" );
}


public 
testid )
{
    
client_printid print_chat "Tero team total money: %i, your money: %i"cs_temoney_team( ) , cs_get_user_moneyid ) );
}

stock cs_temoney_team(  )
{
    new 
tePlayers[32] , iteNum;    

    
get_playerstePlayers iteNum "e" "1" );

    for( new 
iteNum i++ )
    {
        
iTeMoney += cs_get_user_moneytePlayers] );
    }
    return 
iTeMoney;

__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-17-2017 , 04:45   Re: How can i return the whole team money value ?
Reply With Quote #2

get_players( tePlayers , iteNum , "e" , "TERRORIST" );
jimaway is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-17-2017 , 06:16   Re: How can i return the whole team money value ?
Reply With Quote #3

silly mistake, sorry
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 13:14   Re: How can i return the whole team money value ?
Reply With Quote #4

And you don't need a global variable.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-17-2017 , 16:24   Re: How can i return the whole team money value ?
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
And you don't need a global variable.
thanks sir it was just an example of something similar with the same method, the actual stock it's much complex and bigger and do different things, i was not understand why is not working because i made tons like that, i forgot that only in AMXMOD is working with "1" or "2" not also in amxmodx , my mistake.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-17-2017 , 16:36   Re: How can i return the whole team money value ?
Reply With Quote #6

Or This..
PHP Code:
#include <amxmodx> 
#include <cstrike> 

#define IsValidPlayer(%1) ( 1 <= %1 <= g_maxplayers )

new g_maxplayers;

public 
plugin_init( ) 

    
register_clcmd"say /test""test" ); 
    
    
g_maxplayers get_maxplayers()


public 
testid 

    
client_printid print_chat "Tero team total money: %i, your money: %i"cs_temoney_team( ) , cs_get_user_moneyid ) ); 


stock cs_temoney_team(  ) 

    static 
iTeMoney
    
    for ( new 
i<= g_maxplayersi++ ) {
        
        if(
IsValidPlayer) && is_user_alive) && cs_get_user_team) == CS_TEAM_T) {
            
            
iTeMoney += cs_get_user_money);     
            
        }
    }
    return 
iTeMoney

__________________

Last edited by edon1337; 01-18-2017 at 11:14.
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 16:40   Re: How can i return the whole team money value ?
Reply With Quote #7

No edon, you shouldn't use a loop for pickup players indexes.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-17-2017 , 16:44   Re: How can i return the whole team money value ?
Reply With Quote #8

Won't that work ?
__________________

Last edited by edon1337; 01-17-2017 at 16:44.
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-17-2017 , 16:45   Re: How can i return the whole team money value ?
Reply With Quote #9

It's not a correct way to do it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 16:54   Re: How can i return the whole team money value ?
Reply With Quote #10

You should use get_players(), there's so many requestions about it, you can search on google for learn.
__________________
• 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 15:08.


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