Thread: Donate Money
View Single Post
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-08-2021 , 11:26   Re: Donate Money
Reply With Quote #6

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(1szMoneycharsmax(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.
__________________

Last edited by Napoleon_be; 03-08-2021 at 11:28.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be