error with onplayerdeath
#1

i have error with onplayer death :S

server log:

Код:
[23:33:15] [debug] Run time error 4: "Array index out of bounds"
[23:33:15] [debug]  Accessing element at index 65535 past array upper bound 99
[23:33:15] [debug] AMX backtrace:
[23:33:15] [debug] #0 002a52d8 in public OnPlayerDeath (0x00000001, 0x0000ffff, 0x000000ff) from CHFR.amx
[23:33:15] [death] Max died 255
public onplayerdeath

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(Joined[playerid] == true)
    {
		JoinCount--;
		Joined[playerid] = false;
		DestroyVehicle(CreatedRaceVeh[playerid]);
		DisablePlayerRaceCheckpoint(playerid);
		TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
		CPProgess[playerid] = 0;
		KillTimer(InfoTimer[playerid]);
		#if defined RACE_IN_OTHER_WORLD
		SetPlayerVirtualWorld(playerid, 0);
		#endif
	}
	if(BuildRace == playerid+1) BuildRace = 0;
    //if(killerid != INVALID_PLAYER_ID)

    if(PlayerInfo[killerid][pLogiran] == 1)
    {
    if(PlayerInfo[playerid][pMeta] == 1)
    {
    new string[126];
    format(string, sizeof(string), "META: Igrac %s je prvi ubio %s i dobio %d Scorea", PlayerName(killerid), PlayerName(playerid), PlayerInfo[playerid][pMetaCijena]);
    SCMToAll(Zuta3,string);
    SCM(playerid,Zuta3,"*Ubijen si kao meta!");
    GivePlayerCash(killerid, PlayerInfo[playerid][pMetaCijena]);
    PlayerInfo[playerid][pMeta] = 0;
    PlayerInfo[playerid][pMetaCijena] = 0;
    }
    }

    if(CB[playerid] == 1)
	{
 	GetPlayerPos(playerid, X_Pos, Y_Pos, Z_Pos);
 	foreach(Player,i)
	{
	SetPlayerCheckpoint(i, X_Pos, Y_Pos, Z_Pos, 5.0);
	}
	new string[128];
	format(string, sizeof(string), "| Cashbox | : {FFFFFF}  Igrac %s je izgubio vozilo za isplatu! Otidi na marker i pokupi ga!", PlayerName(playerid));
	SCMToAll(Zuta3, string);
	CB[playerid] = 0;
	ImaCB[playerid] = false;
   	}

	GivePlayerCash(killerid, 100);
	GivePlayerCash(playerid, -50);

    antifakekill[playerid] ++;
    SetTimerEx("antifakekill2", 2000,false,"i",playerid);

    new string[128];
    if(PlayerInfo[killerid][war1] == 1 && PlayerInfo[playerid][war2] == 1)
	{
	ZutiWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid),  PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
 	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war2] == 1 && PlayerInfo[playerid][war1] == 1)
	{
	CrveniWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid), PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
 	GivePlayerCash(killerid,100);
	}
	else if((PlayerInfo[killerid][war2] == 1 || PlayerInfo[killerid][war2] == 2)  && (PlayerInfo[playerid][war2] == 1 || PlayerInfo[playerid][war2] == 2))
	{
  	CrveniWarBodovi--;
	CrveniWarBodovi--;
	format(string, sizeof(string), "(WAR) Igrac %s je napravio TK! Ekipa je izgubila 2 poena!", PlayerName(killerid));
	SCM(killerid,0xFFFF00AA,"Napravio si TK! Tvoja ekipa je izgubila 2 poena!");
	SendWarMessage(SLjubicasta, string);
	}
	else if((PlayerInfo[killerid][war1] == 1 || PlayerInfo[killerid][war1] == 2)  && (PlayerInfo[playerid][war1] == 1 || PlayerInfo[playerid][war1] == 2))
	{
	ZutiWarBodovi--;
	ZutiWarBodovi--;
	format(string, sizeof(string), "(WAR) Igrac %s je napravio TK! Ekipa je izgubila 2 poena!", PlayerName(killerid));
	SCM(killerid,0xFFFF00AA,"Napravio si TK! Tvoja ekipa je izgubila 2 poena!");
	SendWarMessage(SLjubicasta, string);
	}
    else if(PlayerInfo[killerid][war1] == 1 && PlayerInfo[playerid][war2] == 2)
	{
	ZutiWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid),  PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war2] == 1 && PlayerInfo[playerid][war1] == 2)
	{
	CrveniWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid), PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war2] == 2 && PlayerInfo[playerid][war1] == 1)
	{
	CrveniWarBodovi++;
	CrveniWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid), PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war2] == 2 && PlayerInfo[playerid][war1] == 2)
	{
	CrveniWarBodovi++;
	CrveniWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid), PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war1] == 2 && PlayerInfo[playerid][war2] == 1)
	{
	ZutiWarBodovi++;
	ZutiWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid),  PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	else if(PlayerInfo[killerid][war1] == 2 && PlayerInfo[playerid][war2] == 2)
	{
	ZutiWarBodovi++;
	ZutiWarBodovi++;
	format(string, sizeof(string), "(WAR) %s je ubio protivnika %s", PlayerName(killerid),  PlayerName(playerid));
	SendWarMessage(WarLjubicasta, string);
	GivePlayerCash(killerid,100);
	}
	SendDeathMessage(killerid, playerid, reason);
    return 1;
}
help me !
Reply


Messages In This Thread
error with onplayerdeath - by TarikAmina - 28.08.2013, 21:40
Re: error with onplayerdeath - by RedJohn - 28.08.2013, 21:42
Re: error with onplayerdeath - by TarikAmina - 28.08.2013, 21:44
Re: error with onplayerdeath - by RedJohn - 28.08.2013, 21:52
Re: error with onplayerdeath - by TarikAmina - 28.08.2013, 21:59
Re: error with onplayerdeath - by TarikAmina - 29.08.2013, 08:25

Forum Jump:


Users browsing this thread: 1 Guest(s)