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

AddToFullPack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 10-13-2012 , 06:10   AddToFullPack
Reply With Quote #1

I am trying to make CTs invisible for Ts when g_bfInvisible(id) is set to 1. Would there be a better way than this? It just seems like this would take up too much CPU usage...

PHP Code:
new g_bfInvisible;

#define isInvisible(%1)                g_bfInvisible & (1 << (%1 & 31)) 
PHP Code:
public Forward_AddToFullPack_Post(es,e,iEntity,iHost,iHostFlags,iPlayer,pSet)
    {
        if(!
iPlayer){
            return 
FMRES_IGNORED;
        }
        
        else if(
g_iGetUserTeam[iEntity] == CS_TEAM_CT)
        {
            
set_es(es,ES_RenderMode,kRenderTransAdd);
            
            if(
g_iGetUserTeam[iHost] == CS_TEAM_T && isInvisible(iEntity) && is_user_alive(iHost)){
                
set_es(es,ES_RenderAmt,0);
            }
        
            else{
                
set_es(es,ES_RenderAmt,255);
            }
        }
        
        return 
FMRES_IGNORED
    } 

Last edited by vitorrossi; 11-12-2012 at 21:42.
vitorrossi is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 11-12-2012 , 21:33   Re: AddToFullPack
Reply With Quote #2

bump
vitorrossi is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 11-13-2012 , 05:03   Re: AddToFullPack
Reply With Quote #3

you could replace the g_iGetUserTeam array with variables for each team that contain the bitsum of players in that team, that should be faster than using an array
jimaway is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 11-13-2012 , 12:02   Re: AddToFullPack
Reply With Quote #4

Thank you, will do.

Last edited by vitorrossi; 11-13-2012 at 21:41.
vitorrossi is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 11-13-2012 , 18:51   Re: AddToFullPack
Reply With Quote #5

Instead of use is_user_alive, you can hook player spawn & dead.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-13-2012 , 21:34   Re: AddToFullPack
Reply With Quote #6

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Instead of use is_user_alive, you can hook player spawn & dead.
You still need to call is_user_alive in those hooks
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 11-13-2012 , 21:41   Re: AddToFullPack
Reply With Quote #7

What about
PHP Code:
set_es(es,ES_RenderMode,kRenderTransAdd);
set_es(es,ES_RenderAmt,0);
set_es(es,ES_RenderAmt,255); 
They are called everytime addtofullpack is called, which is many times per sec. Is there a way to only call them once a round, and then everytime isInvisible returns a different value?
vitorrossi is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 11-14-2012 , 01:00   Re: AddToFullPack
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
You still need to call is_user_alive in those hooks
Of course but will be called fewer times.
__________________

Last edited by Neeeeeeeeeel.-; 11-14-2012 at 01:00.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
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 01:47.


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