tot nu mere cred ca are trb cu:
Code: Select all
menu_wpn(id)
{
new title[64], typewpn = TYPE_WPN
if (typewpn == NST_WPN_RIFLES) format(title, charsmax(title), "[%L] %L:", LANG_PLAYER, "MENU_TITLE_SHOP", LANG_PLAYER, "MENU_TITLE_RIFLES")
else if (typewpn == NST_WPN_PISTOLS) format(title, charsmax(title), "[%L] %L:", LANG_PLAYER, "MENU_TITLE_SHOP", LANG_PLAYER, "MENU_TITLE_PISTOLS")
new mHandleID = menu_create(title, "menu_wpn_handler")
new i, check_value = 1
while (check_value && i<MAX_WPN)
{
if ( (!nst_wpn_mywpn() && !nst_wpn_get_canbuy_team_mod() && c_team[i] && get_user_team(id)!=c_team[i]) || !c_buy[i])
{
i++
continue;
}
if (c_wpnchange[i] <= 0) check_value = 0
if (check_value)
{
new wpn_cost = c_cost[i]
new item_name[150], idwpn[32]
format(item_name, 149, "%s: %i$", c_name[i], wpn_cost)
format(idwpn, 31, "%i", i)
new user_money, check_money
user_money = cs_get_user_money(id)
if (user_money<wpn_cost && !nst_wpn_mywpn()) check_money = 1
menu_additem(mHandleID, item_name, idwpn, check_money)
}
i++
}
menu_display(id, mHandleID, 0)
}
si
Code: Select all
public menu_mywpn(id, type)
{
new title[64], fun_name[32], typewpn = TYPE_WPN
if (typewpn == NST_WPN_RIFLES) format(title, charsmax(title), "[%L] %L:", LANG_PLAYER, "MENU_TITLE_MYWPN", LANG_PLAYER, "MENU_TITLE_RIFLES")
else if (typewpn == NST_WPN_PISTOLS) format(title, charsmax(title), "[%L] %L:", LANG_PLAYER, "MENU_TITLE_MYWPN", LANG_PLAYER, "MENU_TITLE_PISTOLS")
if (type==NST_MENUWPN_MYWPN) format(fun_name, charsmax(fun_name), "menu_editmywpn_handler")
else format(fun_name, charsmax(fun_name), "menu_mywpn_handler")
new mHandleID = menu_create(title, fun_name)
for (new i=0; i<MAX_MYWPN; i++)
{
new idwpn
if (type==NST_MENUWPN_MYWPN) idwpn = g_mywpn[i]
else idwpn = get_idwpn_from_model(g_mywpn_cache[i])
if (!idwpn || !c_wpnchange[idwpn] || !c_buy[idwpn]) continue;
if (type!=NST_MENUWPN_MYWPN && !nst_wpn_get_canbuy_team_mod() && c_team[idwpn] && get_user_team(id)!=c_team[idwpn])
continue;
new wpn_cost = c_cost[idwpn]
new item_name[128], idweapon[32]
format(item_name, charsmax(item_name), "%s: %i$", c_name[idwpn], wpn_cost)
format(idweapon, charsmax(idweapon), "%i", idwpn)
new user_money, check_money
user_money = cs_get_user_money(id)
if (user_money<wpn_cost) check_money = 1
menu_additem(mHandleID, item_name, idweapon, check_money)
}
menu_display(id, mHandleID, 0)
}