Hi! This time i want to help block c4, HEGRANADE, FLASHBANG and SMOKEGRANADE!
I have this code that is a simple deathmatch as i can block the c4 the hegranade,flashbang and smokegranade?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#define MONEYGIVEN 16000
public plugin_init()
{
register_plugin("DeathMatch","1.0","Dicope")
register_event("DeathMsg","death","a")
register_cvar("dm_enabled","0")
register_cvar("dm_protection","1")
register_cvar("dm_killbonus","0")
register_cvar("dm_killbonus_amount","0")
register_cvar("dm_protection_time","3")
RegisterHam( Ham_Spawn, "player", "HAM_Spawn_Post", 1 )
}
public death()
{
if (get_cvar_num("dm_enabled")==1)
{
new dead = read_data(2)
set_task(0.1,"live",dead)
new murderer = read_data(1)
if (get_cvar_num("dm_killbonus")==1 && murderer!=dead)
{
new money = cs_get_user_money(murderer)
new money2 = money + get_cvar_num("dm_killbonus_amount")
cs_set_user_money(murderer,money2,1)
if (money2 >= 0)
{
money2 = money2 - 0
cs_set_user_money(murderer,money2,0)
} else {
cs_set_user_money(murderer,0,0)
}
}
}
}
public live(dead)
{
spawn(dead)
if (get_cvar_num("dm_protection")==1)
{
set_user_godmode(dead,1)
new Float:protect = get_cvar_float("dm_protection_time")
set_task(protect,"stopprotect",dead)
}
if (get_user_team(dead)==1)
{
give_item(dead,"weapon_knife")
give_item(dead,"weapon_glock18")
give_item(dead,"ammo_9mm")
give_item(dead,"ammo_9mm")
}
else
{
give_item(dead,"weapon_knife")
give_item(dead,"weapon_usp")
give_item(dead,"ammo_45acp")
give_item(dead,"ammo_45acp")
}
}
public stopprotect(dead)
{
set_user_godmode(dead)
}
public HAM_Spawn_Post( id )
{
if( is_user_alive( id ) )
cs_set_user_money( id, 16000 )
}