AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Question] Register Message from a specific player (https://forums.alliedmods.net/showthread.php?t=156617)

dFF 05-09-2011 12:57

[Question] Register Message from a specific player
 
For example I have:

PHP Code:

[...]
register_clcmd"register""register" )
register_clcmd"unregister""unregister" )

public 
registerid )
{
    
g_iHookMsgAmmoXid ] = register_messageg_iMsgAmmoX"Message_CurWeapon" )
}

public 
unregisterid )
{
    if( 
g_iHookMsgAmmoXid ] )
    {
        
unregister_messageg_iMsgAmmoXg_iHookMsgAmmoXid ] )
                    
        
g_iHookMsgAmmoXid ] = 0
    
}


It's necessary to disable the hook message (like in "unregister" function) when client disconect ?

SonicSonedit 05-09-2011 13:13

Re: [Question] Register Message from a specific player
 
Depends on what should it do.

dFF 05-09-2011 14:38

Re: [Question] Register Message from a specific player
 
Simple, I hook player ammos. I want to know If Is necessary to unregister hook-message from a player who has hooked message. (Message_CurWeapon)

SonicSonedit 05-09-2011 16:23

Re: [Question] Register Message from a specific player
 
dFF
Quote:

Simple, I hook player ammos. I want to know If Is necessary to unregister hook-message from a player who has hooked message.
First of all, the code you use above hooks it for all players. And no, you don't need to unregister it, just filter player id.


All times are GMT -4. The time now is 04:19.

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