File write / read
hy allied modders users, i have a amxx plugin with i am trying to write details from users who tipe comand in chat to a file, name, steamid and ip, i've recently updated to not allow 2 same names to be written and for my surprise it does'nt work anymore, it creates the file in configs but it's empty and when i type the comand it said that i already exist in the file, but the file is empty what's wrong with this code
Thanks for read and help And it will be helpfull if you can tell me how to print users from that file to a motd Sorry for my bad english i suck at it :| File removed! |
Re: File write / read
its not really good idea to keep reading the file several times, do it once and save the names to a dynamic array or something like that.
also was your name CryWolf when you tested it, cause i saw this in the code: Code:
if ( !filep )Code:
if ( containi ( szData, szName ) ) |
Re: File write / read
nope, my name was JasoN when i tested it!
btw i think you did not understand me plugin problems are 1. File is created but it's always empty even these are not on it Code:
write_file ( filen, "; File Names, 0.3 by CryWolf." );and 3rd i whanna know how to read names from file and print it to a motd, i don't need to optimize nothing yet AMXX 1.8.2 Metamod12.1-am |
Re: File write / read
If your code, you should be able to debug it. Right now you're saying "it doesn't work", but it's supposed to be your code, did you at least tried to debug it ? Like adding debug text, testing line by line, and such ?
|
Re: File write / read
Quote:
Thanks, i shall remake it without that function! debug mode helps me with nothing! |
Re: File write / read
Quote:
|
Re: File write / read
That's not your code then. Ok, thanks for confirmation.
Anyway, what I said is still valid, you should start to _debug_ "this" code. I did not say to add "debug" in plugins.ini. It's weird as coder you don't know to check your own code. I DO help you by saying what you should do, but don't worry I won't waste my time for someone who because don't understand something bash the helper. |
Re: File write / read
Quote:
Of course it's not my code: i've just followed a tutorial this one in achiving what i've made. That is not the point i didn't come here to argue, i've removed the function that verifies that the same player is not added twice to that list and solved. i will find somewere else a little help with fixing that! @YamiKaitou: what do you find helpfull in his first reply ? that is asking me if is my code or not and what's that have someting to do with what i've requested! Please guy's close the tread, this doesn't need to go further. Thanks for help, and i'am sorry for disturb and trouble, it will not happen again! |
Re: File write / read
Quote:
Just because you don't understand that, doesn't mean you are allowed to bash someone, because for your information I was helping you. You should have said clearly from the start that : - That's not your code - You are beginner - What you have tried That's said, since you're posting in Scripting section, you're willing to learn, right ? So, I say it again, debug your plugin : adding debug text with for example log_amx() to see if code is well executed, checking line by line to narrow down where is lying the problem, etc. |
Re: File write / read
Quote:
If you but that book under the pillow, then see results! Thats how i learned and learn everyday. :bee: |
| All times are GMT -4. The time now is 15:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.