Raised This Month: $ Target: $400
 0% 

Need Opinion (Optimizing / File or Array)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 01-31-2009 , 20:47   Re: Need Opinion (Optimizing / File or Array)
Reply With Quote #1

I think this should do it:

(I haven't tested and didn't check for typos.)

You should write the file like this if you want to use my function:
Code:
hitman *p STEAM_ID_SOMETHING abcd
Code:
public CheckAccess(id, const model) {     if(!is_user_connected) return 0         new fh = fopen(FILE_NAME, "rt")         if(!fh) return 0         static szBuffer[256], szModel[32], szSomething[8], szAuth[32], szFlags[32]         static szPlayerAuth[32]     get_user_authid(id, szPlayerAuth, charsmax(szPlayerAuth))         while(!feof(fh))     {         fgets(fh, szBuffer, charsmax(szBuffer))         parse(szBuffer, szModel, charsmax(szModel), szSomething, charsmax(szSomething), szAuth, charsmax(szAuth), szFlags, charsmax(szFlags))                 if(equali(model, szModel) && (equali(szAuth, szPlayerAuth) || get_user_flags(id) & read_flags(szFlags)))         {             fclose(fh)             return 1         }     }         fclose(fh)     return 0 }
__________________
stupok is offline
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 01:43.


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