Function GetSuperior/InferiorID
#6

You can also use functions from foreach/y_iterate if you already use it since there are Iter_Next and Iter_Prev in it.

PHP код:
GetNextPlayerID(id)
{
    new
        
next_id;
    if ((
next_id Iter_Next(Playerid)) != MAX_PLAYERS) return next_id;
    return ((
next_id Iter_First(Player)) == id) ? INVALID_PLAYER_ID next_id;
}
GetPreviousPlayerID(id)
{
    new
        
previous_id;
    if ((
previous_id Iter_Prev(Playerid)) != MAX_PLAYERS) return previous_id;
    return ((
previous_id Iter_Last(Player)) == id) ? INVALID_PLAYER_ID previous_id;

Reply


Messages In This Thread
Function GetSuperior/InferiorID - by YouServ - 27.03.2016, 18:42
Re: Function GetSuperior/InferiorID - by SickAttack - 27.03.2016, 18:55
Re: Function GetSuperior/InferiorID - by YouServ - 27.03.2016, 19:00
Re: Function GetSuperior/InferiorID - by SickAttack - 27.03.2016, 19:12
Re: Function GetSuperior/InferiorID - by YouServ - 27.03.2016, 19:25
Re: Function GetSuperior/InferiorID - by Konstantinos - 27.03.2016, 19:49
Re: Function GetSuperior/InferiorID - by SickAttack - 27.03.2016, 19:56
Re: Function GetSuperior/InferiorID - by YouServ - 27.03.2016, 20:40
Re: Function GetSuperior/InferiorID - by SickAttack - 27.03.2016, 20:43

Forum Jump:


Users browsing this thread: 3 Guest(s)