21.05.2014, 19:14
Bueno aun no encuentro la soluciуn ha este problemas indicado en la consola, espero me echen una mano
problemas indicados en la consola por crashdetect
Public OnPlayerTakeDamage
problemas indicados en la consola por crashdetect
Код:
[14:08:52] [debug] Run time error 4: "Array index out of bounds" [14:08:52] [debug] Accessing element at index 65535 past array upper bound 49 [14:08:52] [debug] AMX backtrace: [14:08:52] [debug] #0 00077f74 in public OnPlayerTakeDamage (0x00000000, 0x0000ffff, 0x3fdd2efa, 0x00000036, 0x00000003) from Sv.amx
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
//Chaleco y Vida en la cabeza
new Float:Vida;
GetPlayerHealth(playerid, Vida);
if(Vida < VidaB[playerid])
{
SetPlayerAttachedObject(playerid, 5, 1240, 1, 0.797953, 0.070644, 0.001249, 0.521487, 89.103843, 0.000000, 1.000000, 1.000000, 1.000000);//Corazon ID
SetTimerEx("TimeVidayArmadura",2000,0,"d",playerid);
}
new Float:Chaleco;
GetPlayerArmour(playerid, Chaleco);
if(Chaleco < ChalecoB[playerid])
{
SetPlayerAttachedObject(playerid, 5, 1242, 1, 0.797953, 0.070644, 0.001249, 0.521487, 89.103843, 0.000000, 1.000000, 1.000000, 1.000000); //Chaleco ID
SetTimerEx("TimeVidayArmadura",2000,0,"d",playerid);
}
VidaB[playerid] = Vida;
ChalecoB[playerid] = Chaleco;
//Daсos colatarales textdraw imagen impacto sound y dmg con ciertas armas
TextDrawShowForPlayer(playerid, DamageTextRojo);
SetTimerEx("TimeDamageText", 100, false, "i", playerid);
//Sounds
if(IsPlayerConnected(issuerid)) PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
if(IsPlayerConnected(playerid)) PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0.0); //5205
//HeadShoot
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)//Head Shoot [4 = Sniper] [9 = en la cabeza = head shoot]
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, 0xFF0000AA, "Has recibido un disparo de Sniper {0000FF}Head Shoot");//Texto para el que muere
TextDrawShowForPlayer(issuerid, KillHeadShoot);//Textdraw del Shoot
GivePlayerMoney(issuerid, 5000);
SetTimerEx("headshootime", 4000, false, "i", issuerid);//Textdraw time Head Shoot!
}
//Daсo Desert
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 9)//desert
{
new Float:VidaD;
SetPlayerHealth(playerid, VidaD-70);
SendClientMessage(playerid, 0x00FF00C8, "Impacto Desert{FF0000} -70 de vida");
}
//
#if defined SHOWN_ON_SCOREBOARD
totalDmg[issuerid] += amount;
SetPlayerScore(issuerid, floatround(totalDmg[issuerid]));
#endif
currentHpLoss[0][issuerid][playerid] += amount;
currentHpLoss[1][playerid][issuerid] += amount;
new
nick[MAX_PLAYER_NAME],
buffer[128];
GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
format(buffer, 128, "%s~n~-%i (%s)~n~Damage", nick, floatround(currentHpLoss[0][issuerid][playerid]), weaponName[weaponid]);
TextDrawSetString(txd[0][issuerid], buffer);
GetPlayerName(issuerid, nick, MAX_PLAYER_NAME);
format(buffer, 128, "%s~n~-%i (%s)~n~Damage", nick, floatround(currentHpLoss[1][playerid][issuerid]), weaponName[weaponid]);
TextDrawSetString(txd[1][playerid], buffer);
txdAlpha[0][issuerid] = 0xFF;
txdAlpha[1][playerid] = 0xFF;
return 1;
}

