[HELP] help with int, for loop...
Hello, i have a int
PHP Code:
all player has different points, how can i get the total points of a team Terror and CT and print it to chat like: "Team Terror has total: X points and team CT has total X points" and how can i get the lowest and highest points from a team like: print to chat "Team Terror: player X is the first with x points" and "Team Terror: player X has the lowest points" and also with CT. would be happy if someone can help me.. thanks :3 |
Re: [HELP] with int for CSGO
Use a for loop in all these situations. Loop through every possible player slot on the server and check for valid players, if they are valid you can then add to a temp variable var += g_playerspoints[client] and get a total at the end. For lowest/highest score you will loop through all players with a temp variable again and check if < or > previous highest or lowess. Then you set the new lowest record to that variable along with a second variable which keeps track of which player had the lowest/highest.
|
Re: [HELP] with int for CSGO
Quote:
PHP Code:
|
Re: [HELP] help with int, for loop...
You'd do something like this
PHP Code:
|
Re: [HELP] help with int, for loop...
Quote:
|
Re: [HELP] help with int, for loop...
Quote:
|
Re: [HELP] help with int, for loop...
Quote:
|
Re: [HELP] help with int, for loop...
Quote:
Adding an extra if statement, exculding invalid player indexes is a waste of time? Well so be it. I bet he'd prefer "wasting time", than getting error logs. |
Re: [HELP] help with int, for loop...
Quote:
|
Re: [HELP] help with int, for loop...
Quote:
|
All times are GMT -4. The time now is 22:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.