View Single Post
Author Message
gameplayonline
Member
Join Date: Jun 2017
Old 06-20-2018 , 07:08   Money per kill adjust?
Reply With Quote #1

Hello im doign VIP plugin.
I have this code:
Code:
	/* Plugin generated by AMXX-Studio */


#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN " VIP"
#define VERSION "1.0"
#define AUTHOR "felippeao"

new kill_bonus, hs_bonus;
new maxplayers;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	kill_bonus = register_cvar("money_kill_bonus","450")
	hs_bonus = register_cvar("money_hs_bonus","500")
	register_event("DeathMsg","death_msg","a")	
	// Add your code here...
}

public death_msg()
{
	
	new attacker = read_data( 1 )
	new headshot = read_data(3)
	
	if (get_user_flags(attacker) & ADMIN_LEVEL_H & read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) 
	{
		new money = read_data(2)
		if(headshot)
		{
			money += get_pcvar_num(hs_bonus)
			cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
			client_print(read_data(1), print_chat, "[VIP] %d got %d money for kill",read_data(1), get_pcvar_num(hs_bonus))
		}
		else 
		{
			cs_set_user_money(attacker,cs_get_user_money(attacker) + get_pcvar_num(kill_bonus))
			client_print(read_data(1), print_chat, "[VIP] %d got %d money for kill",read_data(1), get_pcvar_num(kill_bonus))
		}
	}
}
	}
Im getting sometimes 802$ per kill... Why? Normal is 300 and my cvar is 450 bonus i think it must be 750 but im getting 802

Last edited by gameplayonline; 06-20-2018 at 07:16.
gameplayonline is offline