Return "?"
#4

pawn Код:
stock GetPlayerWithHighestScore()
{
    new
        scoreMax = cellmin,
        scoreTemp,
        playerid = -1
    ;
    for(new i; i != MAX_PLAYERS; ++i)
    {
        if(IsPlayerConnected(i))
        {
            if((scoreTemp = GetPlayerScore(i)) > scoreMax)
            {
                scoreMax = scoreTemp;
                playerid = i;
            }
        }
    }
    return playerid;
}
This one works perfect. Actually you don't need the ? : statement because it'll return -1 as long as you don't assign anything, so actually, if there's no player connected it'll return -1.
Reply


Messages In This Thread
Return "?" - by Kwarde - 19.01.2011, 13:43
Re: Return "?" - by Joe Staff - 19.01.2011, 13:48
Re: Return "?" - by Kwarde - 19.01.2011, 13:50
Re: Return "?" - by RyDeR` - 19.01.2011, 13:58
Re: Return "?" - by Kwarde - 19.01.2011, 14:04

Forum Jump:


Users browsing this thread: 2 Guest(s)