Raised This Month: $ Target: $400
 0% 

Weapon strings in register_event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-09-2006 , 20:20   Weapon strings in register_event?
Reply With Quote #1

Is it possible to use
Code:
register_event("CurWeapon", "publicfunction", "be")

And then have the event only execute when the curweapon is not 1. knife 2. hegrenade 3. c4 by inputting it into the event like this
Code:
register_event("CurWeapon", "publicfunction", "be", "not sure what goes here if possible")
When the publicfunction gets called whats in the function will be executed if it is not one of the three weapon possibilities while having the weapon defined in the registered event. Is this possible? Ive tried using read_data in the public function but sometimes it wont allow the c4 or henade, only the knife. Thanks for any help.
organizedKaoS is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-10-2006 , 13:46  
Reply With Quote #2

Answer on your main question: no.
While you still can filter weapon IDs with read_data and if/case inside function-handler.
VEN is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-10-2006 , 15:50  
Reply With Quote #3

Thanks wanted to make sure.
organizedKaoS is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-10-2006 , 20:09  
Reply With Quote #4

couldn't you use the extra arguments for register_event? where x is the argument number for the new weapon id:

Code:
register_event("CurWeapon", "publicfunction", "be", "x!CSW_KNIFE", "x!CSW_HEGRENADE", "x!CSW_C4")

and before people start yelling at me for putting variables inside a string like that, CSW_* are constants, so every occurance is replaced by the preprocessor before the compile actually starts.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-10-2006 , 21:56  
Reply With Quote #5

Quote:
Originally Posted by Kraugh
couldn't you use the extra arguments for register_event? where x is the argument number for the new weapon id:

Code:
register_event("CurWeapon", "publicfunction", "be", "x!CSW_KNIFE", "x!CSW_HEGRENADE", "x!CSW_C4")

and before people start yelling at me for putting variables inside a string like that, CSW_* are constants, so every occurance is replaced by the preprocessor before the compile actually starts.
Could this actually work? Im not sure thats why I asked
organizedKaoS is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-10-2006 , 23:28  
Reply With Quote #6

So can anyone confirm or deny if weapon constants can be defined in the register_event so it does not have to be filtered in the public function?
organizedKaoS is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-11-2006 , 02:01  
Reply With Quote #7

after a brief study of CurWeapon, the following should work.

Code:
register_event("CurWeapon", "publicfunction", "b", "1=1", "2!0", "2!CSW_KNIFE", "2!CSW_HEGRENADE", "2!CSW_C4")

cheers!
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-11-2006 , 02:09  
Reply With Quote #8

Quote:
Originally Posted by Kraugh
after a brief study of CurWeapon, the following should work.

Code:
register_event("CurWeapon", "publicfunction", "b", "1=1", "2!0", "2!CSW_KNIFE", "2!CSW_HEGRENADE", "2!CSW_C4")

cheers!
Thanks alot, Ill test it as soon as I can, not sure when tho. Hopefully it works Just some questions for my understanding....What does "1=1" mean? Im assuming that 2 is the current weapon check, so what does "2!0" mean? Thanks again.
organizedKaoS is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-11-2006 , 05:02  
Reply With Quote #9

If #defines are replaced by the preprocessor in string literals, it's a bug :O

They used to be but I thought that was fixed a long time ago.
__________________
hello, i am pm
PM is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-11-2006 , 05:13  
Reply With Quote #10

Quote:
Originally Posted by PM
If #defines are replaced by the preprocessor in string literals, it's a bug :O

They used to be but I thought that was fixed a long time ago.
Please elaborate???
organizedKaoS 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 20:25.


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