mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 12:42:54 +00:00
Added permission level to CreateCommand following chat_commands 1.3.0 update [Refactor] changed level scoped ports variable following chat_commands 1.3.0 update
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
#include scripts\chat_commands;
|
|
|
|
Init()
|
|
{
|
|
CreateCommand(level.chat_commands["ports"], "kill", "function", ::KillCommand, 3, ["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
|
|
}
|
|
} |