include defines from ini file
Hi there,
Is it possible to include define values from a ini file into the plugin itself? example plugin.ini Code:
#define GAME_TYPE 1Code:
server_print("Value: %d",GAME_TYPE); |
Re: include defines from ini file
defines are use at compile time.
You can read some values from .ini files but then you have to assign them to vars in the plugin. |
Re: include defines from ini file
Short Answer: No
Middle Answer: You could read a file (eg. a .ini file) and use the value that is read. Long Answer: Yes, just include the file, but it would have to be in the same format as a .sma or .inc and it would need to be where it was compiled. So if you were to change the .ini file, you would still need to recompile the script. |
Re: include defines from ini file
Thx alot guys!! :)
The long answer solved it!! Thanks man! |
Re: include defines from ini file
Dont know where my head was but now i feel kinda retarded :P
I know that it reads the include at compile so i dont know how i got it so wrong in my head. It should read the file at startup :) Would you mind giving me an example of the middle answer? Thx! |
Re: include defines from ini file
Just read the file for each line and parse the lines for the data you want.
|
Re: include defines from ini file
See the tutorials or any plugin that reads from a file (too many to count).
|
| All times are GMT -4. The time now is 02:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.