AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Read file on HUD (https://forums.alliedmods.net/showthread.php?t=40222)

Drak 06-25-2006 01:11

Read file on HUD
 
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?

SweatyBanana 06-25-2006 01:19

Re: Read file on HUD
 
Try putting spaces in the config file


or try using set_task.

mysticssjgoku4 06-25-2006 09:10

Re: Read file on HUD
 
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 }

mysticssjgoku4 06-25-2006 09:17

Re: Read file on HUD
 
No delete button?


All times are GMT -4. The time now is 08:05.

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