Raised This Month: $ Target: $400
 0% 

Smoke puffs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 04-21-2011 , 05:27   Smoke puffs
Reply With Quote #1

How can I make smoke puffs from a player, they repeat and disables on round end ?

PHP Code:
        if((iClass[id] == 3) && (gInfected[id]))
        {
            
set_task(2.0"smoker_puff")
        }


public 
smoker_puff(id)
{
    if(!
is_user_alive(id))
        return;

        new 
Float:fOrigin[3], iOrigin[3
        
entity_get_vectoridEV_VEC_originfOrigin); 
        
    if(
iClass[id] == 3)
    {
            
iOrigin[0] = floatround(fOrigin[0]) 
            
iOrigin[1] = floatround(fOrigin[1]) 
            
iOrigin[2] = floatround(fOrigin[2]) 
                 
            
message_begin(MSG_BROADCAST,SVC_TEMPENTITYiOrigin
            
write_byte(TE_SMOKE
            
engfuncEngFunc_WriteCoord,fOrigin[0]) 
            
engfuncEngFunc_WriteCoord,fOrigin[1]) 
            
engfuncEngFunc_WriteCoord,fOrigin[2]) 
            
write_short(smoker_spr
            
write_byte(35
                
write_byte(20
                
write_byte(0
            
message_end() 
    }
    
set_task(3.0"smoker_puff"TASKID_PUFF id)


Last edited by DoviuX; 04-21-2011 at 05:56.
DoviuX is offline
Send a message via Skype™ to DoviuX
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 04-21-2011 , 10:16   Re: Smoke puffs
Reply With Quote #2

set_task has extra optional arguments. You can have it loop with the flag 'b'.
Here: http://www.amxmodx.org/funcwiki.php?go=func&id=253

Also, I would personally make a ent and have it attach/follow the player and then make that ent think every so often to puff out smoke.
__________________
It's a mystery.
Mini_Midget is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-21-2011 , 21:49   Re: Smoke puffs
Reply With Quote #3

I belive he needs the puff to be on death, like L4D's smoker... the CS 1.6's grenade does something similar, there's a plugin that replaces the original smoke grenade and makes a new one exacly the same, look it up.
__________________
Hunter-Digital is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 04-22-2011 , 01:36   Re: Smoke puffs
Reply With Quote #4

Yes when dies it does smoke, but when he walks and etc there's some kinda green puffs with him, like he is smelly or smth
DoviuX is offline
Send a message via Skype™ to DoviuX
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-22-2011 , 03:16   Re: Smoke puffs
Reply With Quote #5

Quote:
Originally Posted by DoviuX View Post
Yes when dies it does smoke, but when he walks and etc there's some kinda green puffs with him, like he is smelly or smth
For that a task is just fine... but your code isn't.

You're not sending player ID in to the task, hook player spawn, remove the task and add it again:
Code:
remove_task(id)
set_task(1.0, "smoker_puff", id)
__________________
Hunter-Digital 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 19:50.


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