Raised This Month: $32 Target: $400
 8% 

Spawning a smoke cloud in the map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 11-22-2022 , 06:08   Spawning a smoke cloud in the map
Reply With Quote #1

I'm not sure how this works so an explanation along with an example would be great.
I figured I needed an entity to spawn the cloud, but I'm not sure which entity is invisible and does not clip the player.

PHP Code:
new Float:g_origin[3] = {1247.9687502560.031250132.031250}
new 
Float:g_angle[3] = {0.00.00.0};
new 
iEntity create_entity("info_target");
engfunc(EngFunc_PlaybackEvent0iEntity260.0 g_origing_angle0.00.00100); 
Thanks!
GoldNux is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 11-22-2022 , 08:58   Re: Spawning a smoke cloud in the map
Reply With Quote #2

Quote:
Originally Posted by GoldNux View Post
... but I'm not sure which entity is invisible and does not clip the player
upd2: I just copied what you posted, sorry

I'm a lamer in theme of entities but info_target is what you need: it is invisible and is not solid

upd: this seems to work
PHP Code:
// summon smoke at player position
public ClCmd_test(id)
{
    new 
iEntity create_entity("info_target");
    if( 
iEntity ) {
        new 
float:fOrigin[3];
        
pev(idpev_originfOrigin);
        
engfunc(EngFunc_PlaybackEventFEV_GLOBALiEntity260.0 fOrigin, {0.00.00.0}, 0.00.00100);
        
remove_entity(iEntity);
    }
}

// summon smoke at desired position
public ClCmd_test2(id)
{
    new 
iEntity create_entity("info_target");
    if( 
iEntity ) {
        
engfunc(EngFunc_PlaybackEventFEV_GLOBALiEntity260.0 , {1247.9687502560.031250132.031250}, {0.00.00.0}, 0.00.00100);
        
remove_entity(iEntity);
    }

__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 11-22-2022 at 09:54.
kww is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 11-22-2022 , 14:40   Re: Spawning a smoke cloud in the map
Reply With Quote #3

Quote:
Originally Posted by kww View Post
upd2: I just copied what you posted, sorry

I'm a lamer in theme of entities but info_target is what you need: it is invisible and is not solid

upd: this seems to work
PHP Code:
// summon smoke at player position
public ClCmd_test(id)
{... 
Wow thanks! This is so much fun.
One question, can I emit sound from the entity?

I tried to look at it but I'm not sure how to find the entity index.
GoldNux is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 11-23-2022 , 08:52   Re: Spawning a smoke cloud in the map
Reply With Quote #4

Quote:
Originally Posted by GoldNux View Post
Wow thanks! This is so much fun.
One question, can I emit sound from the entity?
Sure.

Upd: example below should work in theory but is not working for me xd

Quote:
Originally Posted by GoldNux View Post
I tried to look at it but I'm not sure how to find the entity index.
Entity index is the index of that info_target
E.g.:
PHP Code:
public plugin_precache()
{
    
precache_sound("weapons/sg_explode.wav");
}

if(
placeSmoke)
{
    new 
iEntity create_entity("info_target");
    if(
iEntity)
    {
        
entity_set_origin(iEntityorigin1);
        
emit_sound(iEntity CHAN_WEAPON"weapons/sg_explode.wav"VOL_NORMATTN_NORM0PITCH_NORM);
        
engfunc(EngFunc_PlaybackEventFEV_GLOBALiEntity260.0 origin1, {0.00.00.0}, 0.00.00100);
        
        
entity_set_origin(iEntityorigin2);
        
emit_sound(iEntity CHAN_WEAPON"weapons/sg_explode.wav"VOL_NORMATTN_NORM0PITCH_NORM);
        
engfunc(EngFunc_PlaybackEventFEV_GLOBALiEntity260.0 origin2, {0.00.00.0}, 0.00.00100);
        
        
remove_entity(iEntity);
    }

__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 11-23-2022 at 10:04.
kww 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 10:09.


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