функция служит для запуска отсчета для всех или отдельных игроков.
forward CountDownForPlayer(count,playerid);
public CountDownForPlayer(count,playerid)return CountDownForPlayers(count,playerid);
forward CountDownForPlayers(count,...);
public CountDownForPlayers(count,...){
new players = (numargs() - 1);
if(players){
for(new f; f<players; f++){
new arg = getarg(f+1);
PlayerPlaySound(arg, 1057, 0.0, 0.0, 0.0);
if(count){
new st[10];
format(st, 10, "~>~~g~%d~<~", count);
GameTextForPlayer(arg, st, 900, 3);
SetTimerEx("CountDownForPlayer", 1000, false, "ii",count-1, arg);
}else GameTextForPlayer(arg,"~r~FIRE!!", 500, 3);
}
}else{
for(new f; f < MAX_PLAYERS; f++){
if(IsPlayerConnected(f)){
PlayerPlaySound(f, 1057, 0.0, 0.0, 0.0);
if(count){
new st[10];
format(st, 10, "~g~%i", count);
GameTextForPlayer(f, st, 900, 3);
SetTimerEx("CountDownForPlayers", 1000, false, "i", count-1);
}else GameTextForPlayer(f, "~r~FIRE!!", 900, 3);
}
}
}
return true;
}
пример использования:
CountDownForPlayers(5);//отсчет на 5 секунд для всех игроков
CountDownForPlayers(5, playerid, playerid1);//отсчет на 5 секунд для playerid и playerid1
кол-во идов, вроде как неограничено (нет возможности проверить =) )
ставим плюс, если кому пригодилось =)