Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help message when attempting to load a script without arguments #1032

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Server/Components/Pawn/Manager/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
// Legacy commands.
if (cmd == "loadfs")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: loadfs fileName");
return true;
}
if (!Load("filterscripts/" + args))
{
console->sendMessage(sender, "Filterscript '" + args + "' load failed.");
Expand All @@ -104,6 +109,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
}
else if (cmd == "unloadfs")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: unloadfs fileName");
return true;
}
if (!Unload("filterscripts/" + args))
{
console->sendMessage(sender, "Filterscript '" + args + "' unload failed.");
Expand All @@ -116,6 +126,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
}
else if (cmd == "reloadfs")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: reloadfs fileName");
return true;
}
if (!Reload("filterscripts/" + args))
{
console->sendMessage(sender, "Filterscript '" + args + "' reload failed.");
Expand All @@ -137,6 +152,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
{
return true;
}
if(args.empty())
{
console->sendMessage(sender, "Usage: changemode fileName");
return true;
}
if (Changemode("gamemodes/" + args))
{
gamemodeRepeat_ = 1;
Expand All @@ -146,6 +166,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
// New commands.
else if (cmd == "loadscript")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: loadscript fileName");
return true;
}
if (!Load(args))
{
console->sendMessage(sender, "Script '" + args + "' load failed.");
Expand All @@ -158,6 +183,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
}
else if (cmd == "unloadscript")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: unloadscript fileName");
return true;
}
if (!Unload(args))
{
console->sendMessage(sender, "Script '" + args + "' unload failed.");
Expand All @@ -170,6 +200,11 @@ bool PawnManager::OnServerCommand(const ConsoleCommandSenderData& sender, std::s
}
else if (cmd == "reloadscript")
{
if(args.empty())
{
console->sendMessage(sender, "Usage: reloadscript fileName");
return true;
}
if (!Reload(args))
{
console->sendMessage(sender, "Script '" + args + "' reload failed.");
Expand Down
Loading