public FalloutDropObjects( ){if( GetGVarInt( \"FalloutStarted\" ) == 1 ){ if( AllFalloutObjectsDropped( ) ) { foreach(Player, i) { if( GetPVarInt( i, \"Minigame\" ) == 2 ) { SetPVarInt( i, \"Minigame\", 0 ); SpawnPlayer( i ); TogglePlayerControllable( i, 1 ); } } SetGVarInt( \"FalloutPlayers\", 0 ); SetGVarInt( \"FalloutActive\", 0 ); SetGVarInt( \"FalloutStarted\", 0 ); for( new iObjects; iObjects < sizeof( iFalloutObjects ); iObjects++ ) { FalloutObjectsDropped[ iObjects ] = false; } for( new iPos; iPos < 13; iPos++ ) { FalloutPositionUsed[ iPos ] = false; } FalloutMapUnload( ); FalloutMapLoad( ); SendClientMessageToAll( COLOR_RED, \"Fallout: A Fallout minijátékot senki nem nyerte meg, döntetlen az eredmény.\" ); return 1; } RandomGotoDrop: { new iRandObj = random( 36 ); if( FalloutObjectsDropped[ iRandObj ] == true ) { goto RandomGotoDrop; } new Float: fObjectPos[ 3 ]; GetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] ); SetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] - 170 ); FalloutObjectsDropped[ iRandObj ] = true; } } return 1;}
[19:48:15] [debug] Run time error 4: \"Array index out of bounds\"[19:48:15] [debug] Accessing element at index 36 past array upper bound 35[19:48:15] [debug] AMX backtrace:[19:48:15] [debug] #0 00055368 in ?? () from gm.amx[19:48:15] [debug] #1 0002dbec in public FalloutDropObjects () from gm.amx
public FalloutDropObjects( ){ if( GetGVarInt( \"FalloutStarted\" ) == 1 ) { if( AllFalloutObjectsDropped( ) ) { foreach(Player, i) { if( GetPVarInt( i, \"Minigame\" ) == 2 ) { SetPVarInt( i, \"Minigame\", 0 ); SpawnPlayer( i ); TogglePlayerControllable( i, 1 ); } } SetGVarInt( \"FalloutPlayers\", 0 ); SetGVarInt( \"FalloutActive\", 0 ); SetGVarInt( \"FalloutStarted\", 0 ); for( new iObjects; iObjects < sizeof( iFalloutObjects ); iObjects++ ) { FalloutObjectsDropped[ iObjects ] = false; } for( new iPos; iPos < 13; iPos++ ) { FalloutPositionUsed[ iPos ] = false; } FalloutMapUnload( ); FalloutMapLoad( ); SendClientMessageToAll( COLOR_RED, \"Fallout: A Fallout minijátékot senki nem nyerte meg, döntetlen az eredmény.\" ); } RandomGotoDrop: { new iRandObj = random( 35 ); if( FalloutObjectsDropped[ iRandObj ] == true ) { goto RandomGotoDrop; } new Float: fObjectPos[ 3 ]; GetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] ); SetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] - 170 ); FalloutObjectsDropped[ iRandObj ] = true; } } return 1;}
FalloutObjectsDropped
Esetleg így?public FalloutDropObjects( ){ if( GetGVarInt( \"FalloutStarted\" ) == 1 ) { if( AllFalloutObjectsDropped( ) ) { foreach(Player, i) { if( GetPVarInt( i, \"Minigame\" ) == 2 ) { SetPVarInt( i, \"Minigame\", 0 ); SpawnPlayer( i ); TogglePlayerControllable( i, 1 ); } } SetGVarInt( \"FalloutPlayers\", 0 ); SetGVarInt( \"FalloutActive\", 0 ); SetGVarInt( \"FalloutStarted\", 0 ); for( new iObjects; iObjects < sizeof( iFalloutObjects ); iObjects++ ) { FalloutObjectsDropped[ iObjects ] = false; } for( new iPos; iPos < 13; iPos++ ) { FalloutPositionUsed[ iPos ] = false; } FalloutMapUnload( ); FalloutMapLoad( ); SendClientMessageToAll( COLOR_RED, \"Fallout: A Fallout minijátékot senki nem nyerte meg, döntetlen az eredmény.\" ); } RandomGotoDrop: { new iRandObj = random( 35 ); if( FalloutObjectsDropped[ iRandObj ] == true ) { goto RandomGotoDrop; } new Float: fObjectPos[ 3 ]; GetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] ); SetObjectPos( iFalloutObjects[ iRandObj ], fObjectPos[ 0 ], fObjectPos[ 1 ], fObjectPos[ 2 ] - 170 ); FalloutObjectsDropped[ iRandObj ] = true; } } return 1;}Ha nem jó, akkor másold be hogy hozod létre a FalloutObjectsDropped változót
FalloutObjectsDropped ennek a tömbnek mekkora a mérete? [/quote]36 cella. bool: FalloutObjectsDropped[ 36 ] E.: Idõközben kivettem az AllFalloutObjectDropped() eljárást, mert hibásan írtam meg.
bool: FalloutObjectsDropped[ 36 ]