AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what this code do ? (https://forums.alliedmods.net/showthread.php?t=243579)

JusTGo 07-06-2014 16:28

what this code do ?
 
hi , i need to know waht this code do in game :
PHP Code:

public fw_CmdStart(iducseed
{
    if(
g_bIsGhost[id]) 
    {
        new 
Buttons get_uc(ucUC_Buttons
        new 
Impulse get_uc(ucUC_Impulse)
        
        if(
Buttons IN_USE
        {     
            
Buttons &= ~IN_USE     
            set_uc
(ucUC_ButtonsButtons
        }
        if(
Impulse == 100 || Impulse == 201
        { 
            
set_uc(ucUC_Impulse0)
            return 
FMRES_HANDLED
        
}
    }
    return 
FMRES_IGNORED



fysiks 07-06-2014 16:30

Re: what this code do ?
 
It blocks the +use command and both of those impulses.

mottzi 07-07-2014 07:33

Re: what this code do ?
 
Isn't there a 'return FMRES_SUPERCEDE' missig after 'set_uc(uc, UC_Buttons, Buttons)' to block the use button?

klippy 07-07-2014 07:57

Re: what this code do ?
 
Quote:

Originally Posted by mottzi (Post 2163325)
Isn't there a 'return FMRES_SUPERCEDE' missig after 'set_uc(uc, UC_Buttons, Buttons)' to block the use button?

He cleared IN_USE button from buttons bitsum, so it is already blocked by just doing that. Although, one FMRES_HANDLED might be required, not sure. :?

fysiks 07-07-2014 08:10

Re: what this code do ?
 
Quote:

Originally Posted by mottzi (Post 2163325)
Isn't there a 'return FMRES_SUPERCEDE' missig after 'set_uc(uc, UC_Buttons, Buttons)' to block the use button?

The code doesn't change anything directly related to the forward so returning ignored is the correct value.


All times are GMT -4. The time now is 21:13.

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