debug backtrace
#1

Error Code
Код:
Код:
[17:37:56] [debug]  Accessing element at index 388758399 past array upper bound 100
[17:37:56] [debug] AMX backtrace:
[17:37:56] [debug] #0 000c53a0 in public BonusPlayer () from cnr.amx
public BonusPlayer(playerid)
{
if(playerData[playerid][playerHasBonus] == INVALID_PLAYER_ID || !IsPlayerConnected(playerData[playerid][playerHasBonus]))
{
new onlineids[MAX_PLAYERS]; // to store all online playerids
new playersonline; // to store the amount of current online players
for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
{
if(IsPlayerConnected(i)) // check to see if current id in the loop is connected
{
onlineids[playersonline] = i; // store the current id into the onlineids variable
playersonline++; // increase the playersonline by 1
}
else
{
//print("id is not connected.");
//SetTimer("BonusPlayer", 60*1000, 0);
}
}
playerData[playerid][playerBonusMoney] = random(50000 - 1000) + 1000;
//GivePlayerMoney(playerid,randmoney);
playerData[playerid][playerHasBonus] = onlineids[random(playersonline)];
new str[200], str1[200];
format(str1, sizeof(str1),"~p~~h~%s(%d) ~w~has been selected as ~g~Bonus Player. ~w~~n~kill him to get ~g~~g~$%d", playerData[playerid][playerNamee], playerData[playerid][playerHasBonus], playerData[playerid][playerBonusMoney]);
format(str, sizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}has been selected as bonus player. kill him to get {73FF00}$%d", playerData[playerid][playerNamee], playerData[playerid][playerHasBonus], playerData[playerid][playerBonusMoney]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
NotifyPlayer2(i, str1, 5000);
}
SendClientMessageToAll(-1, str);
}
else
{
new str[200], str1[200];
format(str1, sizeof(str1),"~p~~h~%s(%d) ~w~has ~r~not~w~ been ~r~killed~w~ yet.", playerData[playerid][playerNamee], playerData[playerid][playerHasBonus]);
format(str, sizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}has not been killed yet.", playerData[playerid][playerNamee], playerData[playerid][playerHasBonus]);
for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
{
NotifyPlayer2(i, str1, 5000);
}
SendClientMessageToAll(-1, str);
}
}
Reply
#2

Compile with a -d3 parameter so you can find the line and double check your loops.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)