countdown for near players
#1

PHP Code:
new CountDown = -1;
forward countdown();
public 
countdown()
{
    if(
CountDown == 6GameTextForAll("~p~Starting..."10006);
    
CountDown--;
    if(
CountDown == 0)
    {
        
GameTextForAll("~g~GO~ r~!"10006);
        
CountDown = -1;
        for(new 
0MAX_PLAYERSi++) {
            
TogglePlayerControllable(itrue);
            
PlayerPlaySound(i10570.00.00.0);
        }
        return 
0;
    }
    else
    {
        new 
text[7]; format(textsizeof(text), "~w~%d"CountDown);
        for(new 
0MAX_PLAYERSi++) {
            
PlayerPlaySound(i10560.00.00.0);
            
TogglePlayerControllable(ifalse);
        }
         
GameTextForAll(text10006);
    }
    
SetTimer("countdown"10000);
    return 
0;
}
CMD:countdown(playeridparams[]) {
    if(
PlayerInfo[playerid][Level] >= 4) {
        if(
CountDown == -1) {
            
CountDown 6;
            
SetTimer("countdown"10000);
            return 
CMDMessageToAdmins(playerid"COUNTDOWN");
        } else return 
SendClientMessage(playeridred"ERROR: Countdown in progress");
    } else return 
SendClientMessage(playeridred"ERROR: You are not a high enough level to use this command");

How to make the countdowns are just for near 'playerid'?
I think I can use IsPlayerInRangeOfPoint but it would do the countdown just to the one nearest person (i guess)

EDIT: Or I can just use ProxDetector ? But idk how
Reply


Messages In This Thread
countdown for near players - by Filbert - 18.05.2020, 00:31
Re: countdown for near players - by AzertyTheProgrammer - 18.05.2020, 00:58
Re: countdown for near players - by Ghazal - 18.05.2020, 01:25
Re: countdown for near players - by Filbert - 18.05.2020, 01:36
Re: countdown for near players - by Filbert - 19.05.2020, 19:40
Re: countdown for near players - by Grim_ - 19.05.2020, 23:25

Forum Jump:


Users browsing this thread: 1 Guest(s)