Raised This Month: $ Target: $400
 0% 

Fakemeta for register_impulse?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-18-2007 , 10:45   Fakemeta for register_impulse?
Reply With Quote #1

What would be the Fakemeta equivalent for Engine's register_impulse ?
Or client_impulse (whichever works better).
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-18-2007 , 10:54   Re: Fakemeta for register_impulse?
Reply With Quote #2

Code:
 // Impulse command issued
    UC_Impulse,        // byte
?
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 06-18-2007 at 15:21.
Alka is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-18-2007 , 11:56   Re: Fakemeta for register_impulse?
Reply With Quote #3

Hook CmdStart and check for UC_Impulse value via get_uc().
VEN is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-18-2007 , 12:09   Re: Fakemeta for register_impulse?
Reply With Quote #4

So something like this?
Code:
 
register_forward(FM_CmdStart, "cl_cmd")
...
public cl_cmd(id, handle, seed)
{
  new impulse = get_uc(handle, UC_Impulse)
  if (impulse == 201) {
    client_print(id, print_chat, "No Spray for You!")
    return FMRES_SUPERCEDE
  }
  return FMRES_IGNORED
}
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 06-18-2007 at 18:07.
Vet is offline
Send a message via MSN to Vet
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-18-2007 , 15:17   Re: Fakemeta for register_impulse?
Reply With Quote #5

looks good
__________________
regalis is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-18-2007 , 18:54   Re: Fakemeta for register_impulse?
Reply With Quote #6

Well that didn't quite work right. The FMRES_SUPERCEDE didn't stop the impulse value. So then I tried using forward_return(FMV_CELL, 0) and that still didn't work.

What finally DID work was setting the UC_Impulse value to 0 before returning with set_uc()
Code:
 
public cl_cmd(id, handle, seed)
{
 new impulse = get_uc(handle, UC_Impulse)
  if (impulse == 201) {
    client_print(id, print_chat, "No Spray for You!")
    set_uc(handle, UC_Impulse, 0)
  }
  return FMRES_HANDLED
}
Thanks !
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 06-18-2007 at 18:58.
Vet is offline
Send a message via MSN to Vet
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-24-2007 , 15:46   Re: Fakemeta for register_impulse?
Reply With Quote #7

warning: loose indentation on line " if (impulse == 201) {"

-what i forgot?
Owyn is offline
Send a message via ICQ to Owyn
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-24-2007 , 16:00   Re: Fakemeta for register_impulse?
Reply With Quote #8

Just fix your spacing so everything is lined up nicely.
hlstriker is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-24-2007 , 16:02   Re: Fakemeta for register_impulse?
Reply With Quote #9

uhm..i see nothing wrong with spaces, mb u could show me, cuz i can't get this to work (cuz of "loose indentation")
Owyn is offline
Send a message via ICQ to Owyn
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-24-2007 , 16:42   Re: Fakemeta for register_impulse?
Reply With Quote #10

Post your code and I'll fix it.
hlstriker 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 10:31.


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