Napoleon_be |
03-08-2021 11:26 |
Re: Donate Money
I'd recommend using read_argv() instead of read_args() in this case.
Use str_to_num instead of checking is_str_num and store it in a variable. Check if it's valid.
Also, i'd just keep it simple and just use 1 function instead of creating a new one, CmdHandler1 is really unnessecary.
here's some code i'd use in this case:
PHP Code:
new szMoney[6]; read_argv(1, szMoney, charsmax(szMoney));
new iMoney = str_to_num(szMoney);
if(iMoney) { // Valid value passed. }
And to be honest, just read and write more to learn, logical thinking will get you far.
|