mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-10-24 06:45:51 +00:00
chat_command_give 1.0.0
This commit is contained in:
41
chat_commands/zm/chat_command_give.gsc
Normal file
41
chat_commands/zm/chat_command_give.gsc
Normal file
@@ -0,0 +1,41 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.chat_commands["ports"], "givepowerup", "function", ::GivePowerupCommand, 2, [], array("spawnpowerup", "powerup", "pu"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Command section */
|
||||
|
||||
GivePowerupCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
error = GivePlayerPowerup(args[0]);
|
||||
|
||||
if (IsDefined(error))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Logic section */
|
||||
|
||||
GivePlayerPowerup(powerupName)
|
||||
{
|
||||
if (IsValidPowerup(powerupName))
|
||||
{
|
||||
level thread maps\mp\zombies\_zm_powerups::specific_powerup_drop(powerupName, self.origin);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PowerupDoesNotExistError(powerupName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user