Raised This Month: $52 Target: $400
 13% 

TE_MODEL as entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mixtaz
Junior Member
Join Date: Sep 2017
Old 09-06-2018 , 06:40   TE_MODEL as entity
Reply With Quote #1

I have this simple piece of code

PHP Code:
public chickenthrow(id[])
{            
    if(
is_user_alive(id[0]) && chickens[id[0]] > 0)
    {
        new 
vec[3];
        new 
aimvec[3];
        new 
velocityvec[3];
        new 
length;
        new 
speed 800;
        
get_user_origin(id[0],vec);
        
get_user_origin(id[0],aimvec,2);
    
        
velocityvec[0]=aimvec[0]-vec[0];
        
velocityvec[1]=aimvec[1]-vec[1];
        
velocityvec[2]=aimvec[2]-vec[2];
    
        
length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2]);
    
        
velocityvec[0]=velocityvec[0]*speed/length;
        
velocityvec[1]=velocityvec[1]*speed/length;
        
velocityvec[2]=velocityvec[2]*speed/length;
    
        
// TE_MODEL from HL-SDK common/const.h 
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        
write_byte(106);         // TE_MODEL index
        
write_coord(vec[0]);         // location coords
        
write_coord(vec[1]);
        
write_coord(vec[2]+20);
        
write_coord(velocityvec[0]);     // speed coords - stupid, but thats how its done
        
write_coord(velocityvec[1]);
        
write_coord(velocityvec[2]+100);
        
write_angle (0);         // yaw
        
write_short (mdlChicken);     // model 
        
write_byte (2);             // sound
        
write_byte (255);         // duration 
        
message_end();

    }
        
chickens[id[0]]--

And what I want to do is to make the thrown chickens an entity and make them explode afterwards.

Well most importantly making them an entity, cause I can handle the second task.
Mixtaz is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-06-2018 , 07:05   Re: TE_MODEL as entity
Reply With Quote #2

SVC_TEMPENTITY cannot be converted to actual entity.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
Mixtaz
Junior Member
Join Date: Sep 2017
Old 09-06-2018 , 07:57   Re: TE_MODEL as entity
Reply With Quote #3

That's what I thought. Is there anyway I can work this around and actually use those tempentities for further purposes?

As of now, they just disapear after certain amount of time, what if I want it to do something else with them?
Mixtaz is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-06-2018 , 07:57   Re: TE_MODEL as entity
Reply With Quote #4

His request is achievable by using that message and message explode

It depends on when you want them to be explode.
__________________
@Jailbreak Main Mod v2.6.5 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Last edited by Natsheh; 09-06-2018 at 08:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Mixtaz
Junior Member
Join Date: Sep 2017
Old 09-06-2018 , 10:17   Re: TE_MODEL as entity
Reply With Quote #5

@Natseh - as soon as they hit the ground (in other words when their "ent" is FL_GROUND)
Mixtaz is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-06-2018 , 10:39   Re: TE_MODEL as entity
Reply With Quote #6

Quote:
Originally Posted by Mixtaz View Post
@Natseh - as soon as they hit the ground (in other words when their "ent" is FL_GROUND)
Then you need to create an entity for that.
__________________
@Jailbreak Main Mod v2.6.5 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Mixtaz
Junior Member
Join Date: Sep 2017
Old 09-06-2018 , 11:01   Re: TE_MODEL as entity
Reply With Quote #7

Quote:
Originally Posted by Ghosted View Post
SVC_TEMPENTITY cannot be converted to actual entity.
This was my plan, but according to Ghosted's post it seems to be impossible.
Mixtaz is offline
Reply


Thread Tools
Display Modes

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 04:47.


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