rn
rnThis plugin does what dod_meleebonus does but also changes the players score after a pcvar set amount of melee kills. The plugin works perfect for me (Linux, 1.19/1.81). I want to share this plugin/update with the community but before I ask Diamond-Optic (it's based on his plugin) to post it, I need to have this fixed...
rn
rnThe problem is this:
rn
rn
client_print(0,print_chat,"[Melee Bonus] %s changed his score (+1 k's, -2d's) with 4 melee kills!",temp_player_name)
rn
rnI know how to change plugins but someone else might not. I've seen in D-O's ejaculate v1.1 he had a pcvar message and I wanted to do the same with this message...but all attempts failed. So perhaps someone could help me?
rn
rnBtw, if you see any other errors or perhaps ways which could work better, please point them out as Im only trying to learn.
rn
rnPs: D-O, you might see some changes in cvar names, these will be changed back when it's done.
rn
rn
#includern#include rn#include rn#include rnrn#define VERSION "1.0"rn#define SVERSION "v1.0 - by diamond-optic (www.AvaMods.com)"rnrnnew killername[32]rnnew player_melee_kills[33][1]rnnew temp_player_name[33]rnrnnew p_enabled, p_givehealth, p_changedeaths, p_changekills, p_amountmeleernrnpublic plugin_init()rn{rn register_plugin("DoD Melee Bonus",VERSION,"AMXX DoD Team")rn register_cvar("dod_meleebonus_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)rn rn p_enabled = register_cvar("activate_plugin","1")rn p_givehealth = register_cvar("meleebonus_hp","25")rn p_changedeaths = register_cvar("melee_deaths","2")rn p_changekills = register_cvar("melee_kills","1")rn p_amountmelee = register_cvar("melee_amount","4")rn}rnrnpublic client_death(killer,victim,wpnindex,hitplace,TA) rn{rn if(get_pcvar_num(p_enabled) && is_user_connected(killer) && is_user_alive(killer) && !TA)rn {rn if(wpnindex == 1 || wpnindex == 2 || wpnindex == 19 || wpnindex == 34 || wpnindex == 37 || wpnindex == 38 || wpnindex == 39 || wpnindex == 41)rn {rn get_user_name(killer,killername,31)rn new addition = get_pcvar_num(p_givehealth)rn rn set_user_health(killer,(get_user_health(killer)+addition))rn rn client_print(0,print_chat,"[Melee Bonus] %s received an additional %dhp for a melee kill!",killername,addition)rn rn set_hudmessage(36,39,192,-1.0,0.9,0,6.0,4.0,0.1,0.2,-1)rn show_hudmessage(killer,"+%dhp",addition)rn rn player_melee_kills[killer][0] = player_melee_kills[killer][0] + 1rn if(player_melee_kills[killer][0] == get_pcvar_num(p_amountmelee))rn {rn dod_set_pl_deaths(killer,dod_get_pl_deaths(killer) - get_pcvar_num(p_changedeaths),1)rn rn if(dod_get_pl_deaths(killer) < 0)rn {rn dod_set_pl_deaths(killer,0,1)rn }rn rn dod_set_user_kills(killer,dod_get_user_kills(killer) + get_pcvar_num(p_changekills),1)rn rn get_user_name(killer,temp_player_name,32)rn client_print(0,print_chat,"[Melee Bonus] %s changed his score (+1 k's, -2d's) with 4 melee kills!",temp_player_name)rn rn player_melee_kills[killer][0] = 0rn }rn }rn }rn return PLUGIN_HANDLEDrn}rnrnpublic client_connect(id)rn{rn player_melee_kills[id][0] = 0rn}

