Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/scripting/sourceirc-sourcepunish.sp b/scripting/sourceirc-sourcepunish.sp
- index e5a47f2..db8523e 100644
- --- a/scripting/sourceirc-sourcepunish.sp
- +++ b/scripting/sourceirc-sourcepunish.sp
- @@ -85,6 +85,15 @@ public PunishmentPluginUnloaded() {
- ProcessRegisteredPunishments();
- }
- +stock IsStringNumeric(const String:StringToCheck[]) {
- + for (new i = 0; i < strlen(StringToCheck); i++) {
- + if (!IsCharNumeric(StringToCheck[i])) {
- + return false;
- + }
- + }
- + return true;
- +}
- +
- public Action:IRCCommand_Punish(String:nick[], args) {
- decl String:command[70], String:twoChars[3], String:threeChars[4];
- IRC_GetCmdArg(0, command, sizeof(command));
- @@ -149,6 +158,10 @@ public Action:IRCCommand_Punish(String:nick[], args) {
- new posAfterTime = -1;
- if (reasonArgumentNum == 3 && pos != -1) {
- posAfterTime = BreakString(fullArgString[pos], time, sizeof(time));
- + if (!IsStringNumeric(time)) {
- + IRC_ReplyToCommand(nick, "Given time must be numeric.");
- + return Plugin_Handled;
- + }
- } else {
- strcopy(time, sizeof(time), "0");
- }
- diff --git a/scripting/sourcepunish.sp b/scripting/sourcepunish.sp
- index 4fc8595..b3f9dba 100644
- --- a/scripting/sourcepunish.sp
- +++ b/scripting/sourcepunish.sp
- @@ -215,6 +215,15 @@ public ActivePunishmentsLookupComplete(Handle:owner, Handle:query, const String:
- }
- }
- +stock IsStringNumeric(const String:StringToCheck[]) {
- + for (new i = 0; i < strlen(StringToCheck); i++) {
- + if (!IsCharNumeric(StringToCheck[i])) {
- + return false;
- + }
- + }
- + return true;
- +}
- +
- public Action:Command_Punish(client, args) {
- decl String:command[70], String:twoChars[3], String:threeChars[4];
- GetCmdArg(0, command, sizeof(command));
- @@ -280,6 +289,10 @@ public Action:Command_Punish(client, args) {
- new posAfterTime = -1;
- if (reasonArgumentNum == 3 && pos != -1) {
- posAfterTime = BreakString(fullArgString[pos], time, sizeof(time));
- + if (!IsStringNumeric(time)) {
- + ReplyToCommand(client, "Given time must be numeric.");
- + return Plugin_Handled;
- + }
- } else {
- strcopy(time, sizeof(time), "0");
- }
Advertisement
Add Comment
Please, Sign In to add comment