Skip to content

Commit ebc29fd

Browse files
author
Dutchman101
committed
Addendum #3 to cd9154a
1 parent 0abcfd8 commit ebc29fd

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

[gameplay]/freeroam/fr_client.lua

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function addWeapon(leaf, amount)
315315
return
316316
end
317317
end
318-
if amount < 1 or amount > 999999999 or string.len(amount) > 10 then
318+
if amount < 1 or amount > 999999999 then
319319
errMsg("Invalid amount!")
320320
return
321321
end
@@ -386,20 +386,19 @@ addCommandHandler('wp', giveWeaponCommand)
386386
-- Fighting style
387387
---------------------------
388388

389-
addCommandHandler('setstyle',
389+
addCommandHandler("setstyle",
390390
function(cmd, style)
391-
style = style and tonumber(style) or 6
391+
style = style and tonumber(style) or 5
392392

393-
if not style then return end
394-
395-
if string.len(style) > 2 or style < 0 or style > 16 then
396-
return errMsg("Invalid style ID!")
393+
if getPedFightingStyle(localPlayer) == style then
394+
return
397395
end
398396

399-
if getPedFightingStyle(localPlayer) == style then return end
400-
401397
if allowedStyles[style] then
402398
server.setPedFightingStyle(localPlayer, style)
399+
else
400+
errMsg("Invalid style ID!")
401+
return
403402
end
404403
end
405404
)
@@ -2126,12 +2125,10 @@ end
21262125

21272126
function alphaCommand(command, alpha)
21282127
alpha = alpha and tonumber(alpha) or 255
2129-
if alpha and string.len(alpha) > 3 then
2130-
errMsg("Invalid input!")
2131-
return
2132-
end
21332128
if alpha >= 0 and alpha <= 255 then
21342129
server.setElementAlpha(localPlayer, alpha)
2130+
else
2131+
errMsg("Invalid alpha value! (range: 0 - 255)")
21352132
end
21362133
end
21372134
addCommandHandler('alpha', alphaCommand)

0 commit comments

Comments
 (0)