19.01.2011, 13:43
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.
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
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;
}
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