Read data from file
Could someone make a tutorial on how to read data from a file? Or at least just show me how to do it.
|
Re: Read data from file
Quote:
|
Re: Read data from file
Yes, like a .ini file or just a plain .txt. file
Thanks :D |
Re: Read data from file
PHP Code:
Also check the funcwiki for more function details. |
Re: Read data from file
Ok, Thanks, but how do you navigate to the other folders.. would it be like fopen("addons/amxmodx/configs/plugins.ini") or something?
|
Re: Read data from file
Quote:
|
Re: Read data from file
What parameters would you change in the fgets, to change which line is read. Also, when I tried using feof, it says "undefined symbol: feof".
I'm trying to make a plugin where on round start, if someone's steamid is in the steamids.ini file, they will get kicked. I know, basically a ban, just trying to learn basics. here's code Code:
/* Plugin generated by AMXX-Studio */ |
Re: Read data from file
There is code that does exactly what youre trying to do in my aimbot detect plugin. Also, it would be more resourceful to check players as they connect. If you prefer to recheck every player at round start you should cache the steam id at client putinserver.
|
Re: Read data from file
well that code above doesn't work in my server, any clues? I put my steamid in the text file, and i don't get kicked on round start.
|
Re: Read data from file
You need to use %d for integers not %s and you should not define new variables within a loop.
|
| All times are GMT -4. The time now is 00:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.