AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Parsing code from a cfg file. (https://forums.alliedmods.net/showthread.php?t=245815)

PreDominance 08-07-2014 10:44

Parsing code from a cfg file.
 
Greetings,

Is it possible at all to take code from a CFG file, parse it, then run it? For example.

code.cfg
Code:

  cs_set_user_money(id, 16000);
include.inl

Code:

..open file, etc.. new szLine[MAX_LINE_LENGTH];
fgets(file, szLine, charsmax(szLine));
..execute szLine..

I do not want to map out commands, e.g:
Code:

if (equali(szLine, "cs_set_user_money")) {}
Thanks for any help!

fysiks 08-07-2014 18:15

Re: Parsing code from a cfg file.
 
I don't believe that that is possible and I would strongly recommend against doing that if it were.

ddhoward 08-08-2014 05:06

Re: Parsing code from a cfg file.
 
Not possible. You'd have to do what I think you mentioned at the very end of your post.

PreDominance 08-08-2014 08:10

Re: Parsing code from a cfg file.
 
Thanks for the reassurances guys. I've settled for parsing configs alone and not code.


All times are GMT -4. The time now is 13:18.

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