Raised This Month: $ Target: $400
 0% 

Saving Menu Variables


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-01-2007 , 22:26   Saving Menu Variables
Reply With Quote #1

Hello, this is part of the code for my menu, once this part of the menu is called, i want the variables in the menu to be saved, onto the menu keys, and onto the next menu, and so forth...

I want the "Mage,SelectedPlayers,PlayerSelecter,ExpG od" To be saved onto the keys and following menus that are called instead of just the regular (id,keys)

This is my attempt at doing that....

Code:
register_menucmd(register_menuid("ExpMenu:"),1023,"ExpMenu1Function") public ExpMenu1(Mage,SelectedPlayers,PlayerSelecter,ExpGod) {  new exp[32], exp1[32], exp2[32], exp3[32]  get_euser_exp(mage,exp,31)  get_euser_exp(SelectedPlayers,exp1,31)  get_euser_exp(PlayerSelecter,exp2,31)  get_euser_exp(ExpGod,exp3,31)  client_print(menuuser,print_center,"%s|%s|%s|%s|",exp,exp1,exp2,exp3)  new menuBodyp[512]  new len = format(menuBodyp,511,"ExpMenu:^n^nMenu Info^n",name,name1)  len += format(menuBodyp[len],511-len,"1. More Info^n2. Exp God Info^n^n0. Exit")  show_menu(Mage,SelectedPlayers,PlayerSelecter,ExpGod,((1<<0)|(1<<1)|(1<<9)),menuBodyp)  return PLUGIN_HANDLED } public ExpMenu1Function(Mage,SelectedPlayers,PlayerSelecter,ExpGod,key) {  switch(key)  {   case 0:   {    ExpMenu1MoreInfo(Mage,SelectedPlayers,PlayerSelecter,ExpGod)   }   case 1:   {    ExpMenu1ExpGod(Mage,SelectedPlayers,PlayerSelecter,ExpGod)   }   case 9:   {    return PLUGIN_HANDLED   }  }  return PLUGIN_HANDLED }

But it gives me an argument error at the "show_menu" line when I compile

So my questions is how, do I save multiple variables in the menus?

Edit:

Hmm more explaining...

I want only the person who pressed the menu to see the menu(playerselecter), but i want the other 3 player variables (mage, expgod, selectedplayers) to be saved as well..

So that in the next menus i can also do things like get_user_authid, get_euser_exp, get_euser_level, etc on the variables! Thanks!

Last edited by OmgHi; 02-01-2007 at 22:41.
OmgHi is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-02-2007 , 06:01   Re: Help- Saving Menu Variables
Reply With Quote #2

WTF!? You can't do it like that! You have to loop it!
I suggest you read through some kinda manual.

Code:
new players[4] players[0] = Mage players[1] = SelectedPlayers players[2] = PlayerSelecter players[3] = ExpGod for ( new i ; i < 4 ; i++ )     show_menu(players[i], (1<<0)|(1<<1)|(1<<9), menuBodyp)
And that is not the only error.
[ --<-@ ] Black Rose is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 13:29   Re: Help- Saving Menu Variables
Reply With Quote #3

That would make it so only the person who used the menu sees the menu, but it would save the other 3 variables right?
OmgHi is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 13:42   Re: Help- Saving Menu Variables
Reply With Quote #4

This really looks like its going to send the menu to EVERYONE in the variables instead of just 1 person the menu should go to ...
OmgHi is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-02-2007 , 14:04   Re: Help- Saving Menu Variables
Reply With Quote #5

Well, wtf do you mean by this then?
Explain exactly what this does.
PHP Code:
show_menu(Mage,SelectedPlayers,PlayerSelecter,ExpGod,((1<<0)|(1<<1)|(1<<9)),menuBodyp
[ --<-@ ] Black Rose is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 14:13   Re: Help- Saving Menu Variables
Reply With Quote #6

Yes I know that makes no sence, but it was the only way I could think of to describe what im trying to do...

I want the menu to only go to 1 person ( the person who selected the menu ), but I want the other 3 variables saved, so I can perform commands on them!

This is what you gave me...

Code:
register_menucmd(register_menuid("ExpMenu:"),1023,"ExpMenu1Function") public ExpMenu1(Mage,SelectedPlayers,PlayerSelecter,ExpGod) {  new exp[32], exp1[32], exp2[32], exp3[32]  get_euser_exp(mage,exp,31)  get_euser_exp(SelectedPlayers,exp1,31)  get_euser_exp(PlayerSelecter,exp2,31)  get_euser_exp(ExpGod,exp3,31)  client_print(menuuser,print_center,"%s|%s|%s|%s|",exp,exp1,exp2,exp3)  new menuBodyp[512]  new len = format(menuBodyp,511,"ExpMenu:^n^nMenu Info^n",name,name1)  len += format(menuBodyp[len],511-len,"1. More Info^n2. Exp God Info^n^n0. Exit")  new players[4]  players[0] = Mage  players[1] = SelectedPlayers  players[2] = PlayerSelecter  players[3] = ExpGod  for( new i ; i < 4; i++ )  show_menu(players[i],((1<<0)|(1<<1)|(1<<9)),menuBodyp)  return PLUGIN_HANDLED } public ExpMenu1Function(players) {  switch(key)  {   case 0:   {    ExpMenu1MoreInfo(players)   }   case 1:   {    ExpMenu1ExpGod(players)   }   case 9:   {    return PLUGIN_HANDLED   }  }  return PLUGIN_HANDLED }

Which does not give me what I need at all.

Not only is the menu going to all 4 people, but now i can't access the variables!

I cant do..

Code:
register_menucmd(register_menuid("ExpMenu:"),1023,"ExpMenu1Function") public ExpMenu1(Mage,SelectedPlayers,PlayerSelecter,ExpGod) {  new exp[32], exp1[32], exp2[32], exp3[32]  get_euser_exp(mage,exp,31)  get_euser_exp(SelectedPlayers,exp1,31)  get_euser_exp(PlayerSelecter,exp2,31)  get_euser_exp(ExpGod,exp3,31)  client_print(menuuser,print_center,"%s|%s|%s|%s|",exp,exp1,exp2,exp3)  new menuBodyp[512]  new len = format(menuBodyp,511,"ExpMenu:^n^nMenu Info^n",name,name1)  len += format(menuBodyp[len],511-len,"1. More Info^n2. Exp God Info^n^n0. Exit")  new players[4]  players[0] = Mage  players[1] = SelectedPlayers  players[2] = PlayerSelecter  players[3] = ExpGod  for( new i ; i < 4; i++ )  show_menu(players[i],((1<<0)|(1<<1)|(1<<9)),menuBodyp)  return PLUGIN_HANDLED } public ExpMenu1Function(players) {  switch(key)  {   case 0:   {    ExpMenu1MoreInfo(players[0],players[1],players[2],players[3])   }   case 1:   {    ExpMenu1ExpGod(players[0],players[1],players[2],players[3])   }   case 9:   {    return PLUGIN_HANDLED   }  }  return PLUGIN_HANDLED }

or...

Code:
register_menucmd(register_menuid("ExpMenu:"),1023,"ExpMenu1Function") public ExpMenu1(Mage,SelectedPlayers,PlayerSelecter,ExpGod) {  new exp[32], exp1[32], exp2[32], exp3[32]  get_euser_exp(mage,exp,31)  get_euser_exp(SelectedPlayers,exp1,31)  get_euser_exp(PlayerSelecter,exp2,31)  get_euser_exp(ExpGod,exp3,31)  client_print(menuuser,print_center,"%s|%s|%s|%s|",exp,exp1,exp2,exp3)  new menuBodyp[512]  new len = format(menuBodyp,511,"ExpMenu:^n^nMenu Info^n",name,name1)  len += format(menuBodyp[len],511-len,"1. More Info^n2. Exp God Info^n^n0. Exit")  new players[4]  players[0] = Mage  players[1] = SelectedPlayers  players[2] = PlayerSelecter  players[3] = ExpGod  for( new i ; i < 4; i++ )  show_menu(PlayerSelecter,((1<<0)|(1<<1)|(1<<9)),menuBodyp)  return PLUGIN_HANDLED } public ExpMenu1Function(PlayerSelecter) {  switch(key)  {   case 0:   {    ExpMenu1MoreInfo(players[0],players[1],players[2],players[3])   }   case 1:   {    ExpMenu1ExpGod(players[0],players[1],players[2],players[3])   }   case 9:   {    return PLUGIN_HANDLED   }  }  return PLUGIN_HANDLED }

This last one describes more what im trying to do...

I want the menu to only go to 1 person, but I want the 4 variables saved so I can still access them to perform commands on them!

Thanks if you can help!

Last edited by OmgHi; 02-02-2007 at 14:21.
OmgHi is offline
JCobra
Senior Member
Join Date: Mar 2006
Location: Canada
Old 02-02-2007 , 15:45   Re: Help- Saving Menu Variables
Reply With Quote #7

You're supposed to be banned.... Go away.
__________________
User has abandoned this account.
JCobra is offline
Send a message via AIM to JCobra
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 15:56   Re: Help- Saving Menu Variables
Reply With Quote #8

-Karma'ed and Flamed for no reason?

Seems to me YOU should be banned...

Get the hell off my thread!

Mod! Delete him! >.<
OmgHi is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 17:32   Re: Saving Menu Variables
Reply With Quote #9

Code:
new callfunc1 register_menucmd(register_menuid("ExpMenu:"),1023,"ExpMenu1Function") callfunc1 = get_func_id("ExpMenu1") //Yes, the stuff above is in the public plugin_init()... public ExpMenu1(Mage,SelectedPlayers,PlayerSelecter,ExpGod) {  new exp[32], exp1[32], exp2[32], exp3[32]  get_euser_exp(mage,exp,31)  get_euser_exp(SelectedPlayers,exp1,31)  get_euser_exp(PlayerSelecter,exp2,31)  get_euser_exp(ExpGod,exp3,31)  client_print(menuuser,print_center,"%s|%s|%s|%s|",exp,exp1,exp2,exp3)  new menuBodyp[512]  new len = format(menuBodyp,511,"ExpMenu:^n^nMenu Info^n",name,name1)  len += format(menuBodyp[len],511-len,"1. More Info^n2. Exp God Info^n^n0. Exit")  show_menu(PlayerSelecter,((1<<0)|(1<<1)|(1<<9)),menuBodyp)  return PLUGIN_HANDLED } public ExpMenu1Function(id,key) {  callfunc_begin_i(callfunc1)  callfunc_push_int(Mage,SelectedPlayers,PlayerSelecter,ExpGod)  callfunc_end()  switch(key)  {   case 0:   {    ExpMenu1MoreInfo(Mage,SelectedPlayers,PlayerSelecter,ExpGod)   }   case 1:   {    ExpMenu1ExpGod(Mage,SelectedPlayers,PlayerSelecter,ExpGod)   }   case 9:   {    return PLUGIN_HANDLED   }  }  return PLUGIN_HANDLED }

I tryed this too ...

But it says

unknown command Mage
unknown command SelectedPlayers
unknown command PlayerSelecter
unknown command ExpGod

Can someone please help me with this?
OmgHi is offline
JCobra
Senior Member
Join Date: Mar 2006
Location: Canada
Old 02-02-2007 , 18:32   Re: Saving Menu Variables
Reply With Quote #10

Quote:
Originally Posted by Karma
Hawk552: Flaming n00bs for no reason...
Thanks for pretending to be Hawk, but he doesn't have negative karma. Your spoof failed. And you should be banned for not only giving +Karma to Valdomine or whatever, be you should be shot in the head for calling him a pimp after he said Suzuka was dead.
See post here
OmgHi's Reply
__________________
User has abandoned this account.
JCobra is offline
Send a message via AIM to JCobra
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:35.


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