PHP Code:
//----------------------------------------------------------------------------------------------
public pfn_touch(ptr, ptd)
{
if(!is_valid_ent(ptr) || !is_user_alive(ptd))
return
static classname[32];
entity_get_string(ptr, EV_SZ_classname, classname, 31)
if(equal(classname, "coronavirus")) {
// This is to make the one who touches the entity die
set_user_health(ptd, -1);
entity_set_int(ptd, EV_INT_deadflag, DEAD_DYING);
static iOwner;
iOwner = entity_get_edict(ptr, EV_ENT_owner);
if(is_user_connected(iOwner))
{
set_user_frags(iOwner, get_user_frags(iOwner) + 1);
static pUserMsgDeathMSG = 0; if(!pUserMsgDeathMSG) pUserMsgDeathMSG = get_user_msgid("DeathMsg");
message_begin(MSG_ALL, pUserMsgDeathMSG, _, 0);
write_byte(iOwner);
write_byte(ptd);
write_byte(0);
write_string("coronavirus");
message_end();
}
remove_entity(ptr);
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
__________________