Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. //gunxpmod_shop
  2.  
  3. public action_item_upgrades(id, key)
  4. {
  5. switch(key)
  6. {
  7. case 8: display_item_upgrades(id, ++g_menuPosition[id], gSelected[id]);
  8. case 9: display_item_upgrades(id, --g_menuPosition[id], gSelected[id]);
  9. default:
  10. {
  11. if(!is_user_alive(id))
  12. return PLUGIN_HANDLED;
  13.  
  14. ++key
  15. new money
  16. new plugin_id = g_itemindex[gSelected[id]][g_menuPosition[id] * 8 + key]
  17. new item_id = g_menuPosition[id] * 8 + key
  18. new func = get_func_id("gxm_item_enabled", plugin_id)
  19.  
  20. money = get_user_xp(id)
  21. new cost = g_itemcost[gSelected[id]][item_id];
  22.  
  23. if(money >= cost)
  24. {
  25. callfunc_begin_i(func, plugin_id)
  26. callfunc_push_int(id)
  27. callfunc_end()
  28.  
  29. g_PlayerItem[id][gSelected[id]][item_id] = true
  30.  
  31. new overall = money - cost
  32. set_user_xp(id, overall)
  33. client_printcolor(id, "/yItem Bought: /g%s.", g_itemname[gSelected[id]][item_id])
  34. //my code
  35. send_unlocks_list(id, g_itemname[gSelected[id]][item_id]);
  36.  
  37. display_item_upgrades(id, g_menuPosition[id], gSelected[id]);
  38. }
  39. }
  40. }
  41. return PLUGIN_HANDLED;
  42. }
  43.  
  44.  
  45.  
  46.  
  47. //gunxpmod
  48. new UnlocksList[33][2048];
  49.  
  50. public client_connect(id)
  51. {
  52. format(UnlocksList[id], 2047, "^nNone")
  53. }
  54.  
  55. public plugin_natives()
  56. {
  57. register_native("send_unlocks_list", "native_send_unlocks_list", 1)
  58. }
  59.  
  60. public task_show_level(task)
  61. {
  62. new id = task - TASK_SHOW_LEVEL
  63. if(!is_user_alive(id) || !get_pcvar_num(show_level_text) || !get_pcvar_num(p_Enabled) )
  64. return;
  65. set_hudmessage(0, 127, 255, 0.02, 0.02, 0, 0.0, 0.3, 0.0, 0.0)
  66. 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])
  67. set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
  68. }
  69.  
  70. public native_send_unlocks_list(id, list[])
  71. {
  72. param_convert(2)
  73. format(UnlocksList[id], 2047, "^n%s", list);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement