mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-19 13:42:54 +00:00
chat_command_kick 1.0.0
This commit is contained in:
parent
f029c48373
commit
fdb479d6df
@ -138,6 +138,23 @@ However, in addition to being invisible, you will also be ignored by zombies in
|
||||
|---|
|
||||
| 3 |
|
||||
|
||||
## chat_command_kick.gsc
|
||||
|
||||
Kicks the targeted player.
|
||||
Note that due to some game limitations you cannot kick the host.
|
||||
|
||||
| # | Argument | Mandatory |
|
||||
|---|---|---|
|
||||
| 1 | The name of the player to kick | :white_check_mark: |
|
||||
|
||||
| Examples |
|
||||
|---|
|
||||
| `!kick Resxt` |
|
||||
|
||||
| Permission level |
|
||||
|---|
|
||||
| 4 |
|
||||
|
||||
## chat_command_permissions.gsc
|
||||
|
||||
2 related commands in one file:
|
||||
|
41
chat_commands/chat_command_kick.gsc
Normal file
41
chat_commands/chat_command_kick.gsc
Normal file
@ -0,0 +1,41 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.chat_commands["ports"], "kick", "function", ::KickCommand, 4, array("default_help_one_player"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Command section */
|
||||
|
||||
KickCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
error = KickPlayer(args[0]);
|
||||
|
||||
if (IsDefined(error))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Logic section */
|
||||
|
||||
KickPlayer(playerName)
|
||||
{
|
||||
player = FindPlayerByName(playerName);
|
||||
|
||||
if (!IsDefined(player))
|
||||
{
|
||||
return PlayerDoesNotExistError(playerName);
|
||||
}
|
||||
|
||||
Kick(player GetEntityNumber());
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user