Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gunxpmod_shop
- public action_item_upgrades(id, key)
- {
- switch(key)
- {
- case 8: display_item_upgrades(id, ++g_menuPosition[id], gSelected[id]);
- case 9: display_item_upgrades(id, --g_menuPosition[id], gSelected[id]);
- default:
- {
- if(!is_user_alive(id))
- return PLUGIN_HANDLED;
- ++key
- new money
- new plugin_id = g_itemindex[gSelected[id]][g_menuPosition[id] * 8 + key]
- new item_id = g_menuPosition[id] * 8 + key
- new func = get_func_id("gxm_item_enabled", plugin_id)
- money = get_user_xp(id)
- new cost = g_itemcost[gSelected[id]][item_id];
- if(money >= cost)
- {
- callfunc_begin_i(func, plugin_id)
- callfunc_push_int(id)
- callfunc_end()
- g_PlayerItem[id][gSelected[id]][item_id] = true
- new overall = money - cost
- set_user_xp(id, overall)
- client_printcolor(id, "/yItem Bought: /g%s.", g_itemname[gSelected[id]][item_id])
- //my code
- send_unlocks_list(id, g_itemname[gSelected[id]][item_id]);
- display_item_upgrades(id, g_menuPosition[id], gSelected[id]);
- }
- }
- }
- return PLUGIN_HANDLED;
- }
- //gunxpmod
- new UnlocksList[33][2048];
- public client_connect(id)
- {
- format(UnlocksList[id], 2047, "^nNone")
- }
- public plugin_natives()
- {
- register_native("send_unlocks_list", "native_send_unlocks_list", 1)
- }
- public task_show_level(task)
- {
- new id = task - TASK_SHOW_LEVEL
- if(!is_user_alive(id) || !get_pcvar_num(show_level_text) || !get_pcvar_num(p_Enabled) )
- return;
- set_hudmessage(0, 127, 255, 0.02, 0.02, 0, 0.0, 0.3, 0.0, 0.0)
- ShowSyncHudMsg(id, g_msgHudSync1 , "%L", LANG_SERVER, "LEVEL_HUD_TEXT", PlayerLevel[id], PlayerXp[id], LEVELS[PlayerLevel[id]], RANK[PlayerLevel[id]], RANKLEVELS[PlayerLevel[id]], UnlocksList[id])
- set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
- }
- public native_send_unlocks_list(id, list[])
- {
- param_convert(2)
- format(UnlocksList[id], 2047, "^n%s", list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement