Raised This Month: $ Target: $400
 0% 

Dividing players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-28-2011 , 16:17   Re: Dividing players
Reply With Quote #5

1. Add all values
2. Divide by number of values
Done

May be this example would help you to understand :

PHP Code:
SharePlayersMoney()
{
    new 
iTotalMoney
    
new iPlayers[32], iNumid
    get_players
(iPlayersiNum"h")
    for(new 
ii<iNumi++)
    {
        
iTotalMoney += cs_get_user_moneyiPlayers[i] )
    }
    new 
iSharedMoney iTotalMoney iNum
    
for(new ii<iNumi++)
    {
        
cs_set_user_moneyiPlayers[i] , iSharedMoney )
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-28-2011 at 16:20.
ConnorMcLeod is offline
 



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 04:24.


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