Raised This Month: $ Target: $400
 0% 

what this code do ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JusTGo
Veteran Member
Join Date: Mar 2013
Old 07-06-2014 , 16:28   what this code do ?
Reply With Quote #1

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

__________________
JusTGo is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-06-2014 , 16:30   Re: what this code do ?
Reply With Quote #2

It blocks the +use command and both of those impulses.
__________________
fysiks is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-07-2014 , 07:33   Re: what this code do ?
Reply With Quote #3

Isn't there a 'return FMRES_SUPERCEDE' missig after 'set_uc(uc, UC_Buttons, Buttons)' to block the use button?

Last edited by mottzi; 07-07-2014 at 07:34.
mottzi is offline
Send a message via MSN to mottzi
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-07-2014 , 07:57   Re: what this code do ?
Reply With Quote #4

Quote:
Originally Posted by mottzi View Post
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.

Last edited by klippy; 07-07-2014 at 07:57.
klippy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-07-2014 , 08:10   Re: what this code do ?
Reply With Quote #5

Quote:
Originally Posted by mottzi View Post
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.
__________________
fysiks 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 21:13.


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