Raised This Month: $ Target: $400
 0% 

Methodmaps on global variables


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 03-31-2016 , 23:39   Methodmaps on global variables
Reply With Quote #1

I'm probably missing something pretty simple. I'm getting used to the new syntax and have been running into an issue with global variables, specifically with datapacks. I'm getting some errors.

PHP Code:
DataPack g_hMenuDataPack[MAXPLAYERS 1];
func1(int iClient)
{
    if(
g_hMenuDataPack[iClient] != null)
    {
        
delete g_hMenuDataPack[iClient];
        
g_hMenuDataPack[iClient] = null;
    }

    
g_hMenuDataPack[iClient] = new DataPack();
    
g_hMenuDataPack[iClient].WriteString(strPerk);
    
g_hMenuDataPack[iClient].WriteCell(iPrice);
    
g_hMenuDataPack[iClient].WriteCell(iDuration);
}

func2(int iClient)
{
    
g_hMenuDataPack[iClient].Reset(); // This is where I get the "invalid datapack handle" error.


Last edited by ReFlexPoison; 03-31-2016 at 23:55.
ReFlexPoison is offline
 



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 02:12.


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