Thread: Money Give
View Single Post
tomy91
Member
Join Date: Jun 2006
Location: Latvia
Old 07-15-2006 , 08:46   Re: Money Give
Reply With Quote #19

Nice plugin, but I'd like this plugin a little bit different, because I don't like that there are huds... I like, that someone looks at this topic http://forums.alliedmods.net/showthread.php?t=15379 and changes this script a little bit, because it's older than 1 year and it doesn't compiles right on amxx 1.75:
PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 

   
new amount[] = cs_get_user_money(id
   new 
balance[] = amount str_to_num(arg2)
   new 
target_balance[] = amount str_to_num(arg2)

public 
plugin_init() { 
    
register_plugin("Money Giver""1.0" "VanillA Ice"
    
register_clcmd("say /give","money_give",0,"<name><money> - give money to a player"
    
set_task(200.0"Notify""0""b")


public 
money_give(id) {          
    
 new 
arg1[33],arg2[33],name[33],aname[33
    
read_argv(2,arg1,31
    
read_argv(3,arg2,31
      
    new 
target cmd_target(id,arg1,1
    
get_user_name(target,name,32
    
get_user_name(id,aname,32
     
if (
amount <= str_to_num(arg2) ) 
     { 
        
    
client_print(idprint_chat"[AMXX] You cant give more than you have or else you will go bankrupt! Maybe you should not be THAT generous, huh?" )
  return 
PLUGIN_HANDLED 
             


 
//***************
//-------------------------------------
//****************
  

if (amount >= arg2


   
cs_set_user_money(idbalance1)
   
cs_set_user_money(targettarget_balance1)
    
client_print(0print_chat"[AMXX] %s gave %s %d dollars, how kind of him!",aname,name,arg2

    
client_print(idprint_chat"[AMXX] You have %s %d dollars!"namearg2)

    
client_print(targetprint_chat"[AMXX] %s was kind enough to give you %d dollars! Go give him a big hug!",anamearg2)

   } 
    return 
PLUGIN_HANDLED 


public 
Notify(id){

client_print(0print_chat"[AMXX] Be generous today and makes someone's day, say /give <amount> to give money to a person!")
 } 
__________________

Last edited by tomy91; 07-15-2006 at 08:48.
tomy91 is offline
Send a message via Skype™ to tomy91