SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 18/05/2020, 12:31 AM   #1
Filbert
Huge Clucker
 
Join Date: May 2016
Posts: 251
Reputation: 1
Default countdown for near players

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
Filbert is online now   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countdown help Finn707 Scripting Help 4 02/09/2013 06:07 PM
help with CountDown... omer5198 Help Archive 2 09/08/2011 03:01 PM
[HELP] Countdown joeri55 Help Archive 1 22/05/2011 06:40 PM
CountDown for players in range juuleman Help Archive 4 26/03/2010 09:32 AM
CountDown help Vadonis Help Archive 4 28/07/2009 04:26 PM


All times are GMT. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.