Raised This Month: $ Target: $400
 0% 

Get Biggest Number From Char


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 01-20-2017 , 07:15   Get Biggest Number From Char
Reply With Quote #1

Hey,
If I have this char: "char XXX[MAXPLAYERS + 1];" and I put for 5 players a number in this char, how can I check who has the biggest number?
ty.
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests

Last edited by asherkin; 10-25-2018 at 17:14. Reason: Restore to previous version.
BraveFox is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 01-20-2017 , 08:27   Re: Get Biggest Number From Char
Reply With Quote #2

PHP Code:
int MyFunc()
{
    
int client 0;
    for (
int i 1sizeof(XXX); i++)
    {
        if (
XXX[i] > XXX[client])
        {
            
client i;
        }
    }
    return 
client;

Note: If two or more palyers have equal value, will returned client with lower index.
Kailo 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 21:32.


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