Raised This Month: $ Target: $400
 0% 

load from file and make every line into a parameter or like that[fixed]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-10-2009 , 09:33   load from file and make every line into a parameter or like that[fixed]
Reply With Quote #1

hi, i want to make each case be not "text" but param with text which is loaded from a line of file, so 1st param will be 1st line, 2nd = 2nd etc
for this code (i want to try if this gonna help me make plugin work with UTF-8 characters cuz compiler won't let me compile anything with UTF-8 non-english characters so i wan't to try put em outside the plugin

PHP Code:
    switch (said[i])
    {
        case 
'z'1
        
case 'x'2
        
case 'c'3
        
case 'v'4
        
case 'b'5
        
case 'n'6
        
case 'm'7

here is how it should load a file i think but i need to make it into lines and 7 params

PHP Code:
      addfilename"/lol.ini" );
}

public Function()
{
      if( 
file_exists(filename) )
      {
            new 
dataread[250];
            new 
fs fopenfilename );
            while( !
feof(fs) ) // Keep looping untill the end of the file.
            
{
                  
fgetsfsdatareadsizeof dataread );
                  
// Now dataread contains what's in the lol.ini 
                  
(untill next line).
                  
client_print0print_chat"Test: %s"dataread );
                  
// Shows the info we got from the file to all players.
            
}

            
fclosefs ); // We must close the file after we opened it.
      

}

so lol.ini will be
PHP Code:
z
x
c
v
b
n

__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 04-10-2009 at 10:08.
Owyn is offline
Send a message via ICQ to Owyn
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-10-2009 , 10:05   Re: load from file and make every line into a parameter or like that
Reply With Quote #2

Maybe if you encode your sma as Unicode without BOM. I don't know how Unicode works with pawn or HL.
__________________
fysiks is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-10-2009 , 10:07   Re: load from file and make every line into a parameter or like that
Reply With Quote #3

lang files works fine if i set them to unicode, only problem is compiler won't let me compile anything with unicode
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply



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:14.


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