09-19-2012, 23:13
09-20-2012, 04:37
easy
If no player name is given kills the caller itself
CSHARP Code
- using System;
- using Addon;
-
- namespace tralalal1
- {
- public class Class1:CPlugin
- {
- public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat)
- {
- if (Message.ToLower().StartsWith("!kill"))
- {
- string[] options = Message.Split(' ');
- if (options.Length == 1)
- KillPlayer(Client.ClientNum, Client.ClientNum, Client.Other.CurrentWeapon, string.Empty);
- else if (options.Length == 2)
- {
- ServerClient Victim = Client;
- if (GetClients() != null)
- {
- foreach (ServerClient client in GetClients())
- {
- if (client.Name.ToLower().Contains(options[1].ToLower()))
- Victim = client;
- }
- }
- if (Victim != Client)
- KillPlayer(Client.ClientNum, Victim.ClientNum, Client.Other.CurrentWeapon, string.Empty);
- else
- TellClient(Client.ClientNum, "^2Kill plugin error:Couldn't find the player", true);
- }
- else
- {
- TellClient(Client.ClientNum, "^3Wrong options try again", true);
- }
- return ChatType.ChatNone;
- }
- else
- return ChatType.ChatContinue;
- }
- }
- }
If no player name is given kills the caller itself
09-20-2012, 06:22
why not suicide player? its much easier.
09-20-2012, 12:27
(09-20-2012, 06:22)OzonE Wrote: [ -> ]why not suicide player? its much easier.
anyway to do this so it doesn't show as playername killed playername ??
09-20-2012, 15:21
There's a killplayer function now? Sweet!
09-20-2012, 20:49
just found out, this command is available to all users, even though it says permission denied etc they can still use it
09-21-2012, 06:12
i added the same thing in GP , but im using suicide player. all you need is client num.
09-30-2012, 17:10
the similar thing is now added to God Plugin 4.0.1.