Quote:
Originally Posted by jimaway
just store the model file name in the item info string
|
That didn't work. Can you show me exactly how?
Here is how the models are displayed :
Code:
case 0:
{
new menu_model = menu_create("Models Menu", "mh_MMenu")
for (new i; (i < file_size(conffile_model, 1)); i++)
{
read_file(conffile_model, i, file_model, 127, leng)
menu_additem(menu_model, file_model, "", 0);
}
menu_setprop(menu_model, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu_model, MPROP_BACKNAME, "Back");
menu_setprop(menu_model, MPROP_NEXTNAME, "Next");
menu_setprop(menu_model, MPROP_EXITNAME, "Close");
menu_destroy(menu);
menu_display(id, menu_model, 0);
}
The problem goes here :
Code:
public mh_MMenu(id, menu_model, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu_model, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch (item)
{
case 0:
{
read_file(conffile_model, item, file_model, 127, leng)
tfc_setmodel(id,file_model,"0");
client_print(id, print_chat, "You changed the player model to %s.", file_model);
}
}
menu_destroy(menu_model);
return PLUGIN_CONTINUE;
}
I tried replacing the item as u said, but with no luck, so I changed it back.