02.03.2013, 11:11
hello guys i have a problem which someone dies it shows me the crash detect warning
OnPlayerDeath Callback
pawn Код:
[12:30:20] [debug] Run time error 4: "Array index out of bounds"
[12:30:20] [debug] Accessing element at index 65535 past array upper bound 499
[12:30:20] [debug] AMX backtrace:
[12:30:20] [debug] #0 0001ea74 in public FC_OnPlayerDeath () from lscnr_mysql.amx
[12:30:20] [debug] #1 native CallLocalFunction () [00471e90] from samp-server.exe
[12:30:20] [debug] #2 0000218c in public OnPlayerDeath () from lscnr_mysql.amx
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
//Adds Player Death and kills
pInfo[killerid][Kills] ++;
pInfo[playerid][Deaths] ++;
zoneupdates[playerid] =0;
SetPlayerWantedLevel(playerid, 0);
if(HasHit[playerid] >= 1)
{
if(gTeam[playerid] == TEAM_HITMAN)
{
new string[128];
format(string,sizeof(string),"{FFDA00}[HIT DEATH]:{FFFFFF} %s(%d) has been killed by %s(%d) for a hit contract.",PlayerName(playerid),playerid,PlayerName(killerid),killerid);
SendClientMessageToAll(-1,string);
//
GivePlayerMoney(killerid,HitMoney[playerid]);
SendClientMessage(killerid,COLOR_GREY,"[[_Contract Completed_]]");
format(string,sizeof(string),"~b~Hit Contract Completed~n~~b~Received ~p~$%d",HitMoney[playerid]);
GameTextForPlayer(killerid,string,5000,3);
IncreaseWantedLevel(killerid,20);
//
format(string,sizeof(string),"[DISPATCH] Suspect %s(%d) has murdered %s(%d) and has been caught on CCTV. Arrest the suspect ASAP.",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);
//
HasHit[playerid] =0;
HitMoney[playerid] =0;
SetPlayerWantedLevel(playerid, 0);
pInfo[killerid][TotalHitFinished] ++;
}
return 1;
}
//Sends a Death Message
SendDeathMessage(killerid,playerid,reason);
//Reset the HouseID where the player is located
APlayerData[playerid][CurrentHouse] = 0;
return 1;
}