Raised This Month: $12 Target: $400
 3% 

Hook Through Pass Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elantra86
Member
Join Date: Feb 2014
Old 10-13-2016 , 15:07   Hook Through Pass Player
Reply With Quote #1

Hi All .Is there any way to hook pass through player?
Here is my code but it work not everytime 50/50.

PHP Code:
new g_iPlayers[32], g_iNumg_iPlayer
new const g_szAliveFlags[] = "ah" 
#define RefreshPlayersList()    get_players(g_iPlayers, g_iNum, g_szAliveFlags) 

new bool:solidnot[33]
new 
bool:ishooked[33]

plugin_init() {
    
RegisterHamHam_Player_PreThink"player""Ham_CBasePlayer_PreThink_Post"1)
}

public 
hook_on(id) {
    
ishooked[id] = true
}

public 
hook_off(id) {
     
ishooked[id] = false
}
public 
Ham_CBasePlayer_PreThink_Post(id

    if( !
is_user_alive(id) ) 
    { 
        return 
    }
    new 
Targetaux
    get_user_aiming
(idTargetaux)
    if( 
Target && is_user_alive(Target) || ishooked[id]){
        
client_print(idprint_chat"solidnottrue!!!!!!!!!!!!")
        
solidnot[id] = true
    
}
    
RefreshPlayersList() 
    for(new 
0i<g_iNumi++) 
    { 
        
g_iPlayer g_iPlayers[i
        if( 
id != g_iPlayer 
        {
            
set_pev(g_iPlayerpev_solidSOLID_NOT
        } 
    } 



public 
client_PostThink(id

    if( !
is_user_alive(id)) 
        return
    
RefreshPlayersList() 
    for(new 
0i<g_iNumi++) 
       {     
        
g_iPlayer g_iPlayers[i
        if( 
g_iPlayer != id  && !solidnot[id]) {
            
set_pev(g_iPlayerpev_solidSOLID_SLIDEBOX)
        }
       }
    if(!
ishooked[id] && solidnot[id]) {
        
solidnot[id] = false
        client_print
(idprint_chat"solidnotfalse!!!!!!!!!!!!")
    }

Where is my mistake?

Last edited by elantra86; 10-13-2016 at 15:11.
elantra86 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-16-2016 , 15:48   Re: Hook Through Pass Player
Reply With Quote #2

What exactly are you trying to do? Explain in words, not in code.
__________________

Last edited by Bugsy; 10-16-2016 at 15:48.
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2016 , 13:13   Re: Hook Through Pass Player
Reply With Quote #3

why are you trying two method of post think
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 10-17-2016 , 15:51   Re: Hook Through Pass Player
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
why are you trying two method of post think
prethink post and postthink are 2 different things
jimaway is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2016 , 15:53   Re: Hook Through Pass Player
Reply With Quote #5

Quote:
Originally Posted by jimaway View Post
prethink post and postthink are 2 different things
give me an explanation about the difference between those ( Ham_Player_PreThink | Ham_Player_PostThink )

so its like this : - the position's..

PreThink

PreThink Post

PostThink

PostThink Post

Last edited by Natsheh; 10-17-2016 at 16:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 10-17-2016 , 15:57   Re: Hook Through Pass Player
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
give me an explanation about the difference between those ( Ham_Player_PreThink | Ham_Player_PostThink )
prethink post is executed after prethink, postthink pre is executed before postthink.

you can see when happens between here: https://forums.alliedmods.net/showpo...71&postcount=1
jimaway is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2016 , 16:04   Re: Hook Through Pass Player
Reply With Quote #7

thanks for the information.\

Thanks jimmmmmmmmmmmay

Last edited by Natsheh; 10-17-2016 at 16:06.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
elantra86
Member
Join Date: Feb 2014
Old 10-21-2016 , 22:30   Re: Hook Through Pass Player
Reply With Quote #8

All normal after using kz_semiclip ConnormcLoed. Thanks to all.
elantra86 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 18:53.


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