Shut Down Server
#1

Код:
[21:26:57] [debug] Server crashed while executing ATRP.amx
[21:26:57] [debug] AMX backtrace:
[21:26:57] [debug] #0 native fread () [004057a0] from samp-server.exe
[21:26:57] [debug] #1 00265188 in ?? () from ATRP.amx
[21:26:57] [debug] #2 00540a9c in public ServerHeartbeat () from ATRP.amx
[21:26:57] [debug] System backtrace:
[21:26:57] [debug] #0 00492860 in ?? () from C:\Documents and Settings\Administrator\Desktop\VN-PAC (AT-RP)\VN-PAC (AT-RP)\samp-server.exe
[21:26:57] [debug] #1 00492e90 in ?? () from C:\Documents and Settings\Administrator\Desktop\VN-PAC (AT-RP)\VN-PAC (AT-RP)\samp-server.exe
Someone know help me!
Reply
#2

Something in the ServerHeartbeat function/callback is causing the crash. Could you show the code for it?
Reply
#3

Код:
task ServerHeartbeat[1000]() {
    if(++AdminWarning == 15) {
		for(new z = 0; z < MAX_REPORTS; z++)
		{
			if(Reports[z][BeingUsed] == 1)
			{
				if(Reports[z][ReportPriority] == 1 || Reports[z][ReportPriority] == 2)
				{
					ABroadCast(COLOR_LIGHTRED,"A priority report is pending.", 2, true);
					break;
				}
			}
		}
		AdminWarning = 0;
	}

    static string[128];
	foreach(Player, i)
	{
		if(playerTabbed[i] == 0) {
			switch(PlayerInfo[i][pLevel]) {
				case 0 .. 2: PlayerInfo[i][pPayCheck] += 1;
				case 3 .. 4: PlayerInfo[i][pPayCheck] += 2;
				case 5 .. 6: PlayerInfo[i][pPayCheck] += 3;
				case 7 .. 8: PlayerInfo[i][pPayCheck] += 4;
				case 9 .. 10: PlayerInfo[i][pPayCheck] += 5;
				case 11 .. 12: PlayerInfo[i][pPayCheck] += 6;
				case 13 .. 14: PlayerInfo[i][pPayCheck] += 7;
				case 15 .. 16: PlayerInfo[i][pPayCheck] += 8;
				case 17 .. 18: PlayerInfo[i][pPayCheck] += 9;
				case 19 .. 20: PlayerInfo[i][pPayCheck] += 10;
				default: PlayerInfo[i][pPayCheck] += 11;
			}
			if(++PlayerInfo[i][pConnectSeconds] >= 3600) {
				PayDay(i);
			}
		}
        if (DangDieuTra[i] != 0)
	    {
			if (DieuTraLimit[i] > 1)
			{
			    DieuTraLimit[i]--;
			    if (IsPlayerInRangeOfPoint(i, 2.0, GetPVarFloat(i, "pDieuTraX"), GetPVarFloat(i, "pDieuTraY"), GetPVarFloat(i, "pDieuTraZ")))
				{

				    DieuTraCountDown[i]--;
				    if (DieuTraCountDown[i] > 0)
				    {
						format(string, sizeof(string), "Thoi gian con lai~n~~y~%d", DieuTraCountDown[i]);
				    	GameTextForPlayer(i, string, 900, 6);
				    }
					else if (DieuTraCountDown[i] == 0) //thanh cong
					{
				    	new killer = GetKillerID[DieuTraVictim[i]];
				    	if (killer == INVALID_PLAYER_ID)
						{
						    SendClientMessage(i, COLOR_WHITE, "Thu pham khong ton tai (da thoat)");
						    DieuTraVictim[i] = INVALID_PLAYER_ID;
		    				DangDieuTra[i] = 0;
		    				DieuTraCountDown[i] = 0;
		    				DieuTraLimit[i] = 0;
						}
						else
						{
							format(string, sizeof(string), "Hung thu co so CMND la %d", killer);
							SendClientMessage(i, COLOR_LIGHTBLUE, "***** Dieu tra thanh cong *****");
					    	SendClientMessage(i, COLOR_LIGHTGREEN, string);
					    	SendClientMessage(killer, COLOR_LIGHTRED, "Canh sat da tim ra ban la thu pham trong vu giet nguoi");
					    	SetPlayerWantedLevel(killer, GetPlayerWantedLevel(killer) + 1);
	    					PlayerInfo[killer][pCrimes]++;
							AddCrime(i, killer, "Giet nguoi");
					    	PlayerInfo[killer][pWantedLevel]++;
					    	format(string, sizeof(string), "** DISPATCH: Nhan vien %s da tim ra %s la thu pham cua 1 vu giet nguoi", GetPlayerNameEx(i), GetPlayerNameEx(killer));
					    	foreach (new p: Player)
					    	{
					    	    if (IsACop(p))
					    	    {
					    	        SendClientMessage(p, COLOR_DBLUE, string);
					    	        SendClientMessage(p, COLOR_LIGHTBLUE, "Hay kiem tra danh sach truy na.");
								}
					    	}
	    					DangDieuTra[i] = 0;
	    					DieuTraVictim[i] = INVALID_PLAYER_ID;
			    			DangDieuTra[i] = 0;
			    			DieuTraCountDown[i] = 0;
			    			DieuTraLimit[i] = 0;
		    			}
					}
				}
			}
			else if (DieuTraLimit[i] == 1 && DangDieuTra[i] == 1)
			{
			    SendClientMessage(i, COLOR_GREY, "Ban da that bai trong viec tim kiem thu pham");
			    DangDieuTra[i] = 0;
			}
		}
		/*if (GetPVarInt(i, "MailTime") > 0)
			SetPVarInt(i, "MailTime", GetPVarInt(i, "MailTime") - 1);
		else
			DeletePVar(i, "MailTime");*/

		if(PlayerInfo[i][pJudgeJailType] != 0 && PlayerInfo[i][pJudgeJailTime] > 0 && !PlayerInfo[i][pBeingSentenced]) PlayerInfo[i][pJudgeJailTime]--;
		if(PlayerInfo[i][pJudgeJailTime] <= 0 && PlayerInfo[i][pJudgeJailType] != 0) PlayerInfo[i][pJudgeJailType] = 0;
		if(PlayerInfo[i][pJailTime] > 0 && --PlayerInfo[i][pJailTime] <= 0) {
			if(strfind(PlayerInfo[i][pPrisonReason], "[IC]", true) != -1 || strfind(PlayerInfo[i][pPrisonReason], "[ISOLATE]", true) != -1) {
	   			SetPlayerInterior(i, 0);
				PlayerInfo[i][pInt] = 0;
				SetPlayerVirtualWorld(i, 0);
				PlayerInfo[i][pVW] = 0;
				SetPlayerPos(i, 1745.5969, 396.6139, 19.0345);
			}
			else {
			 	SetPlayerInterior(i, 0);
				PlayerInfo[i][pInt] = 0;
				SetPlayerVirtualWorld(i, 0);
				PlayerInfo[i][pVW] = 0;
	    		SetPlayerPos(i, 1544.5059,-1675.5673,13.5585);
			}
			PlayerInfo[i][pJailTime] = 0;
			PhoneOnline[i] = 0;
			SendClientMessageEx(i, COLOR_GRAD1,"   Ban da hoan thanh het nghia vu.");
			GameTextForPlayer(i, "~g~Tu do~n~~w~Hay co gang la mot cong dan tot", 5000, 1);
			ClearCrimes(i);
			strcpy(PlayerInfo[i][pPrisonReason], "None", 128);
			SetPlayerToTeamColor(i);
		}

		if(CommandSpamTimes[i] != 0)
		{
			CommandSpamTimes[i]--;
		}
		if(TextSpamTimes[i] != 0)
		{
			TextSpamTimes[i]--;
		}
		if(UsedFind[i] >= 1) --UsedFind[i];
		if(PlayerInfo[i][pMechTime] > 0) PlayerInfo[i][pMechTime]--;
		if(PlayerInfo[i][pLawyerTime] > 0) PlayerInfo[i][pLawyerTime]--;
		if(PlayerInfo[i][pDrugsTime] > 0) PlayerInfo[i][pDrugsTime]--;
		if(PlayerInfo[i][pRMuted] == 2) {
			PlayerInfo[i][pRMutedTime]--;
			if(PlayerInfo[i][pRMutedTime] <= 0) {
				PlayerInfo[i][pRMuted] = 0;
			}
		}
		if(PlayerInfo[i][pVMuted] == 2) {
			PlayerInfo[i][pVMutedTime]--;
			if(PlayerInfo[i][pVMutedTime] <= 0) {
				PlayerInfo[i][pVMuted] = 0;
			}
		}

		if(GetPVarType(i, "hFind"))
		{
		    new Float:X, Float:Y, Float:Z, pID = GetPVarInt(i, "hFind");
		    if(IsPlayerConnected(pID))
		    {
			    GetPlayerPos(pID, X, Y, Z);
			    SetPlayerCheckpoint(i, X, Y, Z, 4.0);
			}
		}

		if(WantLawyer[i] >= 1)
		{
			CallLawyer[i] = 111;
			if(WantLawyer[i] == 1)
			{
				SendClientMessageEx(i, COLOR_LIGHTRED, "Ban co muon mot luat su? (Go 'yes' hoac 'no')");
			}
			WantLawyer[i] ++;
			if(WantLawyer[i] == 8)
			{
				SendClientMessageEx(i, COLOR_LIGHTRED, "Ban co muon mot luat su? (Go 'yes' hoac 'no')");
			}
			if(WantLawyer[i] == 15)
			{
				SendClientMessageEx(i, COLOR_LIGHTRED, "Ban co muon mot luat su? (Go 'yes' hoac 'no')");
			}
			if(WantLawyer[i] == 20)
			{
				SendClientMessageEx(i, COLOR_LIGHTRED, "Khong co luat su nao lam nhiem vu! Thoi gian o tu bat dau.");
				WantLawyer[i] = 0;
				CallLawyer[i] = 0;
			}
		}
		if(PlayerDrunk[i] >= 5)
		{
			PlayerDrunkTime[i] += 1;
			if(PlayerDrunkTime[i] == 8)
			{
				PlayerDrunkTime[i] = 0;

				if(IsPlayerInAnyVehicle(i))
				{
					if(GetPlayerState(i) == 2)
					{
						new Float:angle;
						GetPlayerFacingAngle(i, angle);
						SetVehicleZAngle(GetPlayerVehicleID(i), angle + random(10) - 5);
					}
				}
				else
				{
					ApplyAnimation(i,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
				}
			}
		}
		if(PlayerStoned[i] >= 3)
		{
			PlayerStoned[i] += 1;
			SetPlayerDrunkLevel(i, 40000);
			if(PlayerStoned[i] == 50)
			{
				PlayerStoned[i] = 0;
				SetPlayerDrunkLevel(i, 0);
				SendClientMessageEx(i, COLOR_GRAD1, " You are no longer stoned!");
			}
		}
		if(PlayerInfo[i][pSexTime] > 0)
		{
			if(PlayerInfo[i][pSexTime] <= 0)
			{
				PlayerInfo[i][pSexTime] = 0;
			}
			else
			{
				PlayerInfo[i][pSexTime] -= 1;
			}
		}
		if(PlayerInfo[i][pLawyerFreeTime] > 0)
		{
			if(PlayerInfo[i][pLawyerFreeTime] <= 0)
			{
				PlayerInfo[i][pLawyerFreeTime] = 0;
			}
			else
			{
				PlayerInfo[i][pLawyerFreeTime] -= 1;
			}
		}
		if(BoxWaitTime[i] > 0)
		{
			if(BoxWaitTime[i] >= BoxDelay)
			{
				BoxDelay = 0;
				BoxWaitTime[i] = 0;
				PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				GameTextForPlayer(i, "~g~Match Started", 5000, 1);
				TogglePlayerControllable(i, 1);
				RoundStarted = 1;
			}
			else
			{
				format(string, sizeof(string), "%d", BoxDelay - BoxWaitTime[i]);
				GameTextForPlayer(i, string, 1500, 6);
				BoxWaitTime[i] += 1;
			}
		}
		if(RoundStarted > 0)
		{
			if(PlayerBoxing[i] > 0)
			{
				new trigger = 0;
				new Lost = 0;
				new Float:angle;
				new Float:health;
				GetPlayerHealth(i, health);
				if(health < 12)
				{
					if(i == Boxer1) { Lost = 1; trigger = 1; }
					else if(i == Boxer2) { Lost = 2; trigger = 1; }
				}
				if(health < 28) { GetPlayerFacingAngle(i, angle); SetPlayerFacingAngle(i, angle + 85); }
				if(trigger)
				{
					new winner[MAX_PLAYER_NAME];
					new loser[MAX_PLAYER_NAME];
					new titel[MAX_PLAYER_NAME];
					if(Lost == 1)
					{
						if(IsPlayerConnected(Boxer1) && IsPlayerConnected(Boxer2))
						{
							if(IsPlayerInRangeOfPoint(Boxer1,25.0,768.48, -73.66, 1000.57) || IsPlayerInRangeOfPoint(Boxer2,25.0,768.48, -73.66, 1000.57))
							{
								SetPlayerPos(Boxer1, 768.48, -73.66, 1000.57); SetPlayerPos(Boxer2, 768.48, -73.66, 1000.57);
								SetPlayerInterior(Boxer1, 7); SetPlayerInterior(Boxer2, 7);
								GetPlayerName(Boxer1, loser, sizeof(loser));
								GetPlayerName(Boxer2, winner, sizeof(winner));
								SetPlayerWeapons(Boxer1);
								SetPlayerWeapons(Boxer2);
								if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pLoses] += 1; }
								if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer2][pWins] += 1; }
								if(TBoxer != INVALID_PLAYER_ID)
								{
									if(IsPlayerConnected(TBoxer))
									{
										if(TBoxer != Boxer2)
										{
											if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12)
											{
												TBoxer = Boxer2;
												GetPlayerName(TBoxer, titel, sizeof(titel));
												new nstring[MAX_PLAYER_NAME];
												format(nstring, sizeof(nstring), "%s", titel);
												strmid(Titel[TitelName], nstring, 0, strlen(nstring), 255);
												Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
												Titel[TitelLoses] = PlayerInfo[TBoxer][pLoses];
												Misc_Save();
												format(string, sizeof(string), "Tin tuc Boxing: %s has Won the fight against Champion %s and is now the new Boxing Champion.",  titel, loser);
												ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
											}
											else
											{
												SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You would have been the Champion if you had the Boxer Job!");
											}
										}
										else
										{
											GetPlayerName(TBoxer, titel, sizeof(titel));
											format(string, sizeof(string), "Tin tuc Boxing: Giai vo dich Boxing %s has Won the fight against %s.",  titel, loser);
											ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
											Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
											Titel[TitelLoses] = PlayerInfo[Boxer2][pLoses];
											Misc_Save();
										}
									}
								}//TBoxer
								format(string, sizeof(string), "* You have Lost the Fight against %s.", winner);
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(Boxer1, "~r~You lost", 3500, 1);
								format(string, sizeof(string), "* You have Won the Fight against %s.", loser);
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(Boxer2, "~r~You won", 3500, 1);
								if(GetPlayerHealth(Boxer1, health) < 20)
								{
									SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
									SetPlayerHealth(Boxer1, 30.0);
								}
								else
								{
									SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
									SetPlayerHealth(Boxer1, 50.0);
								}
								if(GetPlayerHealth(Boxer2, health) < 20)
								{
									SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
									SetPlayerHealth(Boxer2, 30.0);
								}
								else
								{
									SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
									SetPlayerHealth(Boxer2, 50.0);
								}
								GameTextForPlayer(Boxer1, "~g~Match Over", 5000, 1); GameTextForPlayer(Boxer2, "~g~Match Over", 5000, 1);
								if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12) { PlayerInfo[Boxer2][pBoxSkill] += 1; }
								PlayerBoxing[Boxer1] = 0;
								PlayerBoxing[Boxer2] = 0;
							}
							SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186); SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
							SetPlayerInterior(Boxer1, 5); SetPlayerInterior(Boxer2, 5);
							GetPlayerName(Boxer1, loser, sizeof(loser));
							GetPlayerName(Boxer2, winner, sizeof(winner));
							SetPlayerWeapons(Boxer1);
							SetPlayerWeapons(Boxer2);
							if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pLoses] += 1; }
							if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12) { PlayerInfo[Boxer2][pWins] += 1; }
							if(TBoxer != INVALID_PLAYER_ID)
							{
								if(IsPlayerConnected(TBoxer))
								{
									if(TBoxer != Boxer2)
									{
										if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12)
										{
											TBoxer = Boxer2;
											GetPlayerName(TBoxer, titel, sizeof(titel));
											new nstring[MAX_PLAYER_NAME];
											format(nstring, sizeof(nstring), "%s", titel);
											strmid(Titel[TitelName], nstring, 0, strlen(nstring), 255);
											Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
											Titel[TitelLoses] = PlayerInfo[TBoxer][pLoses];
											Misc_Save();
											format(string, sizeof(string), "Tin tuc Boxing: %s has Won the fight against Champion %s and is now the new Boxing Champion.",  titel, loser);
											ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
										}
										else
										{
											SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You would have been the Champion if you had the Boxer Job!");
										}
									}
									else
									{
										GetPlayerName(TBoxer, titel, sizeof(titel));
										format(string, sizeof(string), "Tin tuc Boxing: Giai vo dich Boxing %s has Won the fight against %s.",  titel, loser);
										ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
										Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
										Titel[TitelLoses] = PlayerInfo[Boxer2][pLoses];
										Misc_Save();
									}
								}
							}//TBoxer
							format(string, sizeof(string), "* You have Lost the Fight against %s.", winner);
							SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, string);
							GameTextForPlayer(Boxer1, "~r~You lost", 3500, 1);
							format(string, sizeof(string), "* You have Won the Fight against %s.", loser);
							SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, string);
							GameTextForPlayer(Boxer2, "~r~You won", 3500, 1);
							if(GetPlayerHealth(Boxer1, health) < 20)
							{
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
								SetPlayerHealth(Boxer1, 30.0);
							}
							else
							{
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
								SetPlayerHealth(Boxer1, 50.0);
							}
							if(GetPlayerHealth(Boxer2, health) < 20)
							{
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
								SetPlayerHealth(Boxer2, 30.0);
							}
							else
							{
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
								SetPlayerHealth(Boxer2, 50.0);
							}
							GameTextForPlayer(Boxer1, "~g~Match Over", 5000, 1); GameTextForPlayer(Boxer2, "~g~Match Over", 5000, 1);
							if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12) { PlayerInfo[Boxer2][pBoxSkill] += 1; }
							PlayerBoxing[Boxer1] = 0;
							PlayerBoxing[Boxer2] = 0;
						}
					}
					else if(Lost == 2)
					{
						if(IsPlayerConnected(Boxer1) && IsPlayerConnected(Boxer2))
						{
							if(IsPlayerInRangeOfPoint(Boxer1,25.0,768.48, -73.66, 1000.57) || IsPlayerInRangeOfPoint(Boxer2,25.0, 768.48, -73.66, 1000.57))
							{
								SetPlayerPos(Boxer1, 768.48, -73.66, 1000.57); SetPlayerPos(Boxer2, 768.48, -73.66, 1000.57);
								SetPlayerInterior(Boxer1, 7); SetPlayerInterior(Boxer2, 7);
								GetPlayerName(Boxer1, winner, sizeof(winner));
								GetPlayerName(Boxer2, loser, sizeof(loser));
								if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12) { PlayerInfo[Boxer2][pLoses] += 1; }
								if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pWins] += 1; }
								if(TBoxer != INVALID_PLAYER_ID)
								{
									if(IsPlayerConnected(TBoxer))
									{
										if(TBoxer != Boxer1)
										{
											if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12)
											{
												TBoxer = Boxer1;
												GetPlayerName(TBoxer, titel, sizeof(titel));
												new nstring[MAX_PLAYER_NAME];
												format(nstring, sizeof(nstring), "%s", titel);
												strmid(Titel[TitelName], nstring, 0, strlen(nstring), 255);
												Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
												Titel[TitelLoses] = PlayerInfo[TBoxer][pLoses];
												Misc_Save();
												format(string, sizeof(string), "Tin tuc Boxing: %s has Won the fight against Champion %s and is now the new Boxing Champion.",  titel, loser);
												ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
											}
											else
											{
												SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You would have been the Champion if you had the Boxer Job!");
											}
										}
										else
										{
											GetPlayerName(TBoxer, titel, sizeof(titel));
											format(string, sizeof(string), "Tin tuc Boxing: Giai vo dich Boxing %s has Won the fight against %s.",  titel, loser);
											ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
											Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
											Titel[TitelLoses] = PlayerInfo[Boxer1][pLoses];
											Misc_Save();
										}
									}
								}//TBoxer
								format(string, sizeof(string), "* You have Lost the Fight against %s.", winner);
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(Boxer2, "~r~You lost", 3500, 1);
								format(string, sizeof(string), "* You have Won the Fight against %s.", loser);
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(Boxer1, "~g~You won", 3500, 1);
								if(GetPlayerHealth(Boxer1, health) < 20)
								{
									SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
									SetPlayerHealth(Boxer1, 30.0);
								}
								else
								{
									SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
									SetPlayerHealth(Boxer1, 50.0);
								}
								if(GetPlayerHealth(Boxer2, health) < 20)
								{
									SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
									SetPlayerHealth(Boxer2, 30.0);
								}
								else
								{
									SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
									SetPlayerHealth(Boxer2, 50.0);
								}
								GameTextForPlayer(Boxer1, "~g~Match Over", 5000, 1); GameTextForPlayer(Boxer2, "~g~Match Over", 5000, 1);
								if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pBoxSkill] += 1; }
								PlayerBoxing[Boxer1] = 0;
								PlayerBoxing[Boxer2] = 0;
							}
							SetPlayerPos(Boxer1, 768.48, -73.66, 1000.57); SetPlayerPos(Boxer2, 768.48, -73.66, 1000.57);
							SetPlayerInterior(Boxer1, 7); SetPlayerInterior(Boxer2, 7);
							GetPlayerName(Boxer1, winner, sizeof(winner));
							GetPlayerName(Boxer2, loser, sizeof(loser));
							if(PlayerInfo[Boxer2][pJob] == 12 || PlayerInfo[Boxer2][pJob2] == 12) { PlayerInfo[Boxer2][pLoses] += 1; }
							if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pWins] += 1; }
							if(TBoxer != INVALID_PLAYER_ID)
							{
								if(IsPlayerConnected(TBoxer))
								{
									if(TBoxer != Boxer1)
									{
										if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12)
										{
											TBoxer = Boxer1;
											GetPlayerName(TBoxer, titel, sizeof(titel));
											new nstring[MAX_PLAYER_NAME];
											format(nstring, sizeof(nstring), "%s", titel);
											strmid(Titel[TitelName], nstring, 0, strlen(nstring), 255);
											Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
											Titel[TitelLoses] = PlayerInfo[TBoxer][pLoses];
											Misc_Save();
											format(string, sizeof(string), "Tin tuc Boxing: %s has Won the fight against Champion %s and is now the new Boxing Champion.",  titel, loser);
											ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
										}
										else
										{
											SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You would have been the Champion if you had the Boxer Job!");
										}
									}
									else
									{
										GetPlayerName(TBoxer, titel, sizeof(titel));
										format(string, sizeof(string), "Tin tuc Boxing: Giai vo dich Boxing %s has Won the fight against %s.",  titel, loser);
										ProxDetector(30.0, Boxer1, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
										Titel[TitelWins] = PlayerInfo[TBoxer][pWins];
										Titel[TitelLoses] = PlayerInfo[Boxer1][pLoses];
										Misc_Save();
									}
								}
							}//TBoxer
							format(string, sizeof(string), "* You have Lost the Fight against %s.", winner);
							SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, string);
							GameTextForPlayer(Boxer2, "~r~You lost", 3500, 1);
							format(string, sizeof(string), "* You have Won the Fight against %s.", loser);
							SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, string);
							GameTextForPlayer(Boxer1, "~g~You won", 3500, 1);
							if(GetPlayerHealth(Boxer1, health) < 20)
							{
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
								SetPlayerHealth(Boxer1, 30.0);
							}
							else
							{
								SendClientMessageEx(Boxer1, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
								SetPlayerHealth(Boxer1, 50.0);
							}
							if(GetPlayerHealth(Boxer2, health) < 20)
							{
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel exhausted from the Fight, go eat somewhere.");
								SetPlayerHealth(Boxer2, 30.0);
							}
							else
							{
								SendClientMessageEx(Boxer2, COLOR_LIGHTBLUE, "* You feel perfect, even after the Fight.");
								SetPlayerHealth(Boxer2, 50.0);
							}
							GameTextForPlayer(Boxer1, "~g~Match Over", 5000, 1); GameTextForPlayer(Boxer2, "~g~Match Over", 5000, 1);
							if(PlayerInfo[Boxer1][pJob] == 12 || PlayerInfo[Boxer1][pJob2] == 12) { PlayerInfo[Boxer1][pBoxSkill] += 1; }
							PlayerBoxing[Boxer1] = 0;
							PlayerBoxing[Boxer2] = 0;
						}
					}
					InRing = 0;
					RoundStarted = 0;
					Boxer1 = INVALID_PLAYER_ID;
					Boxer2 = INVALID_PLAYER_ID;
					TBoxer = INVALID_PLAYER_ID;
					trigger = 0;
				}
			}
		}
		if(FindTime[i] >= 1)
		{
			if(FindTime[i] == FindTimePoints[i]) {
				FindTime[i] = 0;
				FindTimePoints[i] = 0;
				SetPlayerToTeamColor(FindingPlayer[i]);
				FindingPlayer[i] = -1;
				PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1);
			}
			else
			{
				format(string, sizeof(string), "%d", FindTimePoints[i] - FindTime[i]);
				GameTextForPlayer(i, string, 1500, 6);
				FindTime[i] += 1;
			}
		}
		if(CalledCops[i] >= 1)
		{
			if(CopsCallTime[i] < 1) { CopsCallTime[i] = 0; HidePlayerBeaconForCops(i); CalledCops[i] = 0; }
			else
			{
				CopsCallTime[i]--;
			}
		}
		if(CalledMedics[i] >= 1)
		{
			if(MedicsCallTime[i] < 1) { MedicsCallTime[i] = 0; HidePlayerBeaconForMedics(i); CalledMedics[i] = 0; }
			else
			{
				MedicsCallTime[i]--;
			}
		}
		if(NewbieTimer[i] > 0)
		{
			NewbieTimer[i]--;
		}
		if(OutTimer[i] > 0)
		{
			OutTimer[i]--;
		}
		if(HlKickTimer[i] > 0)
		{
			HlKickTimer[i]--;
		}
		if(HelperTimer[i] > 0)
		{
			HelperTimer[i]--;
		}
		if(JustReported[i] > 0)
		{
			JustReported[i]--;
		}
		if(TaxiCallTime[i] > 0)
		{
			if(TaxiAccepted[i] != INVALID_PLAYER_ID)
			{
				if(IsPlayerConnected(TaxiAccepted[i]))
				{
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(TaxiAccepted[i], X, Y, Z);
					SetPlayerCheckpoint(i, X, Y, Z, 5);
				}
			}
		}
		if(EMSCallTime[i] > 0)
		{
			if(EMSAccepted[i] != INVALID_PLAYER_ID)
			{
				if(IsPlayerConnected(EMSAccepted[i]))
				{
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(EMSAccepted[i], X, Y, Z);
					new zone[MAX_ZONE_NAME];
					Get3DZone(X, Y, Z, zone, sizeof(zone));
					format(string, sizeof(string), "Your patient is located in %s.", zone);
					SetPlayerCheckpoint(i, X, Y, Z, 5);
				}
			}
		}

		if(BusCallTime[i] > 0)
		{
			if(BusAccepted[i] != INVALID_PLAYER_ID)
			{
				if(IsPlayerConnected(BusAccepted[i]))
				{
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(BusAccepted[i], X, Y, Z);
					SetPlayerCheckpoint(i, X, Y, Z, 5);
				}
			}
		}
		if(MedicCallTime[i] > 0)
		{
			if(MedicCallTime[i] == 45) { MedicCallTime[i] = 0; DisablePlayerCheckpoint(i); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1); }
			else
			{
				format(string, sizeof(string), "%d", 45 - MedicCallTime[i]);
				new Float:X,Float:Y,Float:Z;
				GetPlayerPos(MedicAccepted[i], X, Y, Z);
				SetPlayerCheckpoint(i, X, Y, Z, 5);
				GameTextForPlayer(i, string, 1500, 6);
				MedicCallTime[i] += 1;
			}
		}
		if(MechanicCallTime[i] > 0)
		{
			if(MechanicCallTime[i] == 30) { MechanicCallTime[i] = 0; DisablePlayerCheckpoint(i); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1); }
			else
			{
				format(string, sizeof(string), "%d", 30 - MechanicCallTime[i]);
				GameTextForPlayer(i, string, 1500, 6);
				MechanicCallTime[i] += 1;
			}
		}
		if(TowCallTime[i] > 0)
		{
			if(TowCallTime[i] == 30) { TowCallTime[i] = 0; DisablePlayerCheckpoint(i); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~r~RedMarker gone", 2500, 1); }
			else
			{
				format(string, sizeof(string), "%d", 30 - TowCallTime[i]);
				GameTextForPlayer(i, string, 1500, 6);
				TowCallTime[i] += 1;
			}
		}
		if(PlayerCuffed[i] == 1)
		{
			if(PlayerCuffedTime[i] <= 0)
			{
				//Frozen[i] = 0;
    			DeletePVar(i, "IsFrozen");
				TogglePlayerControllable(i, 1);
				PlayerCuffed[i] = 0;
				DeletePVar(i, "PlayerCuffed");
				PlayerCuffedTime[i] = 0;
				ClearAnimations(i);
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos(i, X, Y, Z);
				SetPlayerPos(i, X, Y, Z);
			}
			else
			{
				PlayerCuffedTime[i] -= 1;
			}
		}
		if(PlayerCuffed[i] == 2)
		{
			if(PlayerCuffedTime[i] <= 0)
			{
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos(i, X, Y, Z);
				new copinrange;
				foreach(Player, j)
				{
					if(IsPlayerInRangeOfPoint(j, 30, X, Y, Z) && IsACop(j))
					{
						copinrange = 1;
					}
				}

				if(copinrange == 0)
				{
					//Frozen[i] = 0;
					DeletePVar(i, "IsFrozen");
					GameTextForPlayer(i, "~r~Ban da pha vo cong tay!Ban duoc tu do", 2500, 3);
					TogglePlayerControllable(i, 1);
					PlayerCuffed[i] = 0;
					DeletePVar(i, "PlayerCuffed");
					PlayerCuffedTime[i] = 0;
				}
				else
				{
					PlayerCuffedTime[i] = 60;
				}
			}
			else
			{
				PlayerCuffedTime[i] -= 1;
			}
		}
	}
}
Help me, please!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)