Thread: [Solved] Invalid cellvector handle
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-23-2018 , 11:37   Re: Invalid cellvector handle
Reply With Quote #24

Quote:
Originally Posted by maqi View Post
PHP Code:
public RoundStarted( ) 

    
ArrayClearg_aOrigins ); // This is a clear btw :D
    
RetrieveOrigins( ); 
     
    
GetRandomOriginfOrigin );  

Nice finding Sherlock, but that clear is executed before the functions.

Quote:
Originally Posted by Ghosted View Post
Code:
 new iRandomEntry = random_num( 0, ArraySize( g_aOrigins ) );
Code:
 new iRandomEntry = random_num( 0, ArraySize( g_aOrigins ) - 1);
Plus Check if Array has any item.

if (!ArraySize(g_aOrigins))
return;
According to your logic, if ArraySize is 0, 0 - 1 = -1, which is incorrect.

If I check ArraySize, it will stop the error, but won't fix my problem.
__________________
edon1337 is offline