Raised This Month: $ Target: $400
 0% 

Block Button ID


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-16-2018 , 17:11   Re: Block Button ID
Reply With Quote #7

You just read sData, and counted it, you didn't place the result anywhere, sData is a local variable ( Outside of the function, it doesn't exist ).

You are using the var ButtonsID wrong.

Try doing something like:

PHP Code:
//Make a global var
new g_iButtons[MAX_BUTTONS],
       
g_iButtonCounter;


new 
sData[128];
    if(
iFileHandle)
    {
        while(!
feof(iFileHandle))
        {
            
fgets(iFileHandlesDatacharsmax(sData)); // Read data to a local variable sData
            
trim(sData);

            
g_iButtons[g_iButtonCounter] = str_to_numsData ); // This will hold your button id

            
g_iButtonCounter++; // Count the number of buttons, also use it to index an array in the line above
        
}

        
fclose(iFileHandle);
    }
    else
    {
        
set_fail_state("Couldn't read from a file");
    }

That is if you don't feel comfortable using cellarrays
__________________
stuff

Last edited by maqi; 06-16-2018 at 17:16.
maqi 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 04:39.


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