Raised This Month: $ Target: $400
 0% 

Remove Menu Keys(cvar)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 08-08-2010 , 03:00   Remove Menu Keys(cvar)
Reply With Quote #1

Hi,

I have a problem, and i don't know how to solve it.
I have a menu with 3 options.

1.He grenade
2.Flash grenade
3.Smoke grenade

I have 3 cvars

amx_he_on 1
amx_flash_on 0
amx_smoke_on 0

And i want to remove the specified key if the cvar is 0 for the specified grenade.

Now you see the keys, from my cvars 1(on-enabled), and 2(off-disabled)
PHP Code:
new keys = (1<<1<<1<<2  1<<9);
show_menu(idkeysmenuBody, -1"Shop"); 
I want when i press 2 or 3 to do nothing.

A stupid methode will be

PHP Code:
new keys = (if(get_pcvar_num(he_on)) {1<<0} | 1<<1<<2  1<<9); 
Of course that dosen't work.

How can i remove keys with a cvar ?
Ex3cuTioN is offline
Ex3cuTioN
Member
Join Date: May 2010
Old 08-09-2010 , 03:40   Re: Remove Menu Keys(cvar)
Reply With Quote #2

Nobody ?
Ex3cuTioN is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 08-09-2010 , 05:28   Re: Remove Menu Keys(cvar)
Reply With Quote #3

Hi

1. You should show us your code that is easier for us to help you.
2. Why you want to remove the keys? Add only keys that are used.

Example:
PHP Code:
new keys = (1<<9)
if (
get_pcvar_num(he_on)) keys |= (1<<0)
if (
get_pcvar_num(flash_on)) keys |= (1<<1)
if (
get_pcvar_num(smoke_on)) keys |= (1<<2
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. 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 00:14.


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