Hello, I use this code and I would like that when someone touches the entity it dies, but the frag is added to the person who created the entity
At the moment I can only make them die when they touch the entity, but I would like the frag to be added to whoever created the entity
PHP Code:
//----------------------------------------------------------------------------------------------
public pfn_touch(ptr, ptd)
{
if(!is_valid_ent(ptd) || !is_valid_ent(ptr))
return PLUGIN_CONTINUE
if(!is_user_connected(ptd) || !is_user_alive(ptd))
return PLUGIN_CONTINUE
new 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
new gOrigHealth = get_user_health(ptd)
new health = gOrigHealth - gOrigHealth
set_user_health(ptd, health)
remove_entity(ptr)
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------