Cvar crash + auto show
Okay, when I change the cvar that gives health. And I press on the menu I changed the health value to it crashes :S code:
PHP Code:
if( get_pcvar_num(Flashbang_on) == 1) { new health = get_pcvar_num(flashhealth); give_item( id, "weapon_flashbang" ) give_item( id, "weapon_flashbang" ) set_user_health(id, health) g_AlreadyUsed[id] = true ColorChat(id, RED, "[NadeSelector] ^x04You received 2 flashbangs and ", get_pcvar_num(flashhealth), " health");
I also want to do my plugin so that the menu show up when the round start.
PHP Code:
public round_start(id) { ColorChat(0, RED, "[NadeSelector] ^x04Type /grenades to choose your grenades!"); }
public cmdSelectItem(id) { menu = menu_create("\rChoose Item:", "playerMenu_ShowSelectionHandler"); menu_additem(menu, "\wFrostnade", "1", 0); menu_additem(menu, "\w2 Flashbangs +50 Health", "2", 0); menu_additem(menu, "\wHE grenade +75 Health", "3", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); if( get_user_team(id) == 1 ) if(!g_AlreadyUsed[id]) menu_display(id, menu, 0); else ColorChat(id, RED, "[NadeSelector] ^x04You already choosed a grenade this round.") else ColorChat(id, RED, "[NadeSelector] ^x04You need to be a hider, to choose grenades!") return PLUGIN_CONTINUE; }
The menu shall only auto open for terrorist
|