Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Bad Names Kick Plugin v3.0
#51
(04-25-2012, 18:20)OzonE Wrote: bonemind's plugin?
thats the kicking command and shit , exist in every plugin.

I know but can't you modify it to Kick/ban player on entry of server if the person has the name in forbidden.txt?
Reply

#52
i think the bug is in the strings shit , it checks every character of it , i think we have to modify to make it read the name only.
Reply

#53
Explaining problems according to source code on page 1:

- kick command is for name not for ClientNum
- Since you are splitting the name, people who use name like aFucka don't get kicked
- You are comparing with case sensitive
- Using if clause wrong
CSHARP Code
  1. public override void OnPlayerConnect(ServerClient Client)
  2. {
  3.  
  4. string[] cn = Client.Name.Split(' ');
  5. foreach (string x in cn)
  6. {
  7. if (fwords.Contains(x))
  8. ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
  9. //The kick command will always be executed, no matter what the if tells.
  10. ServerCommand("kick " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
  11. }
  12.  
  13. }

It should be
CSHARP Code
  1. if (fwords.Contains(x))
  2. {
  3. ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
  4. ServerCommand("dropClient " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
  5. }
[Image: azuw.jpg]
Reply

#54
(04-26-2012, 08:19)zxz0O0 Wrote: Explaining problems according to source code on page 1:

- kick command is for name not for ClientNum
- Since you are splitting the name, people who use name like aFucka don't get kicked
- You are comparing with case sensitive
- Using if clause wrong
CSHARP Code
  1. public override void OnPlayerConnect(ServerClient Client)
  2. {
  3.  
  4. string[] cn = Client.Name.Split(' ');
  5. foreach (string x in cn)
  6. {
  7. if (fwords.Contains(x))
  8. ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
  9. //The kick command will always be executed, no matter what the if tells.
  10. ServerCommand("kick " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
  11. }
  12.  
  13. }

It should be
CSHARP Code
  1. if (fwords.Contains(x))
  2. {
  3. ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
  4. ServerCommand("dropClient " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
  5. }

Oh now I see xP I'll build another version. zxz thanks a ton!
Reply

#55
Nope... People still get booted out of the match..
Might try one more thing.. if this works then Me Gusta
Can't test my plugin b/c my plugins don't load in my server Dumb Bitch tha fuck Dumb Bitch
Reply

#56
@bonemind thanks for info..
Quote:I think this is wrong, When you write the if statement without {}, only the line below it is consideren part of it, so this piece of code executes ServerSay if a forbidden word is found, and then bans the player anyway xD
aight much help but which part should I change?
Well...i could literally write it but i'm not going to
Since writing an if statement without {} makes the next line only part of it, and multiple lines should be part of it, how about adding {} at the quoted if statement? xD
and no, i'm not trolling by not saying it, just spitting it out wouldn't teach you anything
Now I still need to figure out what's wrong xP
Reply

#57
Aight 100% fixed tested this over 10 times with different names, people, and commands. Will upload soon.
Ok guys finally it's now ready! This time it won't kick/ban everyone Big Grin
Commands I changed to: !badname @GrossKopf thought !plus is silly as well as I did so xP


Attached Files
.rar   BadName V3.rar (Size: 5.68 KB / Downloads: 183)
Reply

#58
(04-28-2012, 21:47)DidUknowiPwn Wrote: @bonemind thanks for info..
Quote:I think this is wrong, When you write the if statement without {}, only the line below it is consideren part of it, so this piece of code executes ServerSay if a forbidden word is found, and then bans the player anyway xD
aight much help but which part should I change?
Well...i could literally write it but i'm not going to
Since writing an if statement without {} makes the next line only part of it, and multiple lines should be part of it, how about adding {} at the quoted if statement? xD
and no, i'm not trolling by not saying it, just spitting it out wouldn't teach you anything
Now I still need to figure out what's wrong xP
Lol that's what I already said in my previous post.

[Image: azuw.jpg]
Reply

#59
(04-29-2012, 09:29)zxz0O0 Wrote:
(04-28-2012, 21:47)DidUknowiPwn Wrote: @bonemind thanks for info..
Quote:I think this is wrong, When you write the if statement without {}, only the line below it is consideren part of it, so this piece of code executes ServerSay if a forbidden word is found, and then bans the player anyway xD
aight much help but which part should I change?
Well...i could literally write it but i'm not going to
Since writing an if statement without {} makes the next line only part of it, and multiple lines should be part of it, how about adding {} at the quoted if statement? xD
and no, i'm not trolling by not saying it, just spitting it out wouldn't teach you anything
Now I still need to figure out what's wrong xP
Lol that's what I already said in my previous post.

Ya and I just saw it as well. The reason yours didn't work is because you can't add a reason for the kick once removed and added {} it worked flawlessly... So much fail on both of our parts Big Grin
Reply

#60
Good Work , Nais.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,169 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,748 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,581 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,672 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,180 10-19-2013, 06:59
Last Post: iRoNinja
  [Request] Anoying and bad names kicker! Misterio 1 2,477 10-15-2013, 09:41
Last Post: Nekochan
  [Release] Yurio Map Plugin Yurio 101 62,330 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,653 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,712 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,296 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.