gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
public OnPlayerDeath(playerid, killerid, reason)
{
DeathCamera(playerid);
Informacion[playerid][Deaths]++;
GameTextForPlayer(killerid,KSMensajes[random(sizeof(KSMensajes))], 3000, 6);
SendDeathMessage(killerid, playerid, reason);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
GivePlayerMoney(killerid,1000);
if(EnZona[playerid] == 0)
{
OnWeaponDrop(playerid);
}
if(EnZona[killerid] == 0)
{
new ArmaCheck = GetPlayerWeapon(killerid);
if(ArmaCheck == 35 || ArmaCheck == 36 || ArmaCheck == 37 || ArmaCheck == 38 || ArmaCheck == 39)
{
new string[300],wea[500];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(killerid, PlayerName, MAX_PLAYER_NAME);
new year,month,day; getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
format(string,sizeof(string),"* Admin NPC kickeo a %s (Armas prohibidas)", PlayerName);
SendClientMessageToAll(naranja,string);
print(string);
format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\
\n\n{FFFFFF}Admin: NPC\
\n{FFFFFF}Razon: Armas prohibidas.\
\n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\
\n\n{FFFFFF}* Intenta no ser un novato y vuelve sin cheats.",PlayerName,day,month,year, hour, minute, second);
ShowPlayerDialog(killerid, 8000, DIALOG_STYLE_MSGBOX, " * ", wea, "OK", "");
for(new p = 0; p < MAX_PLAYERS; p++) {
if(IsPlayerConnected(p)) {
PlayerPlaySound(p,1140,0.0,0.0,0.0);}}
Kick(killerid);
}
}
//Duelo
new
sString[428],
pNamexd[MAX_PLAYER_NAME],
zName[MAX_PLAYER_NAME],
Float:Health,
Float:Armor;
if(g_IsPlayerDueling[playerid] == 1 && g_IsPlayerDueling[killerid] == 1)
{
GetPlayerHealth(killerid, Health);
GetPlayerArmour(killerid, Armor);
SetPlayerVirtualWorld(killerid, 0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(killerid, 0);
//SpawnPlayer(playerid);
SpawnPlayer(killerid);
GetPlayerName(playerid, pNamexd, MAX_PLAYER_NAME);
GetPlayerName(killerid, zName, MAX_PLAYER_NAME);
if(Health > 90.0 && Armor > 90.0)
{
format(sString, sizeof(sString),"{770CC9}* %s a ganado el duelo contra %s! y termino la batalla con %.2f de vida , y %.2f de blindaje!", zName,pNamexd,Health,Armor);
SendClientMessageToAll(0xFF8040FF, 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;
EnZona[playerid] = 0;
EnZona[killerid] = 0;
return 1;
}
else
{
format(sString, sizeof(sString),"{770CC9}* %s a ganado el duelo contra %s! y termino la batalla con %.2f de vida , y %.2f de blindaje!", zName,pNamexd,Health,Armor);
SendClientMessageToAll(0xFF8040FF, 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;
EnZona[playerid] = 0;
EnZona[killerid] = 0;
return 1;
}
}
new Float:XD, Float:YD, Float:ZD;
GetPlayerPos(killerid, XD, YD, ZD);
if(IsPlayerInVehicle(killerid,GetPlayerVehicleID(killerid)))
{
if(reason == 49)//carkill
{
SetPlayerPos(killerid, XD, YD, ZD+50); GivePlayerWeapon(killerid, 46, 1);
GameTextForPlayer(killerid, "~r~NO HAGAS CAR-KILL!", 4000, 4);
}
if(reason == 50)//helikill
{
SetPlayerPos(killerid, XD, YD, ZD+50); GivePlayerWeapon(killerid, 46, 1);
GameTextForPlayer(killerid, "~r~NO HAGAS HELI-KILL!", 4000, 4);
}
if(Informacion[killerid][GodCar] == 1)
{
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER && (reason == WEAPON_TEC9 || reason == WEAPON_UZI || reason == WEAPON_MP5) && GetDistanceBetweenPlayers(playerid,killerid) < 100)
{
SetPlayerPos(killerid, XD, YD, ZD+50); GivePlayerWeapon(killerid, 46, 1);
GameTextForPlayer(killerid, "~g~~h~No hagas drive by!~n~~b~~h~autofix apagado!", 4000, 4);
Informacion[killerid][GodCar] = 0;
}
}
}
if(Joined[playerid] == true)
{
JoinCount--;
Joined[playerid] = false;
DestroyVehicle(CreatedRaceVeh[playerid]);
DisablePlayerRaceCheckpoint(playerid);
CPProgess[playerid] = 0;
KillTimer(InfoTimer[playerid]);
}
if(BuildRace[playerid] == 1)
{
BuildRace[playerid] = 0;
}
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
Informacion[killerid][Killsxd]++;
}
for(new x=0; x<MAX_PLAYERS; x++)
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && Informacion[x][SpecID] == playerid)
AdvanceSpectate(x);
return 1;
}
if(killerid!=INVALID_PLAYER_ID)
{
//Code containing killerid
}else{
//player died of other causes
}
if(EnZona[killerid] == 0)
{ new ArmaCheck = GetPlayerWeapon(killerid); if(ArmaCheck == 35 || ArmaCheck == 36 || ArmaCheck == 37 || ArmaCheck == 38 || ArmaCheck == 39) { new string[300],wea[500]; new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(killerid, PlayerName, MAX_PLAYER_NAME); new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second); format(string,sizeof(string),"* Admin NPC kickeo a %s (Armas prohibidas)", PlayerName); SendClientMessageToAll(naranja,string); print(string); format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\ \n\n{FFFFFF}Admin: NPC\ \n{FFFFFF}Razon: Armas prohibidas.\ \n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\ \n\n{FFFFFF}* Intenta no ser un novato y vuelve sin cheats.",PlayerName,day,month,year, hour, minute, second); ShowPlayerDialog(killerid, 8000, DIALOG_STYLE_MSGBOX, " * ", wea, "OK", ""); for(new p = 0; p < MAX_PLAYERS; p++) { if(IsPlayerConnected(p)) { PlayerPlaySound(p,1140,0.0,0.0,0.0); } Kick(killerid); } } |
if(EnZona[killerid] == 0)
{
new ArmaCheck = GetPlayerWeapon(killerid);
if(ArmaCheck == 35 || ArmaCheck == 36 || ArmaCheck == 37 || ArmaCheck == 38 || ArmaCheck == 39)
{
new string[300],wea[500];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(killerid, PlayerName, MAX_PLAYER_NAME);
new year,month,day; getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
format(string,sizeof(string),"* Admin NPC kickeo a %s (Armas prohibidas)", PlayerName);
SendClientMessageToAll(naranja,string);
print(string);
format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\
\n\n{FFFFFF}Admin: NPC\
\n{FFFFFF}Razon: Armas prohibidas.\
\n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\
\n\n{FFFFFF}* Intenta no ser un novato y vuelve sin cheats.",PlayerName,day,month,year, hour, minute, second);
ShowPlayerDialog(killerid, 8000, DIALOG_STYLE_MSGBOX, " * ", wea, "OK", "");
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(IsPlayerConnected(p))
{
PlayerPlaySound(p,1140,0.0,0.0,0.0);
Kick(killerid);
}
}
}
}
Plugin succesfully loaded (version 3.1.3) gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". gamemodes\FTS.amx: During execution of OnPlayerDeath: gamemodes\FTS.amx: Run time error 4: "Array index out of bounds". Plugin succesfully loaded (version 3.1.3)
for(new p = 0; p < MAX_PLAYERS; p++)
{
if(IsPlayerConnected(p))
{
PlayerPlaySound(p,1140,0.0,0.0,0.0);
Kick(killerid);
}
}
The problem is with:
pawn Код:
|
for(new p = -1; p < MAX_PLAYERS; p++)
{
if(IsPlayerConnected(p))
{
PlayerPlaySound(p,1140,0.0,0.0,0.0);
Kick(killerid);
}
}