03.06.2012, 14:13
Hi guys! Can somebody help me to detect the problem from this script? REP++
PHP код:
[17:15:13] [debug] Run time error 4: "Array index out of bounds"
[17:15:13] [debug] Accessing element at index 65535 past array upper bound 99
[17:15:13] [debug] AMX backtrace:
[17:15:13] [debug] #0 00018a0c in public OnPlayerDeath () from GM.amx
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
// (Update Kills/Deaths)
AccInfo[playerid][Deaths]++;
userid = BUD::GetNameUID( PlayerName2(playerid) );
BUD::MultiSet( userid, "i", "Deaths", AccInfo[playerid][Deaths]);
AccInfo[killerid][Kills]++;
userid = BUD::GetNameUID( PlayerName2(killerid) );
BUD::MultiSet( userid, "i", "Kills", AccInfo[killerid][Kills]);
// (Clan Kills/Deaths)
if( IsPlayerAnyClanMember(playerid) && IsPlayerAnyClanMember(killerid) )
{
new clanquery[300];
format(clanquery, sizeof(clanquery), "UPDATE clans SET clankills = %d WHERE clanname = '%s'", GetClanKills(GetPlayerClan(killerid)) + 1, GetPlayerClan(killerid));
db_query( Database, clanquery );
format(clanquery, sizeof(clanquery), "UPDATE clans SET clandeaths = %d WHERE clanname = '%s'", GetClanDeaths(GetPlayerClan(playerid)) + 1, GetPlayerClan(playerid));
db_query( Database, clanquery );
}
// (Snow)
if(Snow_F[playerid] == 1){Snow_F[playerid] = 0;}
// (Race)
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
TextDrawHideForPlayer(playerid, Text:RaceInfo[playerid]);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
#if defined RACE_IN_OTHER_WORLD
SetPlayerVirtualWorld(playerid, 0);
#endif
}
SendDeathMessage(killerid,playerid,reason);//Msg
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
TextDrawHideForPlayer(playerid,txtAnimHelper);
}
// (End)
InDuel[playerid] = 0;
// (LuxAdmin)
if(AccInfo[playerid][pCaged] == 1)
{
cage[playerid] = DestroyObject(cage[playerid]);
cage2[playerid] = DestroyObject(cage2[playerid]);
cage3[playerid] = DestroyObject(cage3[playerid]);
cage4[playerid] = DestroyObject(cage4[playerid]);
}
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
//==============================================================================
// In Duel
//==============================================================================
if(InDuel[playerid] == 1 && InDuel[killerid] == 1)
{
GameTextForPlayer(playerid,"Loser!",3000,3);
GameTextForPlayer(killerid,"Winner!",3000,3);
InDuel[killerid] = 0;
SetPlayerPos(killerid, 0.0, 0.0, 0.0);
SpawnPlayer(killerid);
}
else if(InDuel[playerid] == 1 && InDuel[killerid] == 0)
{
GameTextForPlayer(playerid,"Loser !",3000,3);
}
}
//==============================================================================
// Spectate
//==============================================================================
for(new xp=0; xp<MAX_PLAYERS; xp++)
if(GetPlayerState(xp) == PLAYER_STATE_SPECTATING && AccInfo[xp][SpecID] == playerid)
AdvanceSpectate(xp);
// (Mega Mode)
DeletePVar(playerid, "Status");
DestroyObject(GetPVarInt(playerid, "mode0"));
DestroyObject(GetPVarInt(playerid, "mode1"));
DestroyObject(GetPVarInt(playerid, "mode2"));
DestroyObject(GetPVarInt(playerid, "mode3"));
DestroyObject(GetPVarInt(playerid, "mode4"));
DestroyObject(GetPVarInt(playerid, "mode5"));
DeletePVar(playerid, "BStatus");
DestroyObject(GetPVarInt(playerid, "bmode0"));
DestroyObject(GetPVarInt(playerid, "bmode1"));
DestroyObject(GetPVarInt(playerid, "bmode2"));
DestroyObject(GetPVarInt(playerid, "bmode3"));
return ( 1 );
}