Use GetCmdArgInt(Ex) in base plugins (#1203)

This commit is contained in:
Asher Baker
2020-03-04 22:07:00 +00:00
committed by GitHub
parent 17440fc4be
commit d59edc5d0a
6 changed files with 24 additions and 64 deletions
+1 -3
View File
@@ -237,9 +237,7 @@ public Action Command_Blind(int client, int args)
int amount = 0;
if (args > 1)
{
char arg2[20];
GetCmdArg(2, arg2, sizeof(arg2));
if (StringToIntEx(arg2, amount) == 0)
if (!GetCmdArgIntEx(2, amount))
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
+3 -8
View File
@@ -492,15 +492,10 @@ public Action Command_Freeze(int client, int args)
int seconds = g_Cvar_FreezeDuration.IntValue;
if (args > 1)
if (args > 1 && !GetCmdArgIntEx(2, seconds))
{
char time[20];
GetCmdArg(2, time, sizeof(time));
if (StringToIntEx(time, seconds) == 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
char target_name[MAX_TARGET_LENGTH];