Raised This Month: $32 Target: $400
 8% 

Check lines in folder


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 09-15-2018 , 10:30   Check lines in folder
Reply With Quote #1

hi guys..im wondering, is it possible to code a .sma which will look up for every line in the .ini/.cfg file, but in every .cfg file in one folder?
for example, if i go: amx_delete_every "toxic", that toxic will be the arg for searching in every .cfg, and every line (row) will be delete which contains that toxic

i guess its not that hard to find that one line in particular file, but to assigne code to find on every file in the folder ?
JocAnis is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 09-15-2018 , 11:14   Re: Check lines in folder
Reply With Quote #2

I haven't yet seen a native to output all files inside that folder, but in this case on which side location? Player's files or server's?
__________________
Relaxing is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 09-15-2018 , 11:16   Re: Check lines in folder
Reply With Quote #3

Server's. just to not look up in 100+ files and find that name
JocAnis is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 09-15-2018 , 11:22   Re: Check lines in folder
Reply With Quote #4

Problem is you can find the value but you can’t delete a line. That’s the reason KeyValues are used.
__________________
Spirit_12 is online now
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-15-2018 , 11:25   Re: Check lines in folder
Reply With Quote #5

Quote:
Originally Posted by Spirit_12 View Post
Problem is you can find the value but you can’t delete a line. That’s the reason KeyValues are used.
You can do both.
__________________
klippy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 09-15-2018 , 14:24   Re: Check lines in folder
Reply With Quote #6

any elaboration on this? i cant find anything to work with 2 files at the same time, nor with all in the directory

i came to one weird idea and dunno if its even possible:
read all lines from maps.ini, store every line (to catch all maps on srv)

then read all lines from all maps with specified target (toxic for example)

but its hardcored and retarded probably haha
JocAnis is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-15-2018 , 15:05   Re: Check lines in folder
Reply With Quote #7

If you don't want something on your server, don't put it there. Otherwise, your request make no sense.
__________________
fysiks is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-15-2018 , 15:17   Re: Check lines in folder
Reply With Quote #8

This is called "laziness" .
__________________









Last edited by CrazY.; 09-15-2018 at 15:17.
CrazY. is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 09-15-2018 , 15:23   Re: Check lines in folder
Reply With Quote #9

i think you dont get it...its about saving player informations in .cfg file, per map, via Prokreedz plugin. my idea is to delete cheater (unacceptable) time in every top (=every map.cfg)...
theres option to delete all files and start over, but thats not the best option to clean players in my op
@crazy if you really want reply; i wont call it laziness but possible implementation in prokreedz (nonsql) plugin

every line/row contains player's info + his time...its about it, nothing else

i mean, im not sure if its gonna be used ever, but would be cool to see that code and probably use for similar things, thanks in advance

Last edited by JocAnis; 09-15-2018 at 15:25.
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-15-2018 , 15:45   Re: Check lines in folder
Reply With Quote #10

These are the natives you need to use in order to find all files in a directory: open_dir, next_file, close_dir. I believe you'll figure out the rest.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 20:44.


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