Quote:
|
Originally Posted by v3x
Code:
register_clcmd("amx_cmd" , "my_cmd");
Code:
public my_cmd(id) {
new arg1[33] , arg2[33];
read_argv(1 , arg1 , 32);
read_argv(2 , arg2 , 32);
new player = cmd_target(id , arg1 , 0);
if(!player) return PLUGIN_HANDLED;
new money = str_to_num(arg2);
if(money) {
cash[player] += money;
}
return PLUGIN_HANDLED;
}
|
Wow v3x, you completely forgot to decrease the money from the other person.
EDIT: You also forgot to check if the person has enough money to give.
Code:
money = clamp(money,1,cs_get_user_money(id))
__________________