mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 12:42:54 +00:00
chat_command_kill 1.0.0
This commit is contained in:
parent
0c20175902
commit
d6bf08092b
@ -94,6 +94,19 @@ Note that this does not make the player invisible to bots in the sense that even
|
||||
| `!invisible me` |
|
||||
| `!invisible Resxt` |
|
||||
|
||||
## chat_command_kill.gsc
|
||||
|
||||
The player who runs the command kills the targeted player (no matter if they're in the same team or not)
|
||||
|
||||
| # | Argument | Mandatory |
|
||||
|---|---|---|
|
||||
| 1 | The name of the player to kill | :white_check_mark: |
|
||||
|
||||
| Examples |
|
||||
|---|
|
||||
| `!kill me` |
|
||||
| `!kill Resxt` |
|
||||
|
||||
## chat_command_map_mode.gsc
|
||||
|
||||
3 related commands in one file:
|
||||
|
53
chat_commands/chat_command_kill.gsc
Normal file
53
chat_commands/chat_command_kill.gsc
Normal file
@ -0,0 +1,53 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.commands_servers_ports, "kill", "function", ::KillCommand, ["default_help_one_player"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Command section */
|
||||
|
||||
KillCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
error = KillPlayer(args[0]);
|
||||
|
||||
if (IsDefined(error))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Logic section */
|
||||
|
||||
KillPlayer(targetedPlayerName)
|
||||
{
|
||||
if (self TargetIsMyself(targetedPlayerName))
|
||||
{
|
||||
self Suicide();
|
||||
}
|
||||
else
|
||||
{
|
||||
player = FindPlayerByName(targetedPlayerName);
|
||||
|
||||
if (!IsDefined(player))
|
||||
{
|
||||
return PlayerDoesNotExistError(targetedPlayerName);
|
||||
}
|
||||
|
||||
playerTeam = self.team;
|
||||
self.team = "noteam"; // we change the player's team to bypass the friendly fire limitation
|
||||
|
||||
player thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_SUICIDE", self getCurrentWeapon(), (0,0,0), (0,0,0), "torso", 0 );
|
||||
|
||||
self.team = playerTeam; // sets the player's team to his original team again
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user