Raised This Month: $ Target: $400
 0% 

Read file on HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 06-25-2006 , 01:11   Read file on HUD
Reply With Quote #1

I wanted to display texted on a HUD that is in a txt file,
Code:
new result[64],resultlength nextline = read_file("addons/amxmodx/configs/text.cfg",nextline,result,63,resultlength) format(moneydisplay,255,"Text %s^n",result) set_hudmessage(255,0,0,0.02,-0.7,_,_,_,_,_,1) show_hudmessage(id,moneydisplay)
It shows up, but it just keep's switching thru the txted in the file, how do I set a interval and it will read each line at the set interval?
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 06-25-2006 , 01:19   Re: Read file on HUD
Reply With Quote #2

Try putting spaces in the config file


or try using set_task.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-25-2006 , 09:10   Re: Read file on HUD
Reply With Quote #3

Tell me if this works.

Code:
public hud() {     new s_ConfigsDir[64]     get_configsdir(s_ConfigsDir,sizeof(s_ConfigsDir))     new s_File[96]     format(s_File,sizeof(s_File),"%s/%s",s_ConfigsDir,HUD_FILE)         if(file_exists(s_File))     {         new s_Hud[256]                 new num_lines = file_size(s_File,1)             for( new nextline = 0 ; nextline < num_lines ; nextline++ )         {             if(nextline > MAX_LINES) break                         new i_Num_Chars             new s_Text[64]             read_file(s_File , nextline , s_Text , sizeof( s_Text ) , i_Num_Chars )                         add(s_Hud,sizeof(s_Hud),s_Text)         }         set_hudmessage(255,0,0,0.02,-0.7,_,_,_,_,_,1)         show_hudmessage(0,s_Hud)     }     return PLUGIN_HANDLED }
__________________


Last edited by mysticssjgoku4; 06-25-2006 at 09:19.
mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-25-2006 , 09:17   Re: Read file on HUD
Reply With Quote #4

No delete button?
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
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 08:05.


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