Hi Guys,
So just to explain, what I am trying to do is have a menu of weapons with different skins available for players if they have purchased it.
Problem I have is that if I select Carbon from the menu but I don't have Burner available then I will receive model Burner rather than Carbon. Simply because if I don't have option Burner than option Carbon is first and responds to case 0. How do I show things in the menu but don't let players choose it unless my condition is met?
I know I am confusing but I cannot explain it clearer. Please ask questions, I will answer all of them for help
.
Code:
public display_pistolet(id)
{
new g_Menu = menu_create("Wybierz swoj \rGLOCK!", "glock_handle");
if(Burner1[id] > 0){
menu_additem(g_Menu, "\wBurner^n" );
}
if(Carbon1[id] > 0){
menu_additem(g_Menu, "\wCarbon", "", 0);
}
if(Crimson1[id] > 0){
menu_additem(g_Menu, "\wCrimson", "", 0);
}
if(Gradient1[id] > 0){
menu_additem(g_Menu, "\wGradient", "", 0);
}
if(Krolewski1[id] > 0){
menu_additem(g_Menu, "\wKrolewksi", "", 0);
}
menu_additem(g_Menu, "\wStandardowy\w^n" );
menu_addtext(g_Menu, "Odwiedz nas na \rProjektSpark.pl^n" , 0 );
menu_setprop(g_Menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(g_Menu, MPROP_BACKNAME, "Wroc");
menu_setprop(g_Menu, MPROP_NEXTNAME, "Nastepna Strona");
menu_setprop(g_Menu, MPROP_EXITNAME, "Wyjdz");
menu_setprop(g_Menu, MPROP_NOCOLORS, 1);
menu_display(id, g_Menu, 0);
return PLUGIN_HANDLED;
}
public glock_handle(id, menu, item)
{
if(is_user_connected( id ))
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item)
{
case 0: SetGlock( id , Glocks:Burner );
case 1: SetGlock( id , Glocks:Carbon );
case 2: SetGlock( id , Glocks:Crimson );
case 3: SetGlock( id , Glocks:Gradient );
case 4: SetGlock( id , Glocks:Krolewski );
case 5: SetGlock( id , Glocks:Standardowy );
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}