Raised This Month: $ Target: $400
 0% 

Am I Crazy? Momma says yes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-21-2007 , 00:15   Am I Crazy? Momma says yes.
Reply With Quote #1

I feel like I must be.

But I have looked at this code very hard. And it's not even that late at night...it's just odd.

I'm blocking weapon fire server sided, both attack and attack2. Just like I normally do. But for some reason, if you fire or attack2 while you are not on the ground (ie. falling or walking off a step) it does not get blocked.

Code:
public fwd_CmdStart( id, uc_handle, seed ) {     if( plugin_enabled() && is_user_alive(id) && has_flamethrower(id, get_user_weapon(id)) )     {         static buttons;         buttons = get_uc( uc_handle, UC_Buttons );                 if( buttons & IN_ATTACK )         {             buttons &= ~IN_ATTACK;                         set_animation( id, sequences:altfirecycle );             client_print( id, print_center, "Firing" );         }         if( buttons & IN_ATTACK2 )         {             buttons &= ~IN_ATTACK2;             client_print( id, print_center, "Attack2 Blocked" );         }         set_uc( uc_handle, UC_Buttons, buttons );         return FMRES_SUPERCEDE;     }     return FMRES_IGNORED; }

The Client_Print always gets sent - even when you are falling (and the block doesn't work).

The block always works when you are on the ground.

I have tried the equivelant of this with FM_PlayerPreThink and the same thing happens.

I can't imagine why it hasn't been noticed before...am I doing something wrong here?

Code:
register_forward( FM_CmdStart, "fwd_CmdStart" ); // Tried post too - same thing
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-21-2007 , 10:29   Re: Am I Crazy? Momma says yes.
Reply With Quote #2

Someone edited my post and added "Momma says yes." to the end of the subject.

That is a violation of my first amendment coding rights of the AMXX Constitution.

Magistrate Bailopan, please incarcerate him.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 12-21-2007 , 11:16   Re: Am I Crazy? Momma says yes.
Reply With Quote #3

It's not a violation ... it's just an amendment ;-)

puns rock my world.
purple_pixie is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-21-2007 , 13:48   Re: Am I Crazy? Momma says yes.
Reply With Quote #4

I'm thinking some reason the first if statement is returning false so it won't ever get to supercede the buttons. I tried the same thing without that first statement and it worked fine.

Note: I also found that when blocking attack and attack2, if you click them both at once it will still fire (at least in CS). Not sure if you knew that or not but it was about 2 weeks into my plugin I found that out
hlstriker is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-21-2007 , 23:29   Re: Am I Crazy? Momma says yes.
Reply With Quote #5

If the first statement was blocking it, the text notification wouldn't show up though; it does
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
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 11:05.


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