Quote:
Originally Posted by Alka
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