Raised This Month: $ Target: $400
 0% 

give weapon using menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-19-2010 , 18:13   Re: give weapon using menu
Reply With Quote #1

Replace :

Code:
register_menucmd(register_menuid("Select a Weapon"), keys, "giveWeapon")

with

Code:
register_menucmd(register_menuid("Which Weapon"), keys, "giveWeapon")
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2010 , 18:34   Re: give weapon using menu
Reply With Quote #2

That register_menuid() always confused me. Apparently this way actually compares text to find out what function is supposed to be used with the menu. This is not explicitly stated in the Wiki unfortunately.

I would think it would make more sense to use a pointer to a registered menu and then reference it using the pointer in show_menu().
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-19-2010 , 18:38   Re: give weapon using menu
Reply With Quote #3

By using register_menuid("Team_Select", true) you can hook :

Team_Select
Team_Select_Spect
IG_Team_Select
IG_Team_Select_Spect
IG_VIP_Team_Select
IG_VIP_Team_Select_Spect
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2010 , 18:42   Re: give weapon using menu
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
By using register_menuid("Team_Select", true) you can hook :

Team_Select
Team_Select_Spect
IG_Team_Select
IG_Team_Select_Spect
IG_VIP_Team_Select
IG_VIP_Team_Select_Spect
It doesn't have to start at index 0? I wouldn't have guessed that the last 4 would work.
__________________
fysiks is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 06-20-2010 , 09:11   Re: give weapon using menu
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Replace :

Code:
register_menucmd(register_menuid("Select a Weapon"), keys, "giveWeapon")


with

Code:
register_menucmd(register_menuid("Which Weapon"), keys, "giveWeapon")
hmm 1 question , why do i have to call it Which Weapon?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-20-2010 , 13:17   Re: give weapon using menu
Reply With Quote #6

Quote:
Originally Posted by SaM.ThE.MaN View Post
hmm 1 question , why do i have to call it Which Weapon?
It needs to be the same as the first few words of your menu string. Why? Because that's how it works.
__________________
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 14:49.


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