Race position
#3

PHP код:
stock GetPlayerRacePosition(playerid)
{
    new 
countcp gCheckpoint[playerid] + 1;
    foreach(new 
Player)
    {
        if(
gCheckpoint[i] > gCheckpoint[playerid])
        {
            
count ++;
        }
        else if (
gCheckpoint[i] == gCheckpoint[playerid])
        {
            if (
GetPlayerDistanceFromPoint(ig_arrCheckpoint[0][cp], g_arrCheckpoint[1][cp], g_arrCheckpoint[2][cp]) < GetPlayerDistanceFromPoint(playeridg_arrCheckpoint[0][cp], g_arrCheckpoint[1][cp], g_arrCheckpoint[2][cp]))
            {
                
count ++;
            }
        }
    }
    return 
count 1;

Question; Why plus one on the returned value, and would this work on a track where in there is a left and right turns (It is more of like a Temple Run map)

- I have seen your code somewhere and based it on the code above.

How about; Sorting out the list of these players (Top 5 list)
Reply


Messages In This Thread
Race position - by JaKe Elite - 07.12.2016, 12:36
Re: Race position - by Konstantinos - 07.12.2016, 12:46
Re: Race position - by JaKe Elite - 07.12.2016, 13:04
Re: Race position - by Yaa - 07.12.2016, 13:07
Re: Race position - by Konstantinos - 07.12.2016, 13:18
Re: Race position - by JaKe Elite - 07.12.2016, 13:24
Re: Race position - by JaKe Elite - 07.12.2016, 13:38
Re: Race position - by Yaa - 07.12.2016, 13:45
Re: Race position - by Konstantinos - 07.12.2016, 13:45
Re: Race position - by gurmani11 - 07.12.2016, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)