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

Solved Total points of all players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepegoz
Senior Member
Join Date: Apr 2019
Old 05-29-2021 , 16:16   Total points of all players
Reply With Quote #1

I have this PlayerPoints[id][x] function but I want to collect the points of all the players in both t and ct teams. If there are 6 players in teams, it will be sum of total2/6 = total. How to collect on total can you make a example script?

PHP Code:
        new total,total2
        
for(x=1x<=UPGRADESx++) {
    
    if(
PlayerPoints[id][x] == 8)
    
total2 += 125
    
if(PlayerPoints[id][x] == 7)
    
total2 += 100
    
if(PlayerPoints[id][x] == 6)
    
total2 += 75
    
if(PlayerPoints[id][x] == 5)
    
total2 += 50
    
if(PlayerPoints[id][x] == 4)
    
total2 += 25
    
}    
        
total = +.....total2 ?


Last edited by tepegoz; 05-29-2021 at 18:41.
tepegoz is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 05-29-2021 , 17:27   Re: Total points of all players
Reply With Quote #2

maybe something like this?....
PHP Code:
new players[32], playerCountpid
get_players
(playersplayerCount"ch"// get all players, exclude bots and hltv
//if you do not want to exclude bots remove "c" flag there

new totaltemp
for(new 0playerCounti++) { // loop thru all players
    
pid players[i// cache player id
    
temp // reset before looping
    
for(1<= UPGRADESx++) {
        if(
PlayerPoints[pid][x] == 1)
            
temp += 150
        
if(PlayerPoints[pid][x] == 2)
            
temp += 375
        
... // MORE 'if' STATEMENTS
    
}
    
total += temp

Spoiler

Last edited by kww; 05-29-2021 at 18:02.
kww 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 03:17.


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