Raised This Month: $ Target: $400
 0% 

Cvar setting problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-16-2011 , 17:40   Re: Cvar setting problem
Reply With Quote #1

You have to add a case in the menu which enable/disable the bunny hop to VIP's and, in the menu handler, add thing like :

Code:
case X: // I don't know the number of case there are {      if( bHaveBhop[ id ] )      {           server_cmd( id , "amx_autobhop %d 0" , get_user_userid( id ) )           client_print( id , print_chat , "BunnyHop disabled" )           bHaveBhop[ id ] = false      }      else      {           server_cmd( id , "amx_autobhop %d 1" , get_user_userid( id ) )           client_print( id , print_chat , "BunnyHop enabled" )           bHaveBhop[ id ] = true      } }

Don't forget to add a booléen.
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 06-16-2011 at 17:43.
Devil259 is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 06-16-2011 , 17:47   Re: Cvar setting problem
Reply With Quote #2

Quote:
Originally Posted by Devil259 View Post
You have to add a case in the menu which enable/disable the bunny hop to VIP's and, in the menu handler, add thing like :

Code:
case X: // I don't know the number of case there are { if( bHaveBhop[ id ] ) { server_cmd( id , "amx_autobhop %d 0" , get_user_userid( id ) ) client_print( id , print_chat , "BunnyHop disabled" ) bHaveBhop[ id ] = false } else { server_cmd( id , "amx_autobhop %d 1" , get_user_userid( id ) ) client_print( id , print_chat , "BunnyHop enabled" ) bHaveBhop[ id ] = true } }


Don't forget to add a booléen.
There is no case in the menu....
Quote:
//////////////////////////////////////////////////////////////////////////////////////////
// MENU

public SVM_MENUCMD(id) {
if( !get_pcvar_num(cvar_enable) ) return PLUGIN_HANDLED;

if(!g_playerisvip[id])
{
new tag[10]
get_pcvar_string(cvar_tag, tag, 9)
client_print(id, print_chat, "%L", id, "SVM_NOTVIP", tag)
return PLUGIN_CONTINUE
}

svm_menu(id, 0)
return PLUGIN_HANDLED
}

svm_menu( iPlayer, iPage ) {

if( !g_iTotalItems ) {
return
}

iPage = clamp( iPage, 0, ( g_iTotalItems - 1 ) / 7 )

new hMenu = menu_create( SVM_MENU_TITLE, "svm_menu_handler" );

new eItemData[ ItemData ]
new szItem[ 64 ]

new szNum[ 3 ];

for( new i = 0; i < g_iTotalItems;i++ ) {

ArrayGetArray( g_aItems, i, eItemData )

formatex( szItem, charsmax( szItem ), "%s %s", eItemData[ ItemName ], g_pluginon[iPlayer][i] == 1 ? "\yON" : "\rOFF" );
num_to_str( i, szNum, charsmax( szNum ) )

menu_additem( hMenu, szItem, szNum )
}

menu_display( iPlayer, hMenu, iPage )
}

public svm_menu_handler( iPlayer, hMenu, iItem ) {

if( iItem == MENU_EXIT ) {

menu_destroy( hMenu )
return;
}

new iAccess, szNum[ 3 ], hCallback
menu_item_getinfo( hMenu, iItem, iAccess, szNum, charsmax( szNum ), _, _, hCallback )
menu_destroy( hMenu )

new iItemIndex = str_to_num( szNum )

new eItemData[ ItemData ]
ArrayGetArray( g_aItems, iItemIndex, eItemData )

Change_PluginState(iPlayer, iItemIndex, !g_pluginon[iPlayer][iItemIndex])

svm_menu( iPlayer, .iPage = ( iItemIndex / 7 ) )
}

//////////////////////////////////////////////////////////////////////////////////////////
Melisko is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-16-2011 , 17:51   Re: Cvar setting problem
Reply With Quote #3

Ah ok, I don't know the VIP plugin :/
__________________
You can do anything you set your mind to, man.

Devil259 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 23:28.


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