02.08.2013, 14:57
Hi, it's my first thread at this forum, so - regards.
Now I'm turn to my issue: I've some backtraces in console (I'm check that with crashdetect):
Line 1907 is:
function, which update HAY:
Now I'm turn to my issue: I've some backtraces in console (I'm check that with crashdetect):
Код:
[05:40:14] wyzuc 1 [05:40:14] wyzuc 2 0 0 [05:40:14] wyzuc 2 0 0 [05:40:14] [debug] Run time error 4: "Array index out of bounds" [05:40:14] [debug] Accessing element at index 53 past array upper bound 52 [05:40:14] [debug] AMX backtrace: [05:40:14] [debug] #0 0007a988 in public script_hy_update () at ./current/libs/event/events/main.inc:1907 [05:40:15] początek [05:40:15] po spawn
Код:
new Float:position_[6]; foreach (new ply : h_y_players) //1907
Код:
forward script_hy_update( );
public script_hy_update( )
{
if( script_hy[ statees ] != true ) return 1;
if( Iter_Count( h_y_players) == 0 )
{
script_destory_hy_v();
KillTimer( script_hy[ Timer ] );
Iter_Clear( h_y_players);
script_hy[ statees ] = false;
sendClientMessageToAll( COLOR_ERROR, "Hay zostało zakończone z powodu braku graczy." );
return 1;
}
event_saved();
if( Iter_Count( h_y_players) == 1 ) //tutaaj jesli jest jeden
{
KillTimer( script_hy[ Timer ] );
new p = Iter_First(h_y_players);
if( IsPlayerConnected( p ) )
{
printf("początek");
Iter_Remove( h_y_players, p );
SetPlayerVirtualWorld( p, 0 );
TogglePlayerControllable( p, 1 );
SetPlayerHealth( p, 100.0 );
ResetPlayerWeapons( p );
SpawnPlayer( p );
printf("po spawn");
new kasy = random( 10000 ), score = random(100);
format( ee_stri, sizeof( ee_stri ), "Gracz %s (%d) po raz %d wygrał {b}/HY{/b}. I otrzymuje {b}%d Score i %d${/b} ", playerNick( p ), p, addPointEvent( p, stats_hy ), score, kasy );
sendClientMessageToAll( COLOR_ORANGE, ee_stri );
//break;
}
script_destory_hy_v();
Iter_Clear( h_y_players);
script_hy[ statees ] = false;
return 1;
}
if( script_hy[ winreed ] != INVALID_PLAYER_ID )
{
KillTimer( script_hy[ Timer ] );
GivePlayerMoney( script_hy[ winreed ], 10000 );
new kasy = random( 10000 ), score = random(100);
format( ee_stri, sizeof( ee_stri ), "Gracz %s (%d) po raz %d wygrał {b}/HY{/b}. I otrzymuje {b}%d Score i %d${/b} ", playerNick( script_hy[ winreed ] ), script_hy[ winreed ], addPointEvent( script_hy[ winreed ], stats_hy ), score, kasy );
sendClientMessageToAll( COLOR_ORANGE, ee_stri );
script_destory_hy_v();
script_hy[ statees ] = false;
Iter_Clear( h_y_players);
return 1;
}
if( Iter_Count( h_y_players) > 1 ){
new Float:position_[6];
foreach (new ply : h_y_players)
{
GetPlayerPos( ply, position_[ 0 ], position_[ 1 ], position_[ 2 ] );
if( position_[ 2 ] < 110.0 ){
if( Iter_Contains( h_y_players, ply ) ){
Iter_Remove( h_y_players, ply );
printf("wyzuc 1");
}
SpawnPlayer( ply );
printf("wyzuc 2 0 0");
continue;
}
if( IsPlayerInAnyVehicle(ply) )
{
if( Iter_Contains( h_y_players, ply ) ) {
Iter_Remove( h_y_players, ply );
printf("wyzuc 11");
}
SpawnPlayer( ply );
printf("wyzuc 22");
}
}
}
event_saved();
return 1;
}

