13.12.2017, 09:34
PHP Code:
new bool:check_iter = true;
for(new i = AdminSpecID[playerid]-1; i > Iter_Begin(Player); i = Iter_Prev(Player, i))
{
if(gPlayerLogged[i] && !IsPlayerNPC(i) && i != playerid)
{
check_iter = false;
format(string, sizeof(string), "/spec %d", i);
PC_EmulateCommand(playerid, string);
break;
}
}
if(check_iter == true)
{
for(new i = Iter_Last(Player); i > Iter_Begin(Player); i = Iter_Prev(Player, i))
{
if(gPlayerLogged[i] && !IsPlayerNPC(i) && i != playerid)
{
format(string, sizeof(string), "/spec %d", i);
PC_EmulateCommand(playerid, string);
break;
}
}
}