How can i make it pickable with e && pressing e again you kick it away
HELP!
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <xs>
#define PLUGIN "Ball"
#define VERSION "1.0"
#define AUTHOR "{PHILMAGROIN}"
new aimVector[3];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_touch( "Ball", "*", "EntityOnTouch" );
register_concmd( "amx_ball", "Ball_Me", ADMIN_ADMIN );
register_touch("Ball", "player", "PlayerOnTouch");
}
public plugin_precache()
{
precache_model("models/newball.mdl");
}
public Ball_Me (id)
{
new MyEntity = create_entity( "info_target" );
new Float:fOrigin[3];
{
entity_set_model( MyEntity, "models/newball.mdl");
get_user_origin(id, aimVector, 3);
IVecFVec(aimVector, fOrigin);
{
set_pev( MyEntity, pev_classname, "Ball" );
set_pev( MyEntity, pev_movetype , MOVETYPE_BOUNCE );
set_pev( MyEntity, pev_solid , SOLID_BBOX );
set_pev( MyEntity, pev_gravity , 0.50 );
set_pev( MyEntity, pev_origin, fOrigin );
set_pev( MyEntity, pev_size, 50.0, 50.0, 50.0);
}
}
}
public EntityOnTouch ( const nEntity )
{
static Float:Velocity[3];
{
pev( nEntity, pev_velocity, Velocity );
xs_vec_mul_scalar( Velocity, 0.85, Velocity );
set_pev( nEntity, pev_velocity, Velocity );
}
}
public PlayerOnTouch ( const Entity, id )
{
new Float:sVelocity[3];
{
velocity_by_aim( id, 480, sVelocity );
entity_set_vector( Entity, EV_VEC_velocity, sVelocity );
}
}