Read models in .txt
I must make my script read information from a. Txt.
example: A. Txt models.txt was named in a folder and it would be listed SourceMod model by model: models/player/slow/aliendrone_v3/slow_alien.mdl;oldmodel models/player/slow/aliendrone_v3/slow_alien_hs.mdl;hs models/player/slow/aliendrone_v3/slow_alien_head.mdl;head player.mdl ...; oldmodel ... oldmodel for default model hs for headless model head for head model And everything was being set up, out instead to be done in the script, as below: PHP Code:
How can I do this? Thanks. |
Re: Read models in .txt
I would suggest using a KeyValue file, however, if you want to do something custom and write your own parser, then you can do so with these functions. You can then load the data into arrays and iterate through it.
|
Re: Read models in .txt
In the case I only need:
PHP Code:
Correct? |
Re: Read models in .txt
I would suggest using ReadFileLine and looping through. Something like: while(ReadFileLine(hndl, sBuffer, sizeof(sBuffer))) {}
You'll then need to break up the string and figure out which array it goes into. :P |
Re: Read models in .txt
You can make this more directed to my plugin?
Still do not understand. Thanks ^^ |
Re: Read models in .txt
Code:
new String:g_sOldModel[64][128], g_iOldModelPos; Code:
for (new i = 1; i <= g_iOldModelPos; i++) |
Re: Read models in .txt
Thanks, I'll test this model.txt should be in the folder addons / SourceMod?
Thanks again. |
Re: Read models in .txt
I'd recommend using BuildPath to getting it to where you want it. It's currently using /cstrike/models.txt
|
Re: Read models in .txt
Change here to Head right?
Before PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: Read models in .txt
yeah, that's right. silly copy & paste always making problems. :P
edit: Quote:
|
All times are GMT -4. The time now is 02:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.