mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-20 22:15:43 +00:00
41 lines
701 B
Plaintext
41 lines
701 B
Plaintext
#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);
|
|
}
|
|
} |