well, my pie doesn't give me health
someone could check my code?
(pie in spanish is pastel)
PHP Code:
new PieModel[] = "models/pastel.mdl"
public plugin_precache()
{
precache_model(PieModel)
}
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "PieAppears", 1 )
register_touch( "Pie", "player", "PieTouch" )
}
public PieAppears( Victim, Attacker, ShouldGib )
{
new Float:Origin[3]
new Float:Velocidad[3]
new Entidad = create_entity( "info_target" )
new Team = get_user_team( Victim )
entity_get_vector( Victim, EV_VEC_origin, Origin )
entity_set_string( Entidad, EV_SZ_classname, "Pie" )
entity_set_model( Entidad, PieModel )
entity_set_edict( Entidad, EV_ENT_owner, Victim )
entity_set_int( Entidad, EV_INT_iuser1, Team )
entity_set_int( Entidad, EV_INT_iuser2, Victim )
entity_set_size( Entidad, Float:{ -10.0, -10.0, -0.0 }, Float:{ 10.0, 10.0, 0.0 } )
entity_set_origin( Entidad, Origin )
entity_set_int( Entidad, EV_INT_solid, SOLID_TRIGGER )
entity_get_vector( Victim, EV_VEC_velocity, Velocidad )
entity_set_vector( Entidad, EV_VEC_velocity, Velocidad )
entity_set_float( Entidad, EV_FL_nextthink, get_gametime( ) + 1.0 )
return HAM_HANDLED
}
public PieTouch(id, entidad)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
new Entidad = create_entity("info_target")
if( entity_get_edict(Entidad, EV_ENT_owner))
return PLUGIN_HANDLED
set_user_health(id, 100)
return PLUGIN_HANDLED
}