All pastes #674688 Raw Edit

Countdown command

public text v1 · immutable
#674688 ·published 2007-08-29 13:37 UTC
rendered paste body
		if (strcmp(cmd, "/countdown", true)==0)
		{
			    if (Level[playerid] >= 8)
			    {
		    	    new tmp[256];
    		    	tmp = strtok(cmdtext, idx);
    		    	new seconds = strval(tmp);

    		  	    if (countdown_seconds) // First Error
			        SendClientMessage(playerid,0xFF0000FF,"A countdown is already started.");

			 		else if (seconds < 3 || seconds > 300)
        			SendClientMessage(playerid,0xFF0000FF,"You must enter a duration between 3 and 300.");

				    else
				    {
			        format(countdown_string,40,"You started a countdown of %d seconds.",seconds);
			        SendClientMessage(playerid,0x00FF00FF,countdown_string);
			        countdown_seconds = seconds+1;
				    }
				    return 1; //Second Error
				}
				else {
				SendClientMessage(playerid, COLOR_RED, "You need to be admin level 8.");
				return 1;
				}
	   }