ItsMods

Full Version: Bad Names Kick Plugin v3.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
(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?
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.
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. }
(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!
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
@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
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
(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.

(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
Good Work , Nais.
Pages: 1 2 3 4 5 6 7 8