Well,
Following code directly choose team to random.
If we could set team here it will be good.
How could i make it as given in first post?
PHP Code:
public menu_handler(id, menu, item)
{
new team = get_user_team(id)
if (item == MENU_EXIT) {
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
engclient_cmd(id, "jointeam", "1")
engclient_cmd(id, "menuselect", "5")
ct(id)
}
case 2:
{
engclient_cmd(id, "jointeam", "2")
engclient_cmd(id, "menuselect","5")
tteam(id)
}
case 5:
{
menu_handler(id, menu, random_num(0, 1))
}
case 6:
{
engclient_cmd(id, "jointeam", "6")
}
}
show_menu(id, 0, " ", 0)
return PLUGIN_HANDLED
}
I want that team choose in middle of that!
"random" is not model, "random" is type of selection from boy class or girl class.
Code:
case 3:
{
cs_reset_user_model(id)
cs_set_user_model(id, "Ramdom")
}
__________________