@@ -315,7 +315,7 @@ function addWeapon(leaf, amount)
315
315
return
316
316
end
317
317
end
318
- if amount < 1 or amount > 999999999 or string.len ( amount ) > 10 then
318
+ if amount < 1 or amount > 999999999 then
319
319
errMsg (" Invalid amount!" )
320
320
return
321
321
end
@@ -386,20 +386,19 @@ addCommandHandler('wp', giveWeaponCommand)
386
386
-- Fighting style
387
387
---- -----------------------
388
388
389
- addCommandHandler (' setstyle' ,
389
+ addCommandHandler (" setstyle" ,
390
390
function (cmd , style )
391
- style = style and tonumber (style ) or 6
391
+ style = style and tonumber (style ) or 5
392
392
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
397
395
end
398
396
399
- if getPedFightingStyle (localPlayer ) == style then return end
400
-
401
397
if allowedStyles [style ] then
402
398
server .setPedFightingStyle (localPlayer , style )
399
+ else
400
+ errMsg (" Invalid style ID!" )
401
+ return
403
402
end
404
403
end
405
404
)
@@ -2126,12 +2125,10 @@ end
2126
2125
2127
2126
function alphaCommand (command , alpha )
2128
2127
alpha = alpha and tonumber (alpha ) or 255
2129
- if alpha and string.len (alpha ) > 3 then
2130
- errMsg (" Invalid input!" )
2131
- return
2132
- end
2133
2128
if alpha >= 0 and alpha <= 255 then
2134
2129
server .setElementAlpha (localPlayer , alpha )
2130
+ else
2131
+ errMsg (" Invalid alpha value! (range: 0 - 255)" )
2135
2132
end
2136
2133
end
2137
2134
addCommandHandler (' alpha' , alphaCommand )
0 commit comments