Help problem in warn code!!
#1
Hi
guys i have problem with this cod:

Code:
public bool warnPlayer(ServerClient client, string reason) { int num = 0; reason = reason.Trim(); reason = reasonParser(reason); string message = ""; if (playerWarnings.TryGetValue(client.XUID, out num)) { num++; if (num >= kickWarnings) { message = GetServerCFG("AdminPlug", "warnkickmessage", "[Admin]: <playername> was kicked for <reason>").Replace("<playername>", client.Name).Replace("<reason>", reason).Replace("<warningcount>", num.ToString()); ServerSay(message, true); ServerCommand("kickclient " + client.ClientNum + " \"[Admin]: you kick for max warn rechead!!\""); playerWarnings.Remove(client.XUID); warningTime.Remove(client.XUID); playerWarnings.Add(client.XUID, 0); return true; } if (num < kickWarnings) { playerWarnings.Remove(client.XUID); playerWarnings.Add(client.XUID, num); if (warningTime.ContainsKey(client.XUID)) { warningTime.Remove(client.XUID); } warningTime.Add(client.XUID, DateTime.Now.AddHours(warningTTL)); message = GetServerCFG("AdminPlug", "warnmessage", "[Admin]: <playername> was warned for <reason>").Replace("<playername>", client.Name).Replace("<reason>", reason).Replace("<warningcount>", num.ToString()); //ServerCommand("kickclient " + client.ClientNum + " \"[Admin]: you kick for max warn rechead!!\""); //base.ServerCommand("kickclient " + client.ClientNum); ServerSay(message, true); iPrintLnBold(string.Concat(new object[] { "[Admin]: You have been ^3Warned ^7for ^1", reason, " ^7Warning number:^1 ", num }), client); } } else if (!playerWarnings.TryGetValue(client.XUID, out num)) { num++; playerWarnings.Add(client.XUID, 1); if (warningTime.ContainsKey(client.XUID)) { warningTime.Remove(client.XUID); } warningTime.Add(client.XUID, DateTime.Now.AddHours(warningTTL)); iPrintLnBold(string.Concat(new object[] { "[Admin]: You have been ^3Warned ^7for ^1", reason, " ^7Warning number:^1 ", num }), client); //ServerCommand("kickclient " + client.ClientNum + " \"[Admin]: you kick for max warn rechead!!\""); message = GetServerCFG("AdminPlug", "warnmessage", "[Admin]: <playername> was kicked for <reason>").Replace("<playername>", client.Name).Replace("<reason>", reason).Replace("<warningcount>", num.ToString()); ServerSay(message, true); } return false; }


In last else when i deactive this cod:

Code:
//ServerCommand("kickclient " + client.ClientNum + " \"[Admin]: you kick for max warn reached!!\"");

plug worked correctly and kiked player after 3 warn

but kick massege not showed after player kicked : you kick for max warn rechead!!

and when i active this code in last else:

Code:
ServerCommand("kickclient " + client.ClientNum + " \"[Admin]: you kick for max warn rechead!!\"");

after 1 warn player kicked (and its not correctly Because player must kicked after 3 warns) but now the warn massage : you kick for max warn rechead!!
showed to him after kicked !!

How i can to fix that plugin work for 3warns and also showed kick message : you kick for max warn rechead!!

#2
I don't understand you at all...
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]

#3
it sould be like this :

Code:
ServerCommand("dropclient " + client.ClientNum + " \"[Admin]: you got kicked for max warn reachead!!"");

#4
Solved
req close/



Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with Rain Effects on Maps mitchhacker 5 7,637 10-22-2013, 00:46
Last Post: mitchhacker
  Help Code color crosshairs koren30 3 5,368 10-02-2013, 19:26
Last Post: koren30
  Help need help?how to make plugins code hXnarutoXone 12 12,032 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 4,425 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 5,919 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 13,016 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 7,828 07-28-2013, 01:52
Last Post: First_Semyon
  Help Liberation Problem Yamato 27 30,960 07-17-2013, 19:54
Last Post: feature
  [xna 4]Rendering problem narkos 9 9,055 07-03-2013, 19:00
Last Post: Nekochan
  Code of vector Bloodfocus 1 3,390 06-23-2013, 11:54
Last Post: Yamato

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.