Thanks.
Code:
if(StrEqual(item, command_1, false))
{
strcopy(tab_command[param1], 32, command_1);
}
else if(StrEqual(item, command_2, false))
{
strcopy(tab_command[param1], 32, command_2);
}
else if(StrEqual(item, command_3, false))
{
strcopy(tab_command[param1], 32, command_3);
}
else if(StrEqual(item, command_4, false))
{
strcopy(tab_command[param1], 32, command_4);
}
else if(StrEqual(item, command_5, false))
{
strcopy(tab_command[param1], 32, command_5);
}
you can cut to:
Code:
strcopy(tab_command[param1], sizeof(tab_command[]), item);
Code:
strcopy(tab_command[param1], 32, command_6);
>>>
Code:
tab_command[param1][0] = '\0';
All code could be cut to 1/2 size. All menus can be "packed" to 1. You can just create one more global variable g_iClientChoose[MAXPLAYERS+1] (int or string) and store there currently selected item. Next, in the final menu handler you can check that variable and such a way you know what string array you need to copy item to.
Also, instead of FindConVar you can use globally declared handles (ConVar). Just assign values returned by CreateConVar. Usually, for that kind of job people use HookConVarChange instead of OnMapStart.
__________________