asked about the task
#1

I have a task I want to ask [1000] What is it? can someone explain me understand
Код:
task eventtaixiu[1000]()
{
    if(TaiXiuClose==Phientaixiu) return 1;
    if(TimeTaiXiu > 0)
	{
	    TimeTaiXiu--;
	}
	if(TimeTaiXiu == 0)
	{
	    new string[1024],string2[1024],ketqua[32];
	    if(HeThongTaiXiu == 0)
	    {
			switch(random(4))
			{
	        	case 0,2: KetQuaTaiXiu = 1;
				case 1,3: KetQuaTaiXiu = 2;
			}
		}
		if(HeThongTaiXiu == 1)
	    {
			KetQuaTaiXiu = 1;
		}
		if(HeThongTaiXiu == 2)
	    {
			KetQuaTaiXiu = 2;
		}
		if(HeThongTaiXiu == 3 && TienCuocTaiAll > TienCuocXiuAll)
	    {
			KetQuaTaiXiu = 1;
		}
		if(HeThongTaiXiu == 3 && TienCuocTaiAll < TienCuocXiuAll)
	    {
			KetQuaTaiXiu = 2;
		}
		if(HeThongTaiXiu == 3 && TienCuocTaiAll == TienCuocXiuAll)
	    {
			switch(random(4))
			{
	        	case 0,2: KetQuaTaiXiu = 1;
				case 1,3: KetQuaTaiXiu = 2;
			}
		}
		if(HeThongTaiXiu == 4 && TienCuocTaiAll > TienCuocXiuAll)
	    {
			KetQuaTaiXiu = 2;
		}
		if(HeThongTaiXiu == 4 && TienCuocTaiAll < TienCuocXiuAll)
	    {
			KetQuaTaiXiu = 1;
		}
		if(HeThongTaiXiu == 4 && TienCuocTaiAll == TienCuocXiuAll)
	    {
			switch(random(4))
			{
	        	case 0,2: KetQuaTaiXiu = 1;
				case 1,3: KetQuaTaiXiu = 2;
			}
		}
		switch(KetQuaTaiXiu)
		{
		    case 1: ketqua = "{ff0000}Tai{ffffff}";
		    case 2: ketqua = "{3aea46}Xiu{ffffff}";
		}
		new totalwealth;
		totalwealth = TienCuocTaiAll + TienCuocXiuAll - TienCuocTraAll;
	    foreach(new i: Player)
		{
            if(TogTaiXiu[i]==false) continue;
			if(TimeChonTaiXiu[i] < 10)
			{
			    if(TienCuocTaiXiu[i] > 0)
			    {
					format(string,sizeof(string),"[TAI XIU]ban duoc tra lai %d$ va loai khoi phien nay de can bang giua tai va xiu",TienCuocTaiXiu[i]);
            		SendClientMessageEx(i, -1, string);
            		SendClientMessageEx(i, -1, "[TAI XIU] Co gang tham gia som hon de khong bi loai ra nhe");
            		GivePlayerCash(i,TienCuocTaiXiu[i]);
                    TienCuocTraAll = TienCuocTraAll + TienCuocTaiXiu[i];
				}
				if(TienCuocTaiAll == 0 && KetQuaTaiXiu == 1)
				{
            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$)",Phientaixiu,ketqua,number_format(totalwealth));
            		SendClientMessageEx(i, -1, string);
				}
				if(TienCuocTaiAll > 0 && KetQuaTaiXiu == 1)
				{
            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdTaiWin),number_format(TienIdTaiWin*2));
            		SendClientMessageEx(i, -1, string);
				}
				if(TienCuocXiuAll == 0 && KetQuaTaiXiu == 2)
				{
            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$) ",Phientaixiu,ketqua,number_format(totalwealth));
            		SendClientMessageEx(i, -1, string);
				}
				if(TienCuocXiuAll > 0 && KetQuaTaiXiu == 2)
				{
            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdXiuWin),number_format(TienIdXiuWin*2));
            		SendClientMessageEx(i, -1, string);
				}
            	ChonTaiXiu[i] = 0;
				TimeChonTaiXiu[i] = 0;
				TienCuocTaiXiu[i]= 0;
			}
			if(TimeChonTaiXiu[i] >= 10)
			{
				if(ChonTaiXiu[i] == KetQuaTaiXiu)
				{
     				if(TienCuocTaiAll == 0 && KetQuaTaiXiu == 1)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$) ",Phientaixiu,ketqua,number_format(totalwealth));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocTaiAll > 0 && KetQuaTaiXiu == 1)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdTaiWin),number_format(TienIdTaiWin*2));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocXiuAll == 0 && KetQuaTaiXiu == 2)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$) ",Phientaixiu,ketqua,number_format(totalwealth));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocXiuAll > 0 && KetQuaTaiXiu == 2)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdXiuWin),number_format(TienIdXiuWin*2));
	            		SendClientMessageEx(i, -1, string);
					}
	            	format(string,sizeof(string),"[TAI XIU] ban da thang trong phien nay va ban nhan duoc %d$",TienCuocTaiXiu[i]*2);
	            	SendClientMessageEx(i, -1, string);
	            	format(string2, sizeof(string2),"%s\n%s\t%s",
					string2,
					GetPlayerNameEx(i),number_format(TienCuocTaiXiu[i]*2));
	            	GivePlayerCash(i,TienCuocTaiXiu[i]*2);
	            	ChonTaiXiu[i] = 0;
					TimeChonTaiXiu[i] = 0;
					TienCuocTaiXiu[i ]= 0;
				}
				else if(ChonTaiXiu[i] != KetQuaTaiXiu)
				{
	         		if(TienCuocTaiAll == 0 && KetQuaTaiXiu == 1)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$) ",Phientaixiu,ketqua,number_format(totalwealth));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocTaiAll > 0 && KetQuaTaiXiu == 1)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdTaiWin),number_format(TienIdTaiWin*2));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocXiuAll == 0 && KetQuaTaiXiu == 2)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$) ",Phientaixiu,ketqua,number_format(totalwealth));
	            		SendClientMessageEx(i, -1, string);
					}
					if(TienCuocXiuAll > 0 && KetQuaTaiXiu == 2)
					{
	            		format(string,sizeof(string),"[TAI XIU] Phien so #%d tuyen bo: %s thang( Tong tien cuoc: %s$ - An nhieu nhat: %s [%s$]) ",Phientaixiu,ketqua,number_format(totalwealth),GetPlayerNameEx(IdXiuWin),number_format(TienIdXiuWin*2));
	            		SendClientMessageEx(i, -1, string);
					}
	            	if(ChonTaiXiu[i] > 0)
	            	{
	            		SendClientMessageEx(i, -1, "[TAI XIU] ban da thua trong phien nay");
					}
	            	ChonTaiXiu[i] = 0;
					TimeChonTaiXiu[i] = 0;
					TienCuocTaiXiu[i]= 0;
				}
			}
		}
		new year, month, day;
		getdate(year, month, day);
		format(TTPhienTaiXiu[Phientaixiu], sizeof(string), "Thoi gian: %d/%d/%d - %d:%d:%d\n\
		Ket qua: %s\n\
		Tong tien tai: %s\n\
		Tong tien xiu: %s\n\
		Tong tien hoan tra: %s\n\
		{ffec8b}>> chi tiet nguoi thang cuoc",
		month, day, year, hour, minuite,second,
		ketqua,
		number_format(TienCuocTaiAll),
		number_format(TienCuocXiuAll),
		number_format(TienCuocTraAll));
	 	format(TTWinTaiXiu[Phientaixiu], sizeof(string2), "%s",string2);
		Phientaixiu++;
		KetQuaTaiXiu = 0;
		if(Phientaixiu>=50)
		{
		    Phientaixiu=1;
		}
		TimeTaiXiu = 60;
		ChonTaiAll = 0;
		ChonXiuAll = 0;
		TienCuocTaiAll = 0;
		TienCuocXiuAll = 0;
		IdTaiWin = -1;
		IdXiuWin = -1;
		TienIdTaiWin = -1;
		TienIdXiuWin = -1;
		TienCuocTraAll = 0;
	}
	return 1;
}
Reply
#2

Did you just copy/paste this right? "Milliseconds"
Reply
#3

Milliseconds.
Reply
#4

Quote:
Originally Posted by DonaldDuck
Посмотреть сообщение
Did you just copy/paste this right?
This is my server's random license code, I want to ask [1000] what is it?
Reply
#5

1000 is repeat time for your task. 1000ms = 1 second, so your task code will be executed every 1 second.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)