Crashdetect OnPlayerDeath SAMP
#1

Hello there i have problem in my onplayerdeath script i dont know but but crashdetect said

Quote:

[21:06:25] [debug] Run time error 4: "Array index out of bounds"
[21:06:25] [debug] Accessing element at index 65535 past array upper bound 129
[21:06:25] [debug] AMX backtrace:
[21:06:25] [debug] #0 003f93e8 in public FC_OnPlayerDeath () from HighSpeedDriversmm3rev7.amx
[21:06:25] [debug] #1 native CallLocalFunction () [00473f40] from samp-server.exe
[21:06:25] [debug] #2 0001223c in public OnPlayerDeath () from HighSpeedDriversmm3rev7.amx
[21:06:25] [death] semara died 255

here is the script
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	//killerid != playerid && playerid != killerid &&
    SendDeathMessage(killerid, playerid, reason);
	GameTextForPlayer(playerid, "~r~Wasted", 2000, 5);
	if(killerid != INVALID_PLAYER_ID)
	{
		PlayerInfo[playerid][Deaths]++;
		PlayerInfo[killerid][Kills]++;
	}
	if(PlayerInfo[playerid][JoinedEvent] == true)
	{
	    PlayerInfo[playerid][JoinedEvent] = false;
		foreach(Player, i)
		{
		    if(PlayerInfo[i][AdminLevel] >= 1)
		    {
				new name[MAX_PLAYER_NAME], string[128];
				GetPlayerName(playerid, name, sizeof(name));
				format(string, sizeof(string), "%s has died in the event", name);
		        SendClientMessage(i, COLOR_RED, string);
			}
		}
	}
	if(PlayerInfo[killerid][World] != DMWorldID && PlayerInfo[playerid][JoinedEvent] == false && PlayerInfo[killerid][World] != TDMWorldID && PlayerInfo[killerid][World] != FreeroamID)
	{
	    if(killerid != INVALID_PLAYER_ID)
	    {
	        if(PlayerInfo[killerid][MaxDMWarnings] == 3)
			{
			    new name[MAX_PLAYER_NAME], string[160];
			    GetPlayerName(killerid, name, sizeof(name));
			    format(string, sizeof(string), "SERVER-KICK: %s (Reason: killing people outside the Deathmatch World) Warning: 3/3", name);
			    SendClientMessageToAll(BANNEDMESSAGE, string);
			    return Kick(killerid);
			}
		    else if(PlayerInfo[killerid][MaxDMWarnings] != 3)
		    {
				new name[MAX_PLAYER_NAME];
				new string[160];
				GetPlayerName(killerid, name, sizeof(name));
				PlayerInfo[killerid][MaxDMWarnings]++;
				format(string, sizeof(string), "SERVER-WARN: %s (Reason: killing people outside the Deathmatch World) Warning: %d/3", name, PlayerInfo[killerid][MaxDMWarnings]);
				SendClientMessageToAll(BANNEDMESSAGE, string);
			    GameTextForPlayer(killerid, "~r~HEY! you may not kill people outside the DM World!!!", 5000, 5);
				cmd_kill(killerid, "");
			}
		}
		else return 1;
	}
	else if(PlayerInfo[killerid][World] == DMWorldID || PlayerInfo[killerid][World] == TDMWorldID || PlayerInfo[killerid][World] == FreeroamID)
	{
	    if(killerid != INVALID_PLAYER_ID)
	    {
	    	GivePlayerMoney(killerid, 2500);
			SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
 			GameTextForPlayer(killerid, "~r~you earned $2500 and 2 Score for killing an opponent", 2000, 5);
 			PlayerInfo[killerid][KillingSpree]++;
			if(PlayerInfo[killerid][KillingSpree] == 3)
			{
				new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is starting to Own People! he has a Killing Spree of 3 and earned $5000 and 4 Score", kname);
				GivePlayerMoney(killerid, 5000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+4);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			else if(PlayerInfo[killerid][KillingSpree] == 6)
			{
			    new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is the Killer!! he has a Killing Spree of 6 and earned $10000 and 8 Score", kname);
				GivePlayerMoney(killerid, 10000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+8);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			else if(PlayerInfo[killerid][KillingSpree] == 10)
			{
			    new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is Unstoppable!!! he has a Killing Spree of 10 and earned $15000 and 10 Score", kname);
				GivePlayerMoney(killerid, 15000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			else if(PlayerInfo[killerid][KillingSpree] == 15)
			{
			    new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is the GodKiller!!!! he has a Killing Spree of 15 and earned $20000 and 15 Score", kname);
				GivePlayerMoney(killerid, 20000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+15);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			else if(PlayerInfo[killerid][KillingSpree] == 20)
			{
			    new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is the Master!!!!! he has a Killing Spree of 20 and earned $30000 and 20 Score", kname);
				GivePlayerMoney(killerid, 30000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+20);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			else if(PlayerInfo[killerid][KillingSpree] == 30)
			{
			    new string[128], kname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kname, sizeof(kname));
				format(string, sizeof(string), "%s is the Ultimate Killer!!!!! he has a Killing Spree of 30 and earned $50000 and 30 Score", kname);
				GivePlayerMoney(killerid, 50000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+30);
				foreach(Player, i)
				{
				    SendClientMessage(i, PLAYERCOLOR_AQUA, string);
				}
			}
			if(PlayerInfo[playerid][KillingSpree] == 3)
			{
				GivePlayerMoney(killerid, 5000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+4);
				SendClientMessage(killerid, COLOR_ORANGE, "you have killed someone with a killing spree of 3 and earned $5000 and 4 Score");
			}
			else if(PlayerInfo[playerid][KillingSpree] == 6)
			{
				GivePlayerMoney(killerid, 10000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+8);
				SendClientMessage(killerid, PLAYERCOLOR_AQUA, "you have killed someone with a killing spree of 6 and earned $10000 and 8 Score");
			}
			else if(PlayerInfo[playerid][KillingSpree] == 10)
			{
				GivePlayerMoney(killerid, 15000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
				SendClientMessage(killerid, PLAYERCOLOR_AQUA, "you have killed someone with a killing spree of 10 and earned $15000 and 10 Score");
			}
			else if(PlayerInfo[playerid][KillingSpree] == 15)
			{
				GivePlayerMoney(killerid, 20000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+15);
				SendClientMessage(killerid, PLAYERCOLOR_AQUA, "you have killed someone with a killing spree of 15 and earned $20000 and 15 Score");
			}
			else if(PlayerInfo[playerid][KillingSpree] == 20)
			{
				GivePlayerMoney(killerid, 30000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+20);
				SendClientMessage(killerid, PLAYERCOLOR_AQUA, "you have killed someone with a killing spree of 20 and earned $30000 and 20 Score");
			}
			else if(PlayerInfo[playerid][KillingSpree] == 30)
			{
				GivePlayerMoney(killerid, 50000);
				SetPlayerScore(killerid, GetPlayerScore(killerid)+25);
				SendClientMessage(killerid, PLAYERCOLOR_AQUA, "you have killed someone with a killing spree of 30 and earned $50000 and 25 Score");
			}
		}
		else return 1;
	}
	return 1;
}
plss help if there is a problem

sry for my bad english
Reply


Messages In This Thread
Crashdetect OnPlayerDeath SAMP - by semara123 - 16.05.2015, 14:20
Re: Crashdetect OnPlayerDeath SAMP - by Jefff - 16.05.2015, 14:28
Re: Crashdetect OnPlayerDeath SAMP - by Konstantinos - 16.05.2015, 14:31
Re: Crashdetect OnPlayerDeath SAMP - by Threshold - 16.05.2015, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)