Raised This Month: $ Target: $400
 0% 

Is forward registered?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-11-2011 , 14:43   Is forward registered?
Reply With Quote #1

I use somevar = register_forward(....) and unregister_forward().
Can I check is forward already registered?
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-11-2011 , 14:44   Re: Is forward registered?
Reply With Quote #2

somevar > 0
__________________
Arkshine is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-11-2011 , 14:44   Re: Is forward registered?
Reply With Quote #3

After unregister_forward() somevar still > 0
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-11-2011 , 14:45   Re: Is forward registered?
Reply With Quote #4

When you unregister the forward, set the variable in which you stored the forward index to 0.
Value check will tell you if the forward is registered or not.

Use this stock if you want :
PHP Code:
UnregisterForward(_forwardType, &registerIdpost 0)
{
    
unregister_forward(_forwardTyperegisterIdpost)
    
registerId 0

Dunno if unregister_forward returns something, you may want to use :
PHP Code:
UnregisterForward(_forwardType, &registerIdpost 0)
{
    new 
iRet unregister_forward(_forwardTyperegisterIdpost)
    
registerId 0
    
return iRet

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-11-2011 at 14:48.
ConnorMcLeod is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-11-2011 , 14:47   Re: Is forward registered?
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
When you unregister the forward, set the variable in which you stored the forward index to 0.
Value check will tell you if the forward is registered or not.
Thank you
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
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 09:38.


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