Raised This Month: $ Target: $400
 0% 

diffrent origins from a file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-21-2009 , 18:16   Re: diffrent origins from a file
Reply With Quote #5

Quote:
Originally Posted by Dr.G View Post
thanks!

so something like:

PHP Code:
new line 1
 
read_file 
( const file[], line++, text[], len, &txtLen 
to get it to take the next line every time right?
This will read each individual line of a text file. Untested

PHP Code:
    new szFile[] = "c:\originfile.txt"
    
new iNumLines file_size szFile);
    new 
iLineLen;
    
    if( 
file_size(szFile,) )
        
iNumLines--;
        
    for( new 
iCurLine 1iCurLine<= iNumLinesiCurLine++)
    {
        new 
szReadBuffer[256];
        
read_file szFileiCurLineszReadBuffer255,iLineLen);
        
//szReadBuffer holds the line of text. You will need to split this up into 3 floats to go into your origin array.
        
    

__________________

Last edited by Bugsy; 02-21-2009 at 18:32.
Bugsy 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 16:55.


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