Raised This Month: $ Target: $400
 0% 

Args and stuff


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-22-2006 , 19:27  
Reply With Quote #3

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.

Code:
cash[id] -= money;

EDIT: You also forgot to check if the person has enough money to give.

Code:
money = clamp(money,1,cs_get_user_money(id))
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode