Raised This Month: $ Target: $400
 0% 

how to get back the unknown string of two public ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lucky109
Senior Member
Join Date: Jan 2005
Old 06-25-2007 , 10:22   Re: how to get back the unknown string of two public ?
Reply With Quote #7

Quote:
Originally Posted by Alka View Post
Dunno what you'r tryng to do , or what you talking about!

why?If you want to have more put any number to 99! This "%d" (integer) is to show the number!
i'm making something with mysql...
i have two table in mysql (db = test):

number | name
 5    Sam
 45    Paul
 67   Sam

Code:
public plugin_init() {
	register_clcmd("test","ShowMenu", -1, "show est menu")
	register_menucmd(register_menuid("\yTest Menu"), 1023, "MenuCommand")


public ShowMenu(id)
{
   new CSName[32];
   get_user_name(id, CSName, 31);
   result = dbi_query(dbc,"SELECT * FROM `test` WHERE `name` = '%s'", CSName)

   new szMenuBody[256]
   new keys

   new nLen = format( szMenuBody, 255, "\wTest Menu:^n" )

   new number[64];
   for (new i=1;i<=dbi_num_rows(result);i++)
   {
   dbi_nextrow(result)
   dbi_result(result,"number",number,63)
   nLen += format( szMenuBody[nLen], 255-nLen, "^n\w%d. %s",i,number)
   }

   keys = (1<<0|1<<1)

   show_menu( id, keys, szMenuBody, -1 )
   return PLUGIN_CONTINUE
}

public MenuCommand( id, key )
{
   switch( key )
   {
       case 0: how can i get the result number if the player choose case0?
       case 1: how can i get the result inumber f the player choose case1?
   } 
   return PLUGIN_HANDLED
}
example:
one player connect server , he's name called "Sam"
type "test" in console...it's show menu like:

1. 5
2. 67

if he press 1 , case 0 i want to get the number 5
if he press 2 , case 1 i want to get the number 67

sorry...my bad english....thanks

Last edited by lucky109; 06-25-2007 at 10:58.
lucky109 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 21:30.


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