17.03.2017, 22:52
PHP код:
[19:47:10] [debug] Run time error 4: "Array index out of bounds"
[19:47:10] [debug] Attempted to read/write array element at index 65535 in array of size 1000
[19:47:10] [debug] AMX backtrace:
[19:47:10] [debug] #0 0002d724 in ?? (21, 65535, 255) from Mundito.amx
[19:47:10] [debug] #1 0000cd7c in public OnPlayerDeath (21, 65535, 255) from Mundito.amx
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid,playerid,reason);
//-----------------------------------------
new string[256];
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
kills[playerid]=0;//nuevo
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
format(string,sizeof(string), "~n~~w~HAS SIDO ASESINADO POR~n~~r~%s", Nombre(killerid));
GameTextForPlayer(playerid,string,2000,3);
format(string,sizeof(string),">> Recibido +1 score y +$200 por matar a '%s', Asesinatos seguidos: %d",Nombre(playerid), KillingSpree[killerid]);
SendClientMessage(killerid,0x00FF00FF,string);
GivePlayerCash(killerid,200);
//===================================================
if(KillingSpree[killerid] == 3)
{
format(string,sizeof(string),"» Recompensa « %s lleva 3 asesinatos seguidos, el que lo mate ganara $300.",Nombre(killerid));
SendClientMessageToAll(0xFF8000FF,string);
Cantidad[killerid] = 1;
Cantidad[killerid] = 300;
}
if(KillingSpree[killerid] == 5)
{
format(string,sizeof(string),"» Recompensa « %s lleva 5 asesinatos seguidos, el que lo mate ganara $500.",Nombre(killerid));
SendClientMessageToAll(0xFF8000FF,string);
Cantidad[killerid] = 1;
Cantidad[killerid] = 500;
}
if(KillingSpree[killerid] == 10)
{
format(string,sizeof(string),"» Recompensa « %s lleva 10 asesinatos seguidos, el que lo mate ganara $700.",Nombre(killerid));
SendClientMessageToAll(0xFF8000FF,string);
Cantidad[killerid] = 1;
Cantidad[killerid] = 700;
}
if(KillingSpree[killerid] == 15)
{
format(string,sizeof(string),"» Recompensa « %s lleva 15 asesinatos seguidos, el que lo mate ganara $900.",Nombre(killerid));
SendClientMessageToAll(0xFF8000FF,string);
Cantidad[killerid] = 1;
Cantidad[killerid] = 900;
}
if(Cantidad[playerid] > 0 && killerid != playerid)
{
format(string, sizeof(string), "» Recompensa « %s a recibido $%i por matar a %s.", Nombre(killerid), Cantidad[playerid], Nombre(playerid));
SendClientMessageToAll( 0xFF9900FF , string);
GivePlayerCash(killerid, Cantidad[playerid]);
Cantidad[playerid] = 0;
return 0;
}
//===================================================
//GivePlayerCash(playerid, -100);
TextDrawHideForPlayer(playerid, AbajoVida[playerid]);
//Vida y chaleco
new stringasda[256];
TextDrawHideForPlayer(playerid, Armadura[playerid]);
format(stringasda, sizeof(stringasda), "_KILL");
TextDrawSetString(Vidaa[playerid], stringasda);
//
new
sString[128],
//Name[MAX_PLAYER_NAME],
zName[MAX_PLAYER_NAME],
Float:Health,
Float:Armor;
if((reason == 50)||(reason == 49))
{
new string2[500];
format(string2, 128, "** %s ha sido encarcelado por el Administrador MuNdo InFerNal | Razуn: Matar en Vehiculo {E30000}(Carkill/Helikill) |", PlayerName2(killerid));
SendClientMessageToAll(COLOR_YELLOW, string2);
SendClientMessage(killerid, COLOR_YELLOW, "{FF0000}has sido encarcelado por 1 minuto | Razon: Matar Con vehiculo {E30000}(Carkill/HeliKill) |");
ResetPlayerWeapons(playerid);
Encarcelar(killerid, 1);
return 1;
}
//**********************[Sistema de Combos/Racha]***************************
GameTextForPlayer(killerid,KSMensajes[random(sizeof(KSMensajes))], 3000, 6);
//**************************************************************************
//sistema de eventos
if(PlayerInfoE[playerid][NoEvento] >= 1)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
PlayerInfoE[playerid][NoEvento] = 0;
if(PlayerInfoE[playerid][Carro] >= 1)
{
DestroyVehicle(PlayerInfoE[playerid][Carro]);
PlayerInfoE[playerid][Carro] = 0;
}
}
//sistema de duelo
if (EnDuelo[playerid] == 1 && EnDuelo[killerid] == 1)
{
for (new i=1; i<= ARENAS; i++)
{
if ((Duelos[i][DesaId] == playerid || Duelos[i][DesaId] == killerid) && (Duelos[i][DesafiadoId] == playerid) || (Duelos[i][DesafiadoId] == killerid))
{
new str[128];
new Float:healthkiller, Float:armourkiller;
GetPlayerHealth(killerid,healthkiller);
GetPlayerArmour(killerid,armourkiller);
if(healthkiller > 90.0 && armourkiller > 90.0)
{
format(str, sizeof(str),"* » FINAL « %s Obtiene >> OWNED << Contra %s en el Duelo |Con %0.0f de Vida y %0.0f de Chaleco|",PlayerName2(killerid),PlayerName2(playerid),healthkiller,armourkiller);
SendClientMessageToAll(azul_claro, str);
format(str,sizeof(str),"» Desafio « has perdido el Duelo contra %s, Suerte en la prуxima...",PlayerName2(killerid));
SendClientMessage(playerid,COLOR_DUELO,str);
format(str,sizeof(str),"» Desafio « has ganado el Duelo contra %s, Felicidades!!",PlayerName2(playerid));
SendClientMessage(killerid,COLOR_DUELO,str);
EnDuelo[playerid] = 0;
EnDuelo[killerid] = 0;
Duelos[i][DesafiadoId] = -1;
Duelos[i][DesaId] = -1;
Duelos[i][ArmasId] = -1;
Duelos[i][Libre] = 0;
PlayerInfo[killerid][dGanados]++;
PlayerInfo[playerid][dPerdidos]++;
SetPlayerVirtualWorld(killerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
else
{
format(str,sizeof(str),"» FINAL « %s ha ganado el Duelo contra %s |Con %0.0f de Vida y %0.0f de Chaleco|",PlayerName2(killerid),PlayerName2(playerid), healthkiller, armourkiller);
SendClientMessageToAll(azul_claro,str);
format(str,sizeof(str),"» Desafio « has perdido el Duelo contra %s, Suerte en la prуxima...",PlayerName2(killerid));
SendClientMessage(playerid,COLOR_DUELO,str);
format(str,sizeof(str),"» Desafio « has ganado el Duelo contra %s, Felicidades!!",PlayerName2(playerid));
SendClientMessage(killerid,COLOR_DUELO,str);
EnDuelo[playerid] = 0;
EnDuelo[killerid] = 0;
Duelos[i][DesafiadoId] = -1;
Duelos[i][DesaId] = -1;
Duelos[i][ArmasId] = -1;
Duelos[i][Libre] = 0;
PlayerInfo[killerid][dGanados]++;
PlayerInfo[playerid][dPerdidos]++;
SetPlayerVirtualWorld(killerid,0);
SetPlayerVirtualWorld(playerid,0);
switch (i)
{
case 1: {SpawnPlayer(killerid);}
case 2: {SpawnPlayer(killerid);}
case 3: {SpawnPlayer(killerid);}
case 4: {SpawnPlayer(killerid);}
case 5: {SpawnPlayer(killerid);}
case 6: {SpawnPlayer(killerid);}
}
for (new j=0; j<= MAX_PLAYERS; j++)
{
if (ViendoDuelo[j] == i)
{
new str2[80];
format(str2,sizeof(str2),"~r~%s ~w~es el ganador del duelo, Felicidades!",PlayerName2(killerid));
GameTextForPlayer(j,str2,5000,0);
ViendoDuelo[j] =-1;
SetPlayerVirtualWorld(j,0);
}
}
return 1;
}
}
}
}
if (EnDuelo[playerid] == 1 && EnDuelo[killerid] == 0)
{
}
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 defined USE_STATS
PlayerInfo[playerid][Deaths]++;
new cName[MAX_PLAYER_NAME];
//zName[MAX_PLAYER_NAME],
//Float:Health,
//Float:Armor;
#endif
//InDuel[playerid] = 0;
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
#if defined USE_STATS
PlayerInfo[killerid][Kills]++;
#endif
if(InDuel[playerid] == 1 && InDuel[killerid] == 1)
{
GameTextForPlayer(playerid,"Perdedor !",3000,3);
GameTextForPlayer(killerid,"Ganador !",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,"Perdedor !",3000,3);
}
}
if(g_IsPlayerDueling[playerid] == 1 && g_IsPlayerDueling[killerid] == 1)
{
GetPlayerHealth(killerid, Health);
GetPlayerArmour(killerid, Armor);
GetPlayerName(playerid, cName, MAX_PLAYER_NAME);
GetPlayerName(killerid, zName, MAX_PLAYER_NAME);
if(Health > 90.0 && Armor > 90.0)
{
format(sString, sizeof(sString),"» Desafio « %s Tiene \"OWNED\" Sobre %s en el duelo y %.2f Vida y %.2f Chaleco!", zName,cName,Health,Armor);
SendClientMessageToAll(COLOR_ORANGE, sString);
g_GotInvitedToDuel[playerid] = 0;g_HasInvitedToDuel[playerid] = 0;g_IsPlayerDueling[playerid] = 0;
g_GotInvitedToDuel[killerid] = 0;g_HasInvitedToDuel[killerid] = 0;g_IsPlayerDueling[killerid] = 0;
g_DuelInProgress = 0;
SetPlayerHealth(killerid, 100);
SetPlayerArmour(killerid, 100);
SpawnPlayer(killerid);
return 1;
}
else
{
format(sString, sizeof(sString),"» Desafio « %s Ha ganado el Duelo contra %s con %.2f Vida y %.2f Chaleco!", zName,cName,Health,Armor);
SendClientMessageToAll(COLOR_ORANGE, sString);
g_GotInvitedToDuel[playerid] = 0;g_HasInvitedToDuel[playerid] = 0;g_IsPlayerDueling[playerid] = 0;
g_GotInvitedToDuel[killerid] = 0;g_HasInvitedToDuel[killerid] = 0;g_IsPlayerDueling[killerid] = 0;
g_DuelInProgress = 0;
SetPlayerHealth(killerid, 100);
SetPlayerArmour(killerid, 100);
SpawnPlayer(killerid);
return 1;
}
}
#if defined ENABLE_SPEC
for(new x=0; x<MAX_PLAYERS; x++)
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][SpecID] == playerid)
AdvanceSpectate(x);
#endif
if(AntiFreeScore==1){
if(IsPlayerConnected(killerid) && IsPlayerConnected(playerid)){
new Float:a,Float:b,Float:c;
GetPlayerPos(playerid,a,b,c);
if(XDeaths[playerid] == 0)
{
LastDeath[playerid] = gettime();
}
XDeaths[playerid]++;
if(XDeaths[playerid] == 5)
{
if((gettime() - LastDeath[playerid]) <= 5)
{
KickearFree(playerid);
}
else
if((gettime() - LastDeath[playerid]) > 5)
{
XDeaths[playerid]=0;
}
}
}
}
if(USERCHUCK[killerid] == 1 && ADMINCHUCK[playerid] == 1)
{
GetPlayerName(killerid, zName, MAX_PLAYER_NAME);
GameTextForPlayer(killerid,"Has Ganado !",3000,3);
format(sString, sizeof(sString),"* [InfoEvento] %s ha ganado en el Evento, /LoroLoco!", zName,cName,Health,Armor);
SendClientMessageToAll(COLOR_ORANGE, sString);
for(new i; i < GetMaxPlayers(); i ++)
{
if(USERCHUCK[i] == 1)
{
SpawnPlayer(i);
Adentro[i] = 0;
ADMINCHUCK[i] = 0;
USERCHUCK[i] = 0;
}
}
}
//MTAS TE DISE ASD
new mereexita[256];
new asd[24];
kills[killerid]++;
if(kills[killerid]==Multikills) {
GetPlayerName(killerid,asd,24);
format(mereexita,256,"« %s « Tiene una Racha de \"4\" \"ASESINATOS\" Seguidos, Sin MORIR |$300|",asd);//3
SendClientMessageToAll(0xFF2400FF,mereexita);
GivePlayerCash(killerid,300);
}
if(kills[killerid]==Ultrakills) {
GetPlayerName(killerid,asd,24);
format(mereexita,256,"« %s « Tiene una Racha de \"6\" \"ASESINATOS\" Seguidos, e_e!! |$500|",asd);//5
SendClientMessageToAll(0xFF2400FF,mereexita);
GivePlayerCash(killerid,500);
}
if(kills[killerid]==Arrasador) {
GetPlayerName(killerid,asd,24);
format(mereexita,256,"« %s « Tiene una Racha de \"12\" \"ASESINATOS\" Seguidos, Pro Detect! |$800|",asd);//10
SendClientMessageToAll(0xFF2400FF,mereexita);
GivePlayerCash(killerid,800);
}
if(kills[killerid]==Jason) {
GetPlayerName(killerid,asd,24);
format(mereexita,256,"« %s « Tiene una Racha de \"16\" \"ASESINATOS\" Seguidos, seguro tiene cheat XD! |$1000|",asd);//15
SendClientMessageToAll(0xFF2400FF,mereexita);
GivePlayerCash(killerid,1000);
}
if(kills[killerid]==Kratos) {
GetPlayerName(killerid,asd,24);
format(mereexita,256,"« %s « Tiene una Racha de \"20\" \"ASESINATOS\" Seguidos, Estб violando a Todos! |$1500|",asd);
SendClientMessageToAll(0xFF2400FF,mereexita);
GivePlayerCash(killerid,1500);
}
return 1;
}