mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-09-03 23:27:27 +00:00
chat_command_map_mode 1.0.0
This commit is contained in:
62
chat_commands/chat_command_map_mode.gsc
Normal file
62
chat_commands/chat_command_map_mode.gsc
Normal file
@@ -0,0 +1,62 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.commands_servers_ports, "map", "function", ::ChangeMapCommand, ["Example: " + level.commands_prefix + "map mp_dome"]);
|
||||
CreateCommand(level.commands_servers_ports, "mode", "function", ::ChangeModeCommand, ["Example: " + level.commands_prefix + "mode FFA_default"]);
|
||||
CreateCommand(level.commands_servers_ports, "mapmode", "function", ::ChangeMapAndModeCommand, ["Example: " + level.commands_prefix + "mapmode mp_seatown TDM_default"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Command section */
|
||||
|
||||
ChangeMapCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
ChangeMap(args[0]);
|
||||
}
|
||||
|
||||
ChangeModeCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
ChangeMode(args[0], true);
|
||||
}
|
||||
|
||||
ChangeMapAndModeCommand(args)
|
||||
{
|
||||
if (args.size < 2)
|
||||
{
|
||||
return NotEnoughArgsError(2);
|
||||
}
|
||||
|
||||
ChangeMode(args[1], false);
|
||||
ChangeMap(args[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Logic section */
|
||||
|
||||
ChangeMap(mapName)
|
||||
{
|
||||
cmdexec("map " + mapName);
|
||||
}
|
||||
|
||||
ChangeMode(modeName, restart)
|
||||
{
|
||||
cmdexec("load_dsr " + modeName + ";");
|
||||
|
||||
if (restart)
|
||||
{
|
||||
cmdexec("map_restart");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user