I have a Problem.
#1

SERVER_LOG.txt:
Quote:

[14:05:53] [debug] Run time error 4: "Array index out of bounds"
[14:05:53] [debug] Accessing element at index 28 past array upper bound 27
[14:05:53] [debug] AMX backtrace:
[14:05:53] [debug] #0 00058c6c in public Streamer_OnPlayerEnterRaceCP (playerid=4) at C:\Users\crysty\Desktop\eXtreme Stunt Romania b29\gamemodes\XSR.pwn:7195
[14:05:53] [debug] #1 000092bc in public OnPlayerEnterRaceCheckpoint (playerid=4) at C:\Users\crysty\Desktop\EXTREM~1\Pawno\include\str eamer.inc:423

Line 7195 in GameMode:

Quote:

if ( PlayerInfo[ playerid ][ InJob ] == 2 )
{
new JobsReward = ( 1 + ( random( 5 - 1 ) ) ), JobsReward2 = ( 1 + ( random( 5000 - 1 ) ) );
switch( CheckpoinID[ playerid ] )
{
case 0 .. 25:
{
CheckpoinID[ playerid ]++;
SetPlayerRaceCheckpoint( playerid, 0, DriveJob[ CheckpoinID[ playerid ] ][ 0 ], DriveJob[ CheckpoinID[ playerid ] ][ 1 ], DriveJob[ CheckpoinID[ playerid ] ][ 2 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 0 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 1 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 2 ], 5 );

ShowJobTextDraws( playerid, CheckpoinID[ playerid ], JobsReward, JobsReward2, 27 );
}
case 26:
{
CheckpoinID[ playerid ]++;
SetPlayerRaceCheckpoint( playerid, 1, DriveJob[ CheckpoinID[ playerid ] ][ 0 ], DriveJob[ CheckpoinID[ playerid ] ][ 1 ], DriveJob[ CheckpoinID[ playerid ] ][ 2 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 0 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 1 ], DriveJob[ CheckpoinID[ playerid ]+1 ][ 2 ], 5 );

ShowJobTextDraws( playerid, CheckpoinID[ playerid ], JobsReward, JobsReward2, 27 );
}
case 27:
{
format( gsString, sizeof( gsString ), "JOB INFO: {33AA33}%s {FF0000}finished the {33AA33}Infernus-Job!", PlayerName( playerid ) );
SendClientMessageToAll( COLOR_ULTRARED, gsString );

CheckpoinID[ playerid ] = 0;

ShowJobTextDraws( playerid, CheckpoinID[ playerid ], JobsReward, JobsReward2, 27 );

PlayerInfo[ playerid ][ InJob ] = 0;
PlayerInfo[ playerid ][ ActionID ] = 0;
DisablePlayerRaceCheckpoint( playerid );
}
}
}

Reply
#2

I think this is the area that you can post this thread :P
Try Rescripting
Advice:Make backup before editing
Reply
#3

Which one is line 7195?

I assume DriveJob array has size of 28 and CheckpoinID[ playerid ] is 27 (the last checkpoint) when you add + 1 so it goes 28 which is an invalid index.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)