Quote:
Code:
new arg1[32], arg2[32], name[32], victim[32], target
get_user_name(id, name, 31)
read_argv(1, arg1, 31)
read_argv(2, arg2, 31)
str_to_num(arg2)
target = cmd_target(id, arg1, 2)
get_user_name(target, victim, 31)
coins[target] += floatstr(arg2[31])
|
When you use str_to_num you usually have num = str_to_num.
But you dont us it anyways.
with
"coins[target] += floatstr(arg2[31])" you are starting at the 31st character of the string to get the float which is why its always 0.0000
You have two choices to fix
1) new Add = str_to_num(arg2)
//...
coins[target] += Add
2) remove line str_to_num(arg2)
//...
coins[target] += floatstr(arg2)
[Edit]
Quote:
Code:
server_print( " [COIN MOD] ADMIN %s Added %f coins to player %s!", name, arg2, victim )
|
arg2 is still a string ;p also why it would print 0.0000