if(Player[playerid][PlayerGang] != -1 && !IsPlayerNPC(playerid))
{
new zone = Gang[Player[playerid][PlayerGang]][CurrentZone];
if(GangZone[zone][ZoneStatus] == true && GangZone[zone][ZoneOwner] == Player[playerid][PlayerGang])
{
new msg1[128];
format(msg1, sizeof(msg1), "{FF0000}** %s gang failed to capture %s zone, REASON: Oppenent Gang reached to rescue!", Gang[Player[playerid][PlayerGang]][GangName], GangZone[zone][ZoneName]);
SendClientMessageToAll(-1, msg1);
Gang[Player[playerid][PlayerGang]][CurrentZone] = -1;
GangZone[zone][ZoneLocked] = GetTickCount();
GangZone[zone][ZoneStatus] = false;
GangZoneStopFlashForAll(GangZone[zone][ZoneHolder]);
}
}
[debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at negative index -1
[debug] AMX backtrace:
[debug] #0 00055d98 in public S@@_OnPlayerEnterArea (playerid=1, areaid=27) at C:\Users\iLearner\Desktop\ffss\pawno\include\FFS/FFS_gangs.inc:1250
[debug] #1 0000cb00 in Area_AddCuboid (... <2 variable arguments>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_hooks/impl.inc:2502
[debug] #2 native CallRemoteFunction () [00471b40] from samp-server.exe
[debug] #3 00024c9c in Area_DoEnter (playerid=1, areaid=27, &idx=@0x020f41d0) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_areas.inc:2770
[debug] #4 00020c6c in bool:Area_AddCuboid (... <1 variable argument>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_areas.inc:2110
[debug] #5 0000b954 in Area_AddCuboid (... <1 variable argument>) at C:\Users\iLearner\Desktop\ffss\pawno\include\YSI\y_hooks/impl.inc:1997
if(GangZone[zone][ZoneStatus] == true && GangZone[zone][ZoneOwner] == Player[playerid][PlayerGang])
if(zone != -1 && GangZone[zone][ZoneStatus] == true && GangZone[zone][ZoneOwner] == Player[playerid][PlayerGang])
if (dialogid == DIALOG_DUEL)
{
if (!response) return 0;
switch(listitem)
{
case 0: //new duel
{
if (duelslotid[playerid] != -1) return SendClientMessage(playerid, ERRORCOLOR, "You have already sent someone a duel invite.");
for (new i = 0; i < MAX_DUELS; i++)
{
if (duel[i][duelstate] == 0) { duelslotid[playerid] = i; break; }
}
if (duelslotid[playerid] == -1) return SendClientMessage(playerid, ERRORCOLOR, "There are no duel slots available.");
duel[duelslotid[playerid]][duelstate] = 1;
duel[duelslotid[playerid]][players][0] = playerid;
duel[duelslotid[playerid]][players][1] = INVALID_PLAYER_ID;
duel[duelslotid[playerid]][arena] = 0;
duel[duelslotid[playerid]][rounds] = 0;
for (new i = 0; i < 13; i++) duel[duelslotid[playerid]][weapons][i] = 0;
duel[duelslotid[playerid]][dkills][0] = 0;
duel[duelslotid[playerid]][dkills][1] = 0;
ShowPlayerDialog(playerid, DIALOG_DUELINV, DIALOG_STYLE_LIST, "Invite a player to a duel", Duel_InviteString(duelslotid[playerid]), "OK", "BACK");
}
case 1: //watch
{
//if (!AdminCheck(playerid, 5)) return SendClientMessage(playerid, ERRORCOLOR, "This feature has not been added yet.");
new count;
for (new i = 0; i < MAX_DUELS; i++)
{
if (duel[i][duelstate] >= 3)
{
format(query, sizeof(query), "%s\n%d - %s VS %s", query, i, Name[duel[i][players][0]], Name[duel[i][players][1]]);
count++;
}
}
if (count == 0) format(query, sizeof(query), "There are no duels running.");
ShowPlayerDialog(playerid, DIALOG_DUEL_WATCH, DIALOG_STYLE_LIST, "Watch a duel", query, "OK", "BACK");
}
case 2: //check invites
{
ShowPlayerDialog(playerid, DIALOG_DUEL_INVITES, DIALOG_STYLE_LIST, "Duel Invites", Duel_MyInvitesString(playerid), "CONFIRM", "BACK");
}
case 3: //cancel invite
{
if (duelslotid[playerid] == -1) return SendClientMessage(playerid, ERRORCOLOR, "You haven't sent anyone a duel invite.");
if (duel[duelslotid[playerid]][duelstate] > 2) return SendClientMessage(playerid, ERRORCOLOR, "You haven't sent anyone a duel invite.");
format(query, sizeof(query), "%s has canceled their duel invite to you.", playerData[playerid][PName]);
SendClientMessage(duel[duelslotid[playerid]][players][1], 0xFFFF00FF, query);
format(query, sizeof(query), "You have canceled your duel invite to %s.", Name[duel[duelslotid[playerid]][players][1]]);
SendClientMessage(playerid, 0xFFFF00FF, query);
duel[duelslotid[playerid]][duelstate] = 0;
duel[duelslotid[playerid]][players][0] = INVALID_PLAYER_ID;
duel[duelslotid[playerid]][players][1] = INVALID_PLAYER_ID;
duel[duelslotid[playerid]][arena] = 0;
duel[duelslotid[playerid]][rounds] = 0;
for (new i = 0; i < 13; i++) duel[duelslotid[playerid]][weapons][i] = 0;
duel[duelslotid[playerid]][dkills][0] = 0;
duel[duelslotid[playerid]][dkills][1] = 0;
duelslotid[playerid] = -1;
}
}
}
[00:19:31] [debug] Run time error 4: "Array index out of bounds"
[00:19:31] [debug] Accessing element at index 65535 past array upper bound 999
[00:19:31] [debug] AMX backtrace:
[00:19:31] [debug] #0 000dde5c in public S@@_OnDialogResponse (playerid=18, dialogid=63, response=1, listitem=3, inputtext[]=@01fdb55c "hi4") at ffs.pwn:2664
[00:19:31] [debug] #1 000702f0 in public cmd_duel (playerid=18, params[]=@020e7fac "cancel") at C:\Users\iLearner\Desktop\ffss\pawno\include\FFS/FFS_Commands.inc:1541
[00:19:31] [debug] #2 native CallLocalFunction () from samp03svr
[00:19:31] [debug] #3 0002bdec in public OnPlayerCommandText (playerid=18, cmdtext[]=@020e7f78 "/duel cancel") at C:\Users\iLearner\Desktop\ffss\pawno\include\izcmd.inc:106
This is such a common error that if you are coming to forum to ask for help this tells me you are too lazy to figure it out or you didn't write the script and don't know what you are doing.
|