AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How add a bouncing effect (https://forums.alliedmods.net/showthread.php?t=210330)

Netsys 03-09-2013 10:26

How add a bouncing effect
 
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" );
    
RegisterHamHam_Killed "player" "fw_PlayerKilled" );
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    
create_coin(victim);
}

stock create_coinvictim )
{
    static 
Float:fOrigin[3];
    
entity_get_vectorvictim 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_originentity fOrigin );
    
entity_set_modelentity model_coin );
    
    
entity_set_intentity EV_INT_solid SOLID_TRIGGER );
    
entity_set_intentity EV_INT_movetype MOVETYPE_NONE );
    
entity_set_floatentity EV_FL_framerate 1.0 );
    
entity_set_intentity EV_INT_sequence );
    
    
entity_set_sizeentity Float:{ -10.0, -10.0, -10.0 }, Float:{ 10.010.010.0 } );
    
drop_to_floorentity );



hleV 03-09-2013 12:03

Re: How add a bouncing effect
 
Try changing MOVETYPE_NONE to MOVETYPE_BOUNCE and commenting out drop_to_floor( entity );.


All times are GMT -4. The time now is 21:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.