Raised This Month: $ Target: $400
 0% 

A problem with menu.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
obiwan
Junior Member
Join Date: Sep 2008
Old 06-16-2010 , 10:29   Re: A problem with menu.
Reply With Quote #6

Okay, now i have another idea how to make this menu :
I want to make menu with cvars like this :

Code:
1. mp_friendlyfire 1
and when you going to click 1 its going to change to
Code:
1. mp_friendlyfire 0
i made it like this :
PHP Code:
 new call1

 
public plugin_init()
 {
    
//..stuff
    
call1 menu_makecallback("example_callback1")
 }

 public 
Menu(id)
 {

    new 
menu menu_create("\rCvar menu :""menu_handler");

    
menu_additem(menu"\wmp_friendlyfire""1"ADMIN_IMMUNITYcall1);
    
menu_additem(menu"\wI'm Selection #2""2"ADMIN_IMMUNITY);
    
menu_additem(menu"\wI'm Secret Selection #3""3"ADMIN_IMMUNITY);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
 }

// stuff

public example_callback1(idmenuitem)
{
    new 
callreturn
  
if(get_cvar_string("mp_friendlyfire" == 1){
      
callreturn ON
}
else {
    
callreturn OFF
}

    return 
callreturn

but i keep getting error
Code:
Error: Array must be indexed (variable "-unknown-") on line 97
line 97 is in this public
PHP Code:
public example_callback1(idmenuitem)
{
    new 
callreturn
  
if(get_cvar_string("mp_friendlyfire" == 1){
      
callreturn ON
}
else {
    
callreturn OFF
}

    return 
callreturn

obiwan is offline
 



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:46.


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