27.03.2016, 18:42
Hi, I have a problem with my function GetSuperior(Inferior)Id. Result of a debug :
[DEBUG SUNSHINE (0)]: SUPERIOR 0 | INFERIOR 499
Result required : SUPERIOR 1 | INFERIOR 1
(We are 2 connected, me (ID0) and a player (ID1)).
Can you help me ?
[DEBUG SUNSHINE (0)]: SUPERIOR 0 | INFERIOR 499
Result required : SUPERIOR 1 | INFERIOR 1
(We are 2 connected, me (ID0) and a player (ID1)).
Can you help me ?
PHP код:
stock GetSuperiorId(playerid)
{
new
player;
do if(playerid >= MAX_PLAYERS) player = 0; else player++;
while(!IsPlayerConnected(player) && PlayerInfo[player][LoggedIn] == false && PlayerInfo[player][pInMenu] == true && playerid == player);
return playerid;
}
stock GetInferiorId(playerid)
{
new
player;
do if(playerid <= 0) player = 499; else player--;
while(!IsPlayerConnected(player) && PlayerInfo[player][LoggedIn] == false && PlayerInfo[player][pInMenu] == true && playerid == player);
return player;
}