How I can add to the gold coin as a bouncing effect. Like the game of sonic when to lose rings.
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
new model_coin[] = "models/coin.mdl"
public plugin_precache()
precache_model(model_coin);
public plugin_init()
{
register_plugin( "asd" , "asd" , "asd2" );
RegisterHam( Ham_Killed , "player" , "fw_PlayerKilled" );
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
create_coin(victim);
}
stock create_coin( victim )
{
static Float:fOrigin[3];
entity_get_vector( victim , EV_VEC_origin , fOrigin );
fOrigin[2] -= 15.0;
new entity = create_entity( "info_target" );
if(!is_valid_ent(entity))
{
remove_entity(entity);
return;
}
entity_set_origin( entity , fOrigin );
entity_set_model( entity , model_coin );
entity_set_int( entity , EV_INT_solid , SOLID_TRIGGER );
entity_set_int( entity , EV_INT_movetype , MOVETYPE_NONE );
entity_set_float( entity , EV_FL_framerate , 1.0 );
entity_set_int( entity , EV_INT_sequence , 1 );
entity_set_size( entity , Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.0, 10.0, 10.0 } );
drop_to_floor( entity );
}