Hello I want to help here, I want to count the number of dead to him who pressure bomb button when the exchange of fire explosion !
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
//new Float:origin[3] = {-256.0,704.0,-1853.0}
new map_name[25]
new bool:a
new killer
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_touch("*","nuclear_rocket","nuke_touch")
//register_touch("*","nuclear_bomb","bomb_touch")
RegisterHam(Ham_Touch,"trigger_multiple","_trigger_multiple",1)
RegisterHam(Ham_Killed,"player","fw_PlayerKilled")
get_mapname(map_name, sizeof (map_name) - 1)
killer = 0
}
public _trigger_multiple(const iEntity, const id)
{
if(a)
return HAM_IGNORED
new n = find_ent_by_target(-1,"fire_button_texture")
if (iEntity == n ) ////NUKEBUTTON
{
a=true
set_task(42.0,"test")
set_task(60.0,"res")
if(is_user_alive(id))
{
killer=id////
}
}
return HAM_IGNORED
}
public res()
a=false
public test(){
for(new i;i<60;++i){
set_task(random_float(0.0,14.0),"create_nuke")
}
}
public fw_PlayerKilled(id,ent){
if (equali(map_name,"crossfire"))
{
static classname[32]
entity_get_string(ent,EV_SZ_classname,classname,31)
if(!equal(classname,"nuke"))
return HAM_IGNORED
if(is_user_connected(killer))
{
SetHamParamEntity(2,killer)// set killer ID
}
}
return HAM_IGNORED
}
/*public bomb_nuke(touched,ent){
new Float:origin[3]
if(!is_valid_ent(ent))
return
entity_get_vector(ent,EV_VEC_origin,origin)
bomb_nuke (origin)
remove_entity(ent)
}*/
I want to make the death toll to calculate the player who pressed the bomb button