Raised This Month: $51 Target: $400
 12% 

Create physics object like grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 09-29-2013 , 13:14   Create physics object like grenade
Reply With Quote #1

Maybe this question has already been asked (sorry for that), but I don not know how it is called.
How I can create physics (point sized) object with model? Like grenades (or gibs by func_breakable).
Any examples, or plugins with this?
Phant is offline
Send a message via ICQ to Phant
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 09-30-2013 , 05:00   Re: Create physics object like grenade
Reply With Quote #2

So, I have this code:
Code:
#include <amxmodx>
#include <engine>
 
#define PLUGIN "Ball"
#define VERSION "1.0"
#define AUTHOR "Phantomas"

#define MODEL "models/chick.mdl"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION,  AUTHOR)
    register_concmd("ball", "cmdBall", ADMIN_RCON)
}

public plugin_precache()
{
    precache_model(MODEL)
}

public cmdBall(id)
{
    new ent = create_entity("info_target")
    //new origin[3]
    //get_user_origin(id, origin, 0)
    entity_set_origin(ent, {-707.0, -1412.0, -118.0})
    //entity_set_origin(ent, origin)
    entity_set_model(ent, MODEL)
    entity_set_int(ent, EV_INT_solid, 1)
    entity_set_size(ent, Float:{-16.0, -16.0, -16.0}, Float:{16.0, 16.0, 16.0})
    entity_set_int(ent, EV_INT_movetype, MOVETYPE_BOUNCE)
    entity_set_float(ent, EV_FL_friction, 0.5)
    entity_set_float(ent, EV_FL_flFallVelocity, 0.0)
}
But, physics not like grenade. What values need to be changed?

Last edited by Phant; 09-30-2013 at 05:00.
Phant is offline
Send a message via ICQ to Phant
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 09-30-2013 , 05:13   Re: Create physics object like grenade
Reply With Quote #3

Set MOVETYPE_TOSS and gravity to 0.5.
__________________
<VeCo> is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 09-30-2013 , 08:06   Re: Create physics object like grenade
Reply With Quote #4

Now chicken just fall down on floor:

Without bouncing down.
Phant is offline
Send a message via ICQ to Phant
Reply



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 15:48.


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