debugs
#1

Код:
[14:20:03] [kill] Alao killed DaniHD Sniper Rifle
[14:20:07] [debug] Run time error 4: "Array index out of bounds"
[14:20:07] [debug]  Attempted to read/write array element at negative index -1
[14:20:07] [debug] AMX backtrace:
[14:20:07] [debug] #0 0008bd7c in public OnPlayerSpawn (playerid=10) at E:\Samp-Files\aGamemodes\BB\gamemodes\BBTDM1-2.pwn:7967
Код:
    g_GotInvitedToDuel[playerid] = 0;
    g_HasInvitedToDuel[playerid] = 0;
    g_IsPlayerDueling[playerid]  = 0;
    if(g_DuelingID1 != INVALID_PLAYER_ID)
    {
       g_GotInvitedToDuel[g_DuelingID1] = 0; //7967 line
       g_HasInvitedToDuel[g_DuelingID1] = 0;
       g_IsPlayerDueling[g_DuelingID1]  = 0;
	}
    g_DuelInProgress = 0;
   	g_DuelingID1 = -1;
	g_DuelingID2 = -1;
does anybody have any idea whats wrong ?
Reply
#2

how you define
g_DuelingID1
Reply
#3

Код:
stock
	g_GotInvitedToDuel[MAX_PLAYERS],
	g_HasInvitedToDuel[MAX_PLAYERS],
	g_IsPlayerDueling[MAX_PLAYERS],
	g_DuelCountDown[MAX_PLAYERS],
	g_Weapon,
	g_DuelTimer[MAX_PLAYERS],
	g_DuelInProgress,
	g_DuelingID1,
	g_DuelingID2;
Reply
#4

do it
Код:
new g_DuelingID1 = 1;
if i'd be you , i would be using Enums for these.
Reply
#5

You reset to -1 but check if it is not equal to INVALID_PLAYER_ID. Change the check to:
pawn Код:
if(g_DuelingID1 != -1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)