Raised This Month: $ Target: $400
 0% 

Cvar setting problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Melisko
Senior Member
Join Date: Feb 2010
Old 06-16-2011 , 11:13   Re: Cvar setting problem
Reply With Quote #1

Quote:
Originally Posted by Devil259 View Post
from ConnorMcLeod's post (see Bunny Hop Abilities v0.5.2 plugin).

So, use server_cmd( ).
I think I wrote my last post wrong... I mean , enable/disable cvar bhop_auto only for player , that choose it in vip menu..... Im not rly good at scripting.....

Is it possbile that each player can have enable different cvar???

Last edited by Melisko; 06-16-2011 at 11:15. Reason: etc....
Melisko is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-16-2011 , 11:20   Re: Cvar setting problem
Reply With Quote #2

Code:
if( iPluginON ) {      server_cmd( "amx_autobhop %d 1" , get_user_userid( id ) ) }

Try this.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 06-16-2011 , 16:06   Re: Cvar setting problem
Reply With Quote #3

Quote:
Originally Posted by Devil259 View Post
Code:
if( iPluginON ) { server_cmd( "amx_autobhop %d 1" , get_user_userid( id ) ) }


Try this.
Sorry but I cant compile it.... I have got errors . Like I said , Im not really good at scripting...
Melisko is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-16-2011 , 16:59   Re: Cvar setting problem
Reply With Quote #4

Show whole code.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 06-16-2011 , 17:13   Re: Cvar setting problem
Reply With Quote #5

Quote:
Originally Posted by Devil259 View Post
Show whole code.
Ok , the svmplugintest.sma is a "tutorial" how to make that vip... actually Im using this plugin : http://forums.alliedmods.net/showthread.php?t=147276 , it is very hard to code it for me , I have got so many errors...

And now the Bunny Hop plugin : (Im gonna post the original) : http://forums.alliedmods.net/showthread.php?p=610329

And now I will tell you how I want to use this plugin : The Bunny Hop will be enabled for all players . But , when VIP(and admins) player write /vipmenu to the chat , he can disable the Bunny-Hopping in the menu (only for him)..... Thats all.....

VIPmenu is coded in vip plugin

And I have got error messages like this : 41.: loose identation , invalid expression assumed zero. etc...
Attached Files
File Type: sma Get Plugin or Get Source (svmplugintest.sma - 481 views - 1.3 KB)

Last edited by Melisko; 06-16-2011 at 17:15. Reason: vipmenu + error messages
Melisko is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 06-16-2011 , 17:40   Re: Cvar setting problem
Reply With Quote #6

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 #7

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
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