Raised This Month: $48 Target: $400
 12% 

Solved [ H3LP ] CreateArray


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-11-2019 , 04:24   [ H3LP ] CreateArray
Reply With Quote #1

Hello. I am trying to create a dynamic array.

PHP Code:
if(g_aCheckPoints == INVALID_HANDLE)
        
g_aCheckPoints CreateArray(ARRAY_LEN); 
But it seems to return 0, I tried then checking if the array is an invalid handle, print a message to console and it prints it. Btw, the array is created on the OnMapStart() forward.
Any ideas why it returns 0? Also tried to print the value of g_aCheckPoints and it was indeed 0 after creation. Thanks !

Last edited by DarthMan; 02-11-2019 at 14:33. Reason: Solved
DarthMan is offline
Ilusion9
Senior Member
Join Date: Jun 2018
Location: Romania
Old 02-11-2019 , 06:14   Re: [ H3LP ] CreateArray
Reply With Quote #2

PHP Code:

ArrayList g_aCheckPoints
;

public 
void OnPluginStart()
{
        
g_aCheckPoints = new ArrayList();
}

public 
void OnMapStart()
{
        
g_aCheckPoints.Clear(); // we don't create the array again, we just clear it.

__________________
Ilusion9 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-11-2019 , 07:17   Re: [ H3LP ] CreateArray
Reply With Quote #3

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

ArrayList g_aCheckPoints
;

public 
void OnPluginStart()
{
        
g_aCheckPoints = new ArrayList();
}

public 
void OnMapStart()
{
        
g_aCheckPoints.Clear(); // we don't create the array again, we just clear it.

Thanks :-)
Seems to be working fine now.

Last edited by DarthMan; 02-11-2019 at 07:19.
DarthMan is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:50.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode