Raised This Month: $ Target: $400
 0% 

Entity bounce


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Spriite
Member
Join Date: Aug 2010
Old 10-04-2011 , 15:26   Re: Entity bounce
Reply With Quote #10

Ok, here is my code:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
 
new ent_name[] = "new_ent";
 
public 
plugin_init()
{
 
register_clcmd("create""create");
 
 
RegisterHam(Ham_Touch"player""ent_touch");
 
//register_touch(ent_name, "player", "ent_touch")
}
 
public 
plugin_precache()
 
precache_model("some model.mdl");
 
public 
create(id)
{
 new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString,"info_target"));
 new 
Float:StartOrigin[3], Float:Angle[3];
 
 
pev(idpev_originStartOrigin);
 
pev(idpev_anglesAngle);
 
 
set_pev(entpev_classnameent_name);
 
set_pev(entpev_mins, {-1.0, -1.0, -1.0});
 
set_pev(entpev_maxs, {1.01.01.0});
 
//set_pev(entid, pev_gravity, 0.0)     
 //set_pev(entid, pev_movetype, MOVETYPE_BOUNCE)
 
set_pev(entpev_movetypeMOVETYPE_BOUNCEMISSILE);
 
set_pev(entpev_solidSOLID_BBOX);
 
set_pev(entpev_ownerid);
 
engfunc(EngFunc_SetOriginentStartOrigin);
 
engfunc(EngFunc_SetModelent"some model.mdl");
 
 new 
Float:nVelocity[3];
 
velocity_by_aim(id10nVelocity); 
 
set_pev(entpev_velocitynVelocity);
}
 
public 
ent_touch(playerent)
{
 if(!
pev_valid(ent) || !pev_valid(player))
  return 
HAM_IGNORED;
 
 new 
ent_class[33];
 
pev(entpev_classname,  ent_class32)
 
 if(
equali(ent_classent_name))
  
client_print(0print_chat"Someone touches my entity")
 return 
HAM_IGNORED

What's wrong?

Last edited by Spriite; 10-04-2011 at 16:02.
Spriite is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:42.


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