Skip to content

Commit

Permalink
Fix for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
actuallykane committed Jan 12, 2019
1 parent 00f1064 commit 2314bb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ AddEventHandler('chatMessage', function(source, n, message)
CancelEvent()
if(command.perm > 0)then
if(IsPlayerAceAllowed(Source, "command." .. command_args[1]) or Users[source].getPermissions() >= command.perm or groups[Users[source].getGroup()]:canTarget(command.group))then
table.remove(command_args, 1)
if (not (command.arguments == #command_args - 1) and command.arguments > -1) then
TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])
else
Expand All @@ -197,6 +198,7 @@ AddEventHandler('chatMessage', function(source, n, message)
debugMsg("Non admin (" .. GetPlayerName(Source) .. ") attempted to run admin command: " .. command_args[1])
end
else
table.remove(command_args, 1)
if (not (command.arguments <= (#command_args - 1)) and command.arguments > -1) then
TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])
else
Expand Down

0 comments on commit 2314bb7

Please sign in to comment.