Raised This Month: $51 Target: $400
 12% 

No Censure 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-11-2016 , 12:22   Re: No Censure 1.0
Reply With Quote #11

Ohh, ok...
If i add charsmax, use switch instead of "if" (where You said) and use fopen instead of read file, will You approve it?

Im not begginer , i trusted to that coder because his plugin was approved, so i wanted not to do it myself ,and use his stock and scripts as the base.
I really didn't pay attention to his code.

Yeah , i saw the date of simple swear replacement. Method have been changed since that year.
siriusmd99 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-11-2016 , 13:59   Re: No Censure 1.0
Reply With Quote #12

Quote:
If i add charsmax, use switch instead of "if" (where You said) and use fopen instead of read file, will You approve it?
Probably not, considering I did not give you a full list of problematic thing. But if being approved is more important than learning/understanding what you're doing, it will be definitely no. Start fixing your plugin for now.

Quote:
Im not begginer , i trusted to that coder because his plugin was approved
This, that's the whole point, you don't even understand what you copied. It's called being a beginner. No big deal, I was once a beginner too. Please don't start to be stubborn on this, learn at your own pace.
__________________

Last edited by Arkshine; 06-11-2016 at 14:01.
Arkshine is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-11-2016 , 17:23   Re: No Censure 1.0
Reply With Quote #13

Now i see that his code is bad coded. He used strlen while replace returns string length,and other mistakes.
Thanks , i will fix it and come with some improvements.Thanks for attention.

Last edited by siriusmd99; 06-11-2016 at 17:24.
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-12-2016 , 13:06   Re: No Censure 1.0
Reply With Quote #14

I have updated it as I promissed.Take a look Arkshine.
siriusmd99 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-12-2016 , 15:50   Re: No Censure 1.0
Reply With Quote #15

You did not do all I said.

- Don't hardcode configs path. You can modify it in core.ini. Use get_configs() to retrieve such path.
- Your loop to count lines and getting max word length are pointless. Saving few bytes is not worth of parsing a while file 2 times. Just use sizeof(t_word) as max length for ArrayCreate(). Instead you should load config file first, then, if you have items in your list (ArraySize) then you register the events.
- Checking with isalpha is likely wrong as it will not match for spaces. You should trim() first, then checcking if string not empty (string[0] != EOS, EOS is a constant = End Of String). Also, you don't need to call strlen() again after that, you can get the original length from fgets(), then the removed spaces with trim().
- l119 is not indented.
- get_msg_arg_string returns already the length.
- g_size should be the value of ArraySize()

A great feature for this kind of plugin would be to allow regular expression in the config using regex API. Your code would be much cleaner and plugin much more flexible.
For example, an admin could simply write: "f+u+c+k+" and it will match each letter from one to unlimited occurrences. It will do the same as your current code. If you want to support uppercase, you can do something like that "[fF]+[uU]+[cC]+[kK]+" ([] means basically a list of characters. You probably don't need that as there is a flag to enable insensitive case).
Regex is very powerful. You can check this tutorial.
__________________

Last edited by Arkshine; 06-13-2016 at 16:56.
Arkshine is offline
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 08-13-2016 , 05:23   Re: No Censure 1.0
Reply With Quote #16

Great idea! The only problem is that the plugin blocks if someone says: "f*ck off kiddo"
but it doesnt block this string : "man f*ck you" it only looks at the first word.
pupdebox 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 03:30.


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