Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Crash при смерти

Статус
В этой теме нельзя размещать новые ответы.

Stefa

Новичок
Ув. пользователи pawno-info.

При смерти игрока в server_log, ну и в консоли выдает сообщение:

PHP:
[23:34:16] [debug] Run time error 4: "Array index out of bounds"
[23:34:16] [debug]  Accessing element at index 65535 past array upper bound 0
[23:34:16] [debug] AMX backtrace:
[23:34:16] [debug] #0 000c5030 in public OnPlayerDeath (0, 65535, 54) from lolmod.amx
Я знаю что это довольно таки известная проблема, но все таки я не знаю как ее решить!?

Вот public OnPlayerDeath
PHP:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerOnJob[playerid] = false;
	PlayerStartJob[playerid] = false;
	GetPlayerMetall[playerid] = 0;
	AllPlayerMetall[playerid] = 0;
	GetPlayerMetallEx[playerid] = 0;
	AllPlayerMetallEx[playerid] = 0;
	ExtraMetall[playerid] = 0;
    plafk[playerid] = 0;
    death[playerid] = 1;
//	TextDrawHideForPlayer(playerid,Welcome[playerid]);
	TextDrawHideForPlayer(playerid,BoxMP[playerid]);
	SetPlayerHealthAC(playerid, 100);
	new stringer[144];
	if(!AntiFakeKill[playerid]) return Kick(playerid);
	AntiFakeKill[playerid] = false;
	SetPVarInt(playerid,"K_Times",GetPVarInt(playerid,"K_Times") + 1);
	if(GetPVarInt(playerid,"K_Times") > 1) return KickEx(playerid);
	//==============================================================================
	TeleportTime[playerid] = 3;
	//==============================================================================
	if(PlayerInfo[playerid][pJob] == 2)
	{
		if(gcontract[playerid] == 1)
		{
			Delete3DTextLabel(Meh3d[GetPlayerVehicleID(playerid)]);
			gcontract[playerid] = 0;
		}
	}
	if(AlhambraDJ == true && AlhambraDJID == playerid) AlhambraDJ = false, AlhambraDJID = INVALID_PLAYER_ID;
	if(JizzyDJ == true && JizzyDJID == playerid) JizzyDJ = false, JizzyDJID = INVALID_PLAYER_ID;
 	if(capt == 1 || capt == 10)
	{
		if(FrakCD[PlayerInfo[playerid][pMember]])
		{
			for(new i =1;i<sizeof(GZInfo);i++)
			{
				if(PlayerToKvadrat(playerid,GZInfo[i][gCoords][0], GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]))
				{
					if(captureteam[0] == PlayerInfo[killerid][pMember] && PlayerInfo[playerid][pMember] == captureteam[1])
					{
						new fragkolv[8];
						CommandKill[0]++;
						format(fragkolv, sizeof(fragkolv), "%d", CommandKill[0]);
						TextDrawSetString(koltwo, fragkolv);
						foreach(new ja: Player)
						{
							if(IsGhettor(ja))
							{
								SendDeathMessageToPlayer(ja,killerid, playerid, reason);
							}
							else
							{
								SendDeathMessageToPlayer(ja,1001, 1001, 200);
							}
						}
					}
					else if(captureteam[1] == PlayerInfo[killerid][pMember] && PlayerInfo[playerid][pMember] == captureteam[0])
					{
						new fragkolv[8];
						CommandKill[1]++;
						format(fragkolv, sizeof(fragkolv), "%d", CommandKill[1]);
						TextDrawSetString(kolone, fragkolv);
      					if(killstat[playerid] == 0)
						{
    						SendDeathMessage(killerid, playerid, reason);
						}
					}
					else return true;
				}//сюдажек
			}
		}
	}
	if(reason == 38)
	{
		if(PlayerInfo[playerid][playerAdminka] < 9)
		{
			new warnn[128];
			format(warnn, sizeof(warnn), "[Античит] %s[%d] кикнут `Убийство с минигана` (Код:CH||MG1)",PlayerInfo[killerid][pNames],killerid);
			ABroadCast(0xfb7e52FF,warnn,2);
			SendAdminMessage(COLOR_RED, warnn);
		}
	}
	if(fightid[playerid] == killerid)
	{
		ring = 0;
		format(stringer, sizeof(stringer), " ~g~%s Win!", PlayerInfo[killerid][pNames]);
		GameTextForPlayer(killerid, stringer, 3000, 6);
		format(stringer, sizeof(stringer), " ~g~%s Win!", PlayerInfo[killerid][pNames]);
		GameTextForPlayer(playerid, stringer, 3000, 6);
		switch(PlayerInfo[killerid][pFightSkil])
		{
		case 0..49: PlayerInfo[killerid][pFightSkil]++, PlayerInfo[killerid][pFightTime]= 600;
		case 50: PlayerInfo[killerid][pFightSkill]++, PlayerInfo[killerid][pFightTime]= 600;
		case 51..99: PlayerInfo[killerid][pFightSkil]++, PlayerInfo[killerid][pFightTime]= 540;
		case 100: PlayerInfo[killerid][pFightSkill]++, PlayerInfo[killerid][pFightTime]= 540;
		case 101..149: PlayerInfo[killerid][pFightSkil]++, PlayerInfo[killerid][pFightTime]= 480;
		case 150: PlayerInfo[killerid][pFightSkill]++, PlayerInfo[killerid][pFightTime]= 480;
		case 151..199: PlayerInfo[killerid][pFightSkil]++, PlayerInfo[killerid][pFightTime]= 420;
		case 200: PlayerInfo[killerid][pFightSkill]++, PlayerInfo[killerid][pFightTime]= 420;
		}
		PlayerInfo[killerid][pFightSkil]++;
		PlayerInfo[playerid][pFightTime]= 600;
		PlayerInfo[killerid][pFightTime]= 600;
		SetPPos(playerid,770.7656,3.9569,1000.7176);
		SetPlayerFacingAngle(playerid, 90.0);
		SetPPos(killerid,770.7488,6.9432,1000.7118);
		SetPlayerFacingAngle(killerid, 90.0);
		SetPlayerHealthAC(playerid, 50);
		SetPlayerHealthAC(killerid, 75);
		fightid[playerid] = INVALID_PLAYER_ID;
		fightid[killerid] = INVALID_PLAYER_ID;
		TimeBox[playerid] = 0;
		TimeBoxAll[playerid] = 0;
		TimeBox[killerid] = 0;
		KillTimer(Timerkk[playerid]);
		TimeBoxAll[killerid] = 0;
		boy[playerid] = 0;
		boy[killerid] = 0;
	}
	PlayerHealth[playerid] = 100;
	SetPlayerHealthAC(playerid, PlayerHealth[playerid]);
	zips[playerid] = 0;
	enterbiz[playerid] = 255;
	udar[playerid] = 0;
	Delgun(playerid);
	RemovePlayerAttachedObject(playerid,1);
	RemovePlayerAttachedObject(playerid,2);
	RemovePlayerAttachedObject(playerid,3);
	RemovePlayerAttachedObject(playerid,4);
	RemovePlayerAttachedObject(playerid,0);
	arenda[playerid] = 0;
	showhelp[playerid] = 0;
	showhelp2[playerid] = 0;
	takephone[playerid] = 0;
	gag[playerid] = 0;
	usemats[playerid] = 0;
	if(SelectChar[playerid] == 255)
	{
		SetPlayerSkin(playerid, OldSkin[playerid]);
		PlayerInfo[playerid][pChar] = OldSkin[playerid];
		SelectChar[playerid] = 0;
	}
	//---------- Ганы
	new weaponid;
	new gunname[25];
	GetWeaponName(weaponid, gunname, sizeof(gunname));
	Delgun(playerid);
	//-----------
	PlayerInfo[playerid][pDrugtime] = 0;
	PlayerInfo[playerid][pGunfbiTime] = 0;
	forma[playerid] = 0;
	proverkaforma[playerid] = 0;
	new Float:px,Float:py,Float:pz;
	gPlayerSpawned[playerid] = 0;
	PlayerInfo[playerid][pLocal] = 255;
	GetPlayerPos(playerid, px, py, pz);
	DisablePlayerCheckpoint(playerid);
	keys[playerid] = 0;
	LiveOffer[playerid] = INVALID_PLAYER_ID;
	TalkingLive[playerid] = INVALID_PLAYER_ID;
	LiveOfferls[playerid] = INVALID_PLAYER_ID;
	TalkingLivels[playerid] = INVALID_PLAYER_ID;
	if(PlayerInfo[playerid][pMember] == 0 && PlayerInfo[playerid][pLeader] == 0) PlayerInfo[playerid][pHospital] = 1;
	Tel[playerid] = INVALID_PLAYER_ID;
	if(!IsACop(killerid)) PlayerInfo[killerid][pKills]+=1;
	PlayerInfo[killerid][pZakonp] -= 0;
	if(PlayerInfo[playerid][pMember] == 4) Medics -= 1;
	if(PlayerInfo[playerid][pWanted] > 0)
	{
		if(IsACop(killerid))
		{
			PlayerInfo[playerid][pMestoJail] = 1;
			if(PlayerInfo[playerid][pWanted] == 1)
			{
				PlayerInfo[playerid][pCash]-=1;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$1", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 600 секунд. Штраф 1 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 600 секунд. Премия 1 вирт");
				PlayerInfo[playerid][pWanted] =0;
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 600;
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
			}
			else if(PlayerInfo[playerid][pWanted] == 2)
			{
				GiveMoney(killerid,0);
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pCash]-=2;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$2", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 1200 секунд. Штраф 2 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 1200 секунд. Премия 1 вирт");
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 1200;
				PlayerInfo[playerid][pWanted] =0;
			}
			else if(PlayerInfo[playerid][pWanted] == 3)
			{
				GiveMoney(killerid,0);
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pCash]-=3;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$3", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 1800 секунд. Штраф 3 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 1800 секунд. Премия 1 вирт");
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 1800;
				PlayerInfo[playerid][pWanted] =0;
			}
			else if(PlayerInfo[playerid][pWanted] == 4)
			{
				GiveMoney(killerid,0);
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pCash]-=4;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$4", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 2400 секунд. Штраф 4 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 2400 секунд. Премия 1 вирт");
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 2400;
				PlayerInfo[playerid][pWanted] =0;
			}
			else if(PlayerInfo[playerid][pWanted] == 5)
			{
				GiveMoney(killerid,0);
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pCash]-=5;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$5", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 3000 секунд. Штраф 5 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 3000 секунд. Премия 1 вирт.");
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 3000;
				PlayerInfo[playerid][pWanted] =0;
			}
			else if(PlayerInfo[playerid][pWanted] >= 6)
			{
				GiveMoney(killerid,0);
				Delgun(playerid);
				ResetPlayerWeapons(playerid);
				PlayerInfo[playerid][pCash]-=6;
				PlayerInfo[killerid][pCash]+=1;
				format(stringer, sizeof(stringer), "~r~-$6", playerid);
				GameTextForPlayer(playerid, stringer, 5000, 1);
				SendClientMessage(playerid,COLOR_YELLOW,"Вас посадили в тюрьму на 3600 секунд. Штраф 6 вирт");
				SendClientMessage(killerid,COLOR_YELLOW,"Вы посадили преступника на 3600 секунд. Премия 1 вирт.");
				PlayerInfo[playerid][pJailed] = 1;
				PlayerInfo[playerid][pJailTime] = 3600;
				PlayerInfo[playerid][pWanted] =0;
			}
		}
		PlayerInfo[playerid][pWanted] = 0;
	}
	//----------------------------------[ Навыки ] -----------------------------------------------------------------------
	if (!IsAArm(killerid)|| !IsACop(killerid) || !IsAMayor(killerid))
	{
		if(PlayerInfo[killerid][pJailed] == 0)
		{
			WantedPoints[killerid]++;
			if(PlayerInfo[killerid][pWanted] != 6) PlayerInfo[killerid][pWanted]+=1;
		}
	}
	if(killerid != INVALID_PLAYER_ID)
	{
		if(GetPlayerState(killerid) == 2)
		{
		    if(vehmodel[killerid] > 0) return SendClientMessage(killerid, 0xFF4500FF, "Вы были кикнуты с сервера за DB(DriveBy)"), KickEx(killerid);
			SendClientMessage(killerid, 0xFF4500FF, "DB запрещено на сервере! В случае многократного нарушения Вас накажут");
			new stringg[512];
			format(stringg, sizeof(stringg), "[A] {FF4500}Игрок %s[%d] нарушает правила сервера (DB)", PlayerInfo[killerid][pNames], killerid);
			SendAdminMessage(0x99CC00FF, stringg);
			//KickEx(killerid);
			return true;
		}
	}
	if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
	{
		DisablePlayerCheckpoint(playerid);
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
	}
	new caller = Mobile[playerid];
	if(caller != INVALID_PLAYER_ID)
	{
		if(caller != INVALID_PLAYER_ID)
		{
			SendClientMessage(caller,  COLOR_GRAD2, "Связь оборвалась...");
			CellTime[caller] = 0;
			CellTime[playerid] = 0;
			Mobile[caller] = INVALID_PLAYER_ID;
		}
		Mobile[playerid] = INVALID_PLAYER_ID;
		CellTime[playerid] = 0;
	}
	if(IsAGang(killerid))
	{
		if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pMember] == 3)
		{
			for(new i =0;i<sizeof(GZInfo);i++)
			{
				if(PlayerToKvadrat(playerid,GZInfo[i][gCoords][0], GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]))
				{
					forma[killerid] = 1;
					PlayerInfo[playerid][pModel] =252;
					SendClientMessage(playerid,  COLOR_YELLOW, "Вы потеряли армейскую форму");
					SendClientMessage(killerid,  COLOR_YELLOW2, "Вы cняли с армейца форму, введите /switchskin, чтобы переодеться");

					format(stringer, sizeof(stringer), "%s потерял армейскую форму", PlayerInfo[playerid][pNames]);
					SendFamilyMessage(19,COLOR_YELLOW2, stringer);
					SendFamilyMessage(3,COLOR_YELLOW2, stringer);
					SpawnPlayer(playerid);
				}
			}
		}
	}
	if(IsAGang(killerid))
	{
		if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 21)
		{
			for(new i =0;i<sizeof(GZInfo);i++)
			{
				if(PlayerToKvadrat(playerid,GZInfo[i][gCoords][0], GZInfo[i][gCoords][1],GZInfo[i][gCoords][2],GZInfo[i][gCoords][3]))
				{
					keys[killerid] += 1;
					SendClientMessage(playerid,  COLOR_YELLOW, "Вы потеряли ключи от камеры!");
					SendClientMessage(killerid,  COLOR_YELLOW, "Вы забрали у полицейского ключи от камеры!");
					format(stringer, sizeof(stringer), "Полицейский %s потерял ключи от камеры", PlayerInfo[playerid][pNames]);
					SendFamilyMessage(1,COLOR_YELLOW2, stringer);
					SendFamilyMessage(2,COLOR_YELLOW2, stringer);
					SendFamilyMessage(10,COLOR_YELLOW2, stringer);
					SendFamilyMessage(21,COLOR_YELLOW2, stringer);
				}
			}
		}
	}
	if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11) DisablePlayerCheckpoint(playerid),gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
	DisablePlayerCheckpoint(playerid);
	return true;
}
P.S: Кто может помочь мне нормально установить crashdetect, пищите в теме, просто я делаю все так как по инструкции а в консоли не показывает в какой строчке ошибка!
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу