Code:
/*
Money Refill Script
Player just has to type amx_givemoney and the script should change their total to $16000
Script by Duo/Addict
Verson 0.1
First verson, a few warnings but nothing that really effects the script
*/
#include <amxmodx>
#include <cstrike>
new user[32]
new personid
new bool:MoneyEnabled = true
public plugin_init() { // This will start the plugin
register_plugin("Givemoney", ".01", "Duo/Addict") // Tells server the command exists
register_concmd("amx_givemoney","give_cash",-1,"Gives $16000 to the person") // Registers the command with AMX
register_concmd("amx_takemoney","take_cash",ADMIN_KICK,"Gives this person $800")
register_concmd("amx_moneyrefill","money_toggle",ADMIN_KICK,"Turns money on and off")
register_concmd("say /givemoney","give_cash",-1,"Gives $16000 to the person") // Registers the command with and
register_concmd("say /takemoney","take_cash",-1,"Gives this person $800") // Makes it work with say
register_concmd("amx_moneyrefill", "money_toggle",ADMIN_KICK,"Enables Script")
}
public money_toggle(id) {
if (MoneyEnabled == true) {
MoneyEnabled = false
console_print(id,"Money Refill has been turned off")
client_cmd(id,"echo The Bank is Closed, no more money free money :( ")
return PLUGIN_HANDLED
}
if (MoneyEnabled == false) {
MoneyEnabled = true
console_print(id,"The bank is open, money for all")
return PLUGIN_HANDLED
client_cmd(id,"echo The Bank is Open for Biz, type amx_givemoney (name) in console to get $16000")
}
}
public give_cash(id) { //Decalre public function
if (MoneyEnabled == false) {
console_print(id, "The Money Refill isnt turned on, type amx_moneyrefill to toggle on and off")
return PLUGIN_HANDLED
}
if(read_argc() == 0) { // Reads arguments
console_print(id,"You must give me a user to give money to")
return PLUGIN_HANDLED
}
read_argv(1,user,32) // First argument, insert to variable, max length
personid = find_player("bh",user)
if (personid == 0) {
console_print(id,"Person dosnt exist ")
return PLUGIN_HANDLED
}
cs_set_user_money (id , 16000,1 )
console_print(id,"You now have more money, you owe me dude")
client_cmd(personid, "say I just got $16000 so i could by another AWP!")
return PLUGIN_HANDLED
}
// This part takes the cash down to $0
public take_cash(id) {
if (MoneyEnabled == false) {
console_print(id, "The Money Refill isnt turned on, type amx_moneyrefill to toggle on and off")
return PLUGIN_HANDLED
}
if(read_argc() == 0) {
console_print(id,"You must give me a user to give money to")
return PLUGIN_HANDLED
}
read_argv(1,user,32)
personid = find_player("bh",user)
if (personid == 0) {
console_print(id,"Person dosnt exist ")
return PLUGIN_HANDLED
}
cs_set_user_money (id , 0,1 )
console_print(id,"Some one haxored your bank account and took your money")
client_cmd(personid, "say I just donated all my money to Jesus!")
return PLUGIN_HANDLED
}