Well, it works, buckshot! And I had some time, made this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Defuse/Plant Bonus"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"
new bool:HasDefuse[33], bool:HasPlant[33]
new cvar_plant
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "new_round", "a", "1=0", "2=0")
register_logevent("defused", 3, "2=Defused_The_Bomb")
register_logevent("planted", 3, "2=Planted_The_Bomb")
cvar_plant = register_cvar("plant_hp_bonus", "0")
}
public defused()
{
new id = get_loguser_index()
HasDefuse[id] = true
ColorMessage(id, "^3You will receive a ^425 HP bonus ^3at the begining of next round for defusing the bomb!")
}
public planted()
{
if(get_pcvar_num(cvar_plant))
{
new id = get_loguser_index()
HasPlant[id] = true
ColorMessage(id, "^3You will receive a ^425 HP bonus ^3at the begining of next round for planting the bomb!")
}
}
public new_round(id)
{
if(HasDefuse[id] == true || HasPlant[id] == true)
set_user_health(id, get_user_health(id) + 25)
}
stock get_loguser_index()
{
new loguser[80], name[32]
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
return get_user_index(name)
}
stock ColorMessage(const id, const input[], any:...){
new count = 1, players[32];
static msg[ 191 ];
vformat(msg, 190, input, 3);
if (id) players[0] = id; else get_players(players , count , "ch"); {
for (new i = 0; i < count; i++){
if (is_user_connected(players[i])){
message_begin(MSG_ONE_UNRELIABLE , get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();}}}
}
Added colormessage and eventually bonus for planting the bomb - turn it on or off with the cvar:
plant_hp_bonus "0/1"
It's turned off by default (as you wish)
__________________