Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Explode entity ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-04-2017 , 02:37   Re: [ H3LP ] Explode entity ?
Reply With Quote #1

Quote:
Originally Posted by CrazY. View Post
Hey AlliedModders, currently I am developing a simple spawn model effect. Crazy? about what you are talkig (what the hell are this) ? Well, when a player spawn, a egg model is added into the player origin. I want explode this egg, but the egg model dont have a explode animation, then I used the following code to do that, but dont work well. Any idea?

Code:
public fw_PlayerSpawn_Post(id) {     if (!is_user_alive(id) || !cs_get_user_team(id))         return;             new entity = create_entity("info_target");         if (!pev_valid(entity))         return;             new Float:origin[3];     entity_get_vector(id, EV_VEC_origin, origin);         set_pev(entity, pev_body, 1);     entity_set_model(entity, EGG_MODEL);         origin[2] -= 25;     entity_set_origin(entity, origin);         set_pev(entity, pev_owner, id);     entity_set_string(entity, EV_SZ_classname, "egg_class");     entity_set_int(entity, EV_INT_solid, 2);         if (get_cvar_num("mp_freezetime") <= 0)         explode_egg(id); } public explode_egg(id) {     if (!is_user_connected(id))         return;             new entity = find_ent_by_owner(0, "egg_class", id);         // I dont know exactly if this is correct.     set_pev(entity, pev_framerate, 1.0);         //remove_entity(entity); }
When using find_ent_by_x the starting index has to be -1 not 0.

Code:
find_ent_by_owner(0, "egg_class", id);

-->

Code:
find_ent_by_owner(-1, "egg_class", id);
__________________
edon1337 is offline
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 17:51.


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