Raised This Month: $ Target: $400
 0% 

View Poll Results: Wich of this options is better at the moment of call a function very often?
simple set_task at 0.1 in the called funcion.. 1 8.33%
infinite set_task (and then remove it out) (id, _, _, "b") 2 16.67%
Client_prethink 4 33.33%
fm_prethink 3 25.00%
ham_prethink 2 16.67%
Voters: 12. You may not vote on this poll

Optimizing a plugin.Wich of these options is better?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-14-2009 , 21:23   Re: Optimizing a plugin.Wich of these options is better?
Reply With Quote #1

Quote:
Originally Posted by _lol_ View Post
if i want just to execute a message?like te_delight, te_particleburst, tracers...
You must be more specific. You are just talking about sending a message.

Quote:
Originally Posted by _lol_ View Post
or if i just want to check the buttons that a player is pressing?
and if the player pres x button execute something?
FM_PlayerPreThink or FM_PlayerPostThink. Probably you will have to choose one of them for specific situations.
__________________
joaquimandrade is offline
_lol_
Senior Member
Join Date: Apr 2009
Old 04-14-2009 , 21:53   Re: Optimizing a plugin.Wich of these options is better?
Reply With Quote #2

thanks

Last edited by _lol_; 04-15-2009 at 12:21.
_lol_ is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-14-2009 , 22:06   Re: Optimizing a plugin.Wich of these options is better?
Reply With Quote #3

Quote:
Originally Posted by _lol_ View Post
something like this...
Code:
static Float:originF[3]            
                pev(id, pev_origin, originF)
                // Colored Aura
                engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
                write_byte(TE_DLIGHT) // TE id
                engfunc(EngFunc_WriteCoord, originF[0]) // x
                engfunc(EngFunc_WriteCoord, originF[1]) // y
                engfunc(EngFunc_WriteCoord, originF[2]) // z
                write_byte(13) // radius asdasdasd
                write_byte(255) // r
                write_byte(0) // g
                write_byte(0)  // b 
                write_byte(2) // life
                write_byte(0) // decay rate
                message_end() 
                
                //Glow
                fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 35)
                
                // Particle Burst
                engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
                write_byte(TE_PARTICLEBURST) // TE id
                engfunc(EngFunc_WriteCoord, originF[0]) // x
                engfunc(EngFunc_WriteCoord, originF[1]) // y
                engfunc(EngFunc_WriteCoord, originF[2]) // z
                write_short(20) // radius
                write_byte(208) // color
                write_byte(3) // duration (will be randomized a bit)
                message_end()
You still haven't said how that is used.

Quote:
Originally Posted by _lol_ View Post
what will you choose for this?
Code:
new button = pev(id, pev_button)
    
    if(!is_user_alive(id))
        return ;
        
    if(!zp_get_user_zombie(id) || zp_get_user_nemesis(id))
        return ;
    
    if(zp_get_user_zombie_class(id) != g_invisible)
        return;
      
    if ((button & IN_DUCK))
    {
        if (zp_get_user_frozen(id))
        {
            message_begin ( MSG_ONE_UNRELIABLE, g_MsgShadow, _, id );
            write_long (0);
            message_end ();
            
            set_pev(id, pev_renderfx, kRenderFxNone);
            set_pev(id, pev_rendercolor, Float:{0.0, 0.0, 0.0});
            set_pev(id, pev_rendermode, kRenderTransColor);
            set_pev(id, pev_renderamt, 0.0);
            
            //glow :D
            fm_set_rendering(id, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 35)
        }
        else
    {
        message_begin ( MSG_ONE_UNRELIABLE, g_MsgShadow, _, id );
        write_long (0);
        message_end ();
            
        set_pev(id, pev_renderfx, kRenderFxNone);
        set_pev(id, pev_rendercolor, Float:{0.0, 0.0, 0.0});
        set_pev(id, pev_rendermode, kRenderTransColor);
        set_pev(id, pev_renderamt, 0.0);
    }
        set_pev(id, pev_viewmodel2, 0)
        set_pev(id, pev_weaponmodel2, "")
    }
    if (!(button & IN_DUCK))
    {
        if (zp_get_user_frozen(id))
        {
            set_pev(id, pev_renderfx, kRenderFxNone)
            set_pev(id, pev_rendercolor, 255,255,255)
            set_pev(id, pev_rendermode, kRenderNormal)
            set_pev(id, pev_renderamt, 0.0)
            
            //glow :D
            fm_set_rendering(id, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 35)
        }
        else
    {
        set_pev(id, pev_renderfx, kRenderFxNone)
        set_pev(id, pev_rendercolor, 255,255,255)
        set_pev(id, pev_rendermode, kRenderNormal)
        set_pev(id, pev_renderamt, 0.0)
    }
        set_pev(id, pev_viewmodel2, cuchi)
        set_pev(id, pev_weaponmodel2, "")
    }
It should be the same thing.
__________________
joaquimandrade 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 02:20.


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