Skip to content

Commit

Permalink
Extend return values for some natives
Browse files Browse the repository at this point in the history
  • Loading branch information
NexiusTailer authored Oct 9, 2024
1 parent 201ff28 commit e798980
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Server/Components/Pawn/Scripting/Core/Natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ SCRIPT_API(BlockIpAddress, bool(std::string const& ipAddress, int timeMS))

SCRIPT_API(UnBlockIpAddress, bool(std::string const& ipAddress))
{
if (ipAddress.empty())
{
return false;
}
BanEntry entry(ipAddress);
for (INetwork* network : PawnManager::Get()->core->getNetworks())
{
Expand Down Expand Up @@ -698,6 +702,10 @@ SCRIPT_API(SendRconCommand, bool(cell const* format))
if (console)
{
AmxStringFormatter command(format, GetAMX(), GetParams(), 1);
if (command.empty())
{
return false;
}
console->send(command);
}
return true;
Expand All @@ -709,6 +717,10 @@ SCRIPT_API(SendRconCommandf, bool(cell const* format))
if (console)
{
AmxStringFormatter command(format, GetAMX(), GetParams(), 1);
if (command.empty())
{
return false;
}
console->send(command);
}
return true;
Expand All @@ -723,6 +735,10 @@ SCRIPT_API(SetDeathDropAmount, bool(int amount))
SCRIPT_API(SetGameModeText, bool(cell const* format))
{
AmxStringFormatter string(format, GetAMX(), GetParams(), 1);
if (string.empty())
{
return false;
}
PawnManager::Get()->core->setData(SettableCoreDataType::ModeText, string);
return true;
}
Expand Down

0 comments on commit e798980

Please sign in to comment.