Return "?"
#1

Well, sorry for the unclear title but,
I've made the function "GetPlayerWithHighestScore", and it's working, but I wanna know one thing for sure.

pawn Код:
GetPlayerWithHighestScore()
{
    new HighestScore = -999999999, ID = INVALID_PLAYER_ID;
    for(new i = 0; i < 500; i++){
        if(!IsPlayerConnected(i)) continue;
        if(GetPlayerScore(i) > HighestScore){
            HighestScore = GetPlayerScore(i);
            ID = i;
        }
        continue;
    }
    return ID != INVALID_PLAYER_ID ? ID : -1;
}
About the return ID != INVALID_PLAYER_ID ? ID : -1;
Am I true, if I say that this means...
Return "ID" when it's not 'INVALID_PLAYER_ID', otherwise, return '-1'
Just wanna know for sure :P - I like scripting etc, and I'm a bit good with it, but I just wanna know for sure... I wanna understand ANYTHING I make

Thanks in advance,
Kevin
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: 1 Guest(s)