(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
public override void OnPlayerConnect(ServerClient Client)
{
string[] cn = Client.Name.Split(' ');
foreach (string x in cn)
{
if (fwords.Contains(x))
ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
//The kick command will always be executed, no matter what the if tells.
ServerCommand("kick " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
}
}
It should be
CSHARP Code
if (fwords.Contains(x))
{
ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
ServerCommand("dropClient " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
}
(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
public override void OnPlayerConnect(ServerClient Client)
{
string[] cn = Client.Name.Split(' ');
foreach (string x in cn)
{
if (fwords.Contains(x))
ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
//The kick command will always be executed, no matter what the if tells.
ServerCommand("kick " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
}
}
It should be
CSHARP Code
if (fwords.Contains(x))
{
ServerSay("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
ServerCommand("dropClient " + Client.ClientNum + "\" Bad Name, ^1Fuck Off!\"");
}
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
Can't test my plugin b/c my plugins don't load in my server
tha fuck
@
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
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