21.08.2016, 07:32
(
Последний раз редактировалось Nin9r; 21.08.2016 в 10:35.
)
Quote:
I'm not aware of the cause of your problem but for the run time error 4, you'll need to post line 24084 from gmi.pwn file and few lines before and after that line. Seeing the upper bound to be 999, it is most likely a player-array (MAX_PLAYERS is defined as 1000) and you probably use a loop with "... <= MAX_PLAYERS". I can't be sure though unless you post the code.
|
Код HTML:
if(killerid != 255) { if(GetPlayerState(killerid) == 2) { SendClientMessage(killerid, COLOR_YELLOW, "DriveBy Kill!"); return 1; } } if(PlayerData[playerid][pGroup] == 7 || PlayerData[playerid][pGroup] == 10 || PlayerData[killerid][pGroup] == 7 || PlayerData[killerid][pGroup] == 10) { foreach(Player, x) { if(PlayerData[x][pGroup] == 7 || PlayerData[x][pGroup] == 10) { SendDeathMessageToPlayer(x, killerid, playerid, reason); } } if(PlayerData[killerid][pRKills] < 30) { PlayerData[killerid][pRKills] += 1; } PlayerData[playerid][pMoney] -= 500; PlayerData[killerid][pMoney] += 500; }
Код HTML:
if(PlayerData[playerid][pGroup] == 7 || PlayerData[playerid][pGroup] == 10 || PlayerData[killerid][pGroup] == 7 || PlayerData[killerid][pGroup] == 10)
Код HTML:
[09:56:40] [debug] Run time error 4: "Array index out of bounds" [09:56:40] [debug] Accessing element at index 43 past array upper bound 42 [09:56:40] [debug] AMX backtrace: [09:56:40] [debug] #0 000f1104 in public IsPlayerInTurf (playerid=52, turfid=43) at D:\server\4iulie\gmi.pwn:18125 [09:56:40] [debug] #1 0014a448 in public AB_OnPlayerDeath (playerid=52, killerid=29, reason=29) at D:\server\gmi.pwn:24476 [09:56:40] [debug] #2 0001fbf0 in public OnPlayerDeath (playerid=52, killerid=29, reason=29) at D:\server\pawno\include\OPA.inc:71
Код HTML:
for(new i = 0; i <= sizeof(TurfInfo); i++)
{
if(IsPlayerInTurf(playerid, i))
{
new string[144];
if(WarInfo[i][wTime] > 0)
{if(i == i)
{
Код HTML:
if(IsPlayerInTurf(playerid, i))
Код HTML:
public IsPlayerInTurf(playerid, turfid)
{
if(turfid == -1)
{
return 0;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
{
return 1;
}
return 0;
}
Код HTML:
if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
Код HTML:
new TurfInfo[43][zInfo];