Raised This Month: $ Target: $400
 0% 

Reading from a file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 02-04-2007 , 18:10   Re: Reading from a file
Reply With Quote #1

I never used the new reading/writing system thingy, so I have no idea if this works.
Also, there's a tut here:
http://forums.alliedmods.net/showthread.php?t=46218
Edit: Wow, apparently what your asking for is already done in that thread.
Code:
#include <amxmodx> #include <amxmisc> new steamfile[256] public plugin_init() {     register_plugin("Read SteamID","1.0","")         //Set the configs dir     get_configsdir(steamfile,255)     format(steamfile,255,"%s/steamids.ini",steamfile)         // If the file doesn't exist, make one.     if(!file_exists(steamfile))     {         write_file(steamfile,";SteamID File");          }           } public client_putinserver(id) {      if(valid_steamid(id)) {         //If valid ID     } } public valid_steamid(id) {     new valid = 0     new file = fopen(steamfile,"r")     if(file) {         new read[130],steamid[33],authid[33]         while(fgets(file,read,129)) {             parse(read,steamid,32)             get_user_authid(id,authid,32)             if(equal(authid,steamid)) {                 valid = 1             }             else {                 valid = 0             }         }     }     return valid }

Last edited by Drak; 02-04-2007 at 18:13.
Drak is offline
Send a message via MSN to Drak
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:44.


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