Finally I was able to make it work now it works correctly, thank you very much for the help it really helped me a lot, thank you
I had to change some things in this function and use natives of the superhero include
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")) {
static iOwner;
iOwner = entity_get_edict(ptr, EV_ENT_owner);
if( is_user_connected(iOwner) && is_user_alive(iOwner) ) {
// This is to make the one who touches the entity die
// Make damage to target
new damage = read_data(2)
sh_extra_damage(ptd, iOwner, damage, "Por CoronaVirus", 0, SH_DMG_KILL)
}
remove_entity(ptr);
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------