how can i read from file
Lets say I have a menu and i have defined item costs :
Code:
And later on I user them e.g. Code:
I want to make a new file costs.ini and read COST1, COST2, COST3 and COST4 from there , how can I do that ? Could you please provide an example? |
Re: how can i read from file
try pcvar then you can set the amount from any configuration file that gets exec. ?
|
Re: how can i read from file
Ask layka_lubii, he is the king of pop.
Or look there : https://forums.alliedmods.net/showthread.php?t=46218 |
Re: how can i read from file
Quote:
|
Re: how can i read from file
here is a basic example with use of pcvars to make item costs...
then just add the cvars to amxx.cfg or another cfg file...
Example
|
Re: how can i read from file
@Blizzard, I know how to use them but I dont want to use them, I have 2 reasons for that.
1) I want to learn something new 2) I want an .ini file for my plugin, i think its better then cvars |
Re: how can i read from file
Quote:
|
Re: how can i read from file
Find a plugin that already does something similar to what you want and get that working. Then modify it for your purposes. After you have done that you should ask specific questions.
|
Re: how can i read from file
Thanks for response, fysiks. I was looking for some simple plugin, but i didnt get the idea. Could u please provide a descriptive example?
|
Re: how can i read from file
Quote:
Once you are able to read the file, you simply need to get the number from the resulting strings with str_to_num(). |
| All times are GMT -4. The time now is 10:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.