| ~Ice*shOt |
06-05-2009 09:29 |
Debug hmmm.
PHP Code:
public HumanUpgrades(id) { if (!is_user_alive(id)) return new menu = menu_create("Humans Abilities", "HumanUpgrades_handle")
if (get_pcvar_num(sg_enable) == 1) { new sgmsg[60] format(sgmsg, 59, "\wSmokeGrenade Level (%d/%d)", SgLevel[id], maxlevel_sg)
menu_additem(menu, sgmsg, "1", 0) }
if(PlayerLevel[id] >= 4 && get_pcvar_num(ap_enable) == 1) { new apmsg[60] format(apmsg, 59, "\wArmor Level (%d/%d)", ArmorLevel[id], maxlevel_ap)
menu_additem(menu, apmsg, "2", 0) }
if (get_pcvar_num(hp_enable) == 1) { new hpmsg[60] format(hpmsg, 59, "\wHealth Level (%d/%d)", HealthLevel[id], maxlevel_hp)
menu_additem(menu, hpmsg, "3", 0) }
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0) }
public HumanUpgrades_handle(id, menu, item) { 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:{ if(PlayerPoints[id] > 0) { if(SgLevel[id] >= maxlevel_sg) { return PLUGIN_HANDLED } SgLevel[id] += 1 client_printcolor(id, "/g+1 /yto /ctrSmokeGrenades Level")
PlayerPoints[id] -= 1 HumanUpgrades(id) } } case 2:{ if(PlayerPoints[id] > 0) { if(ArmorLevel[id] >= maxlevel_ap) { return PLUGIN_HANDLED } ArmorLevel[id] += 1 client_printcolor(id, "/g+1 /yto /ctrArmor Level")
PlayerPoints[id] -= 1 HumanUpgrades(id) } } case 3:{ if(PlayerPoints[id] > 0) { if(HealthLevel[id] >= maxlevel_hp) { return PLUGIN_HANDLED } HealthLevel[id] += 1 client_printcolor(id, "/g+1 /yto /ctrHealth Level")
PlayerPoints[id] -= 1 HumanUpgrades(id) } } } }
What i doing bad ? this print in server console Debug
|