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

Admin Bad Word Log


Post New Thread Reply   
 
Thread Tools Display Modes
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 07-03-2020 , 07:01   Re: Admin Bad Word Log
Reply With Quote #11

The fact that you don't understand from this sentence shows that you lack experience and knowledge.
That's the wrong way to go about it, but if you're going to publish a plugin, you should come up with that answer yourself.
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is online now
thEsp
BANNED
Join Date: Aug 2017
Old 07-03-2020 , 07:07   Re: Admin Bad Word Log
Reply With Quote #12

Quote:
Originally Posted by +ARUKARI- View Post
The fact that you don't understand from this sentence shows that you lack experience and knowledge.
That's the wrong way to go about it, but if you're going to publish a plugin, you should come up with that answer yourself.
+
In other words, the author can't properly support his plugin and so it meets the criteria for unapprovement.

Last edited by thEsp; 07-03-2020 at 07:27.
thEsp is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-03-2020 , 08:21   Re: Admin Bad Word Log
Reply With Quote #13

I tested it with the code you said but it doesn't work,

There is no problem with the code I used, why should I change that code?

Code:
    new szFile = fopen(g_BadWordFile2, "r");         if(szFile)     {         new szText[512];                 while (!feof(szFile))         {             fgets(szFile, szText, charsmax(szText));                         trim(szText);                         if (szText[0]==';')             {                 continue;             }                         if(parse(szText))             {                 continue;             }         }                 fclose(szFile);     }     return 1;
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷
alferd is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-03-2020 , 08:42   Re: Admin Bad Word Log
Reply With Quote #14

read/write_file is much slower than fread/write. In fact the more you use it the worse it becomes. Anyway the reason it didn't work for you is because you aren't reading the file as a text (most likely).

Last edited by thEsp; 07-03-2020 at 08:43.
thEsp is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-03-2020 , 14:32   Re: Admin Bad Word Log
Reply With Quote #15

Quote:
Originally Posted by alferd View Post
There is no problem with the code I used, why should I change that code?
Just because it works doesn't make it good code. Ideally, approved plugins should have some sort of quality.

Quote:
Originally Posted by alferd View Post
I tested it with the code you said but it doesn't work,

Code:
    new szFile = fopen(g_BadWordFile2, "r");         if(szFile)     {         new szText[512];                 while (!feof(szFile))         {             fgets(szFile, szText, charsmax(szText));                         trim(szText);                         if (szText[0]==';')             {                 continue;             }                         if(parse(szText))             {                 continue;             }         }                 fclose(szFile);     }     return 1;
Did you debug it? Also, you should use while( fgets(file, buffer, charsmax(buffer)) ) for your loop (There are a lot of examples of using feof() but it's more proper to use fgets as your while loop condition).

Another thing that I notice is that when you are doing to loop over all items in an array every time you should use a for loop instead of a while loop.

Also, szSaid[] is way too big, it's not possible to have that many characters in a chat message. I can't remember the exact limit but I'm sure it's not more than 64. Having an array size of 1000+ is not good because you're allocating memory for it every single time a chat message is transmitted which means you are wasting resources for no reason.
__________________
fysiks is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-21-2021 , 05:17   Re: Admin Bad Word Log
Reply With Quote #16

Unapproved, see above.
__________________
HamletEagle 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 22:52.


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