Advertisement
Guest User

Untitled

a guest
Jan 15th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <money>
  4. #include <zombieplague>
  5. #include <fun>
  6.  
  7. native zp_get_user_exp(id)
  8. native zp_set_user_exp(id, value)
  9. native get_user_point(id)
  10. native set_user_point(id, value)
  11.  
  12. new count[33]
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin("VIP Menu", "2.0", "S3xTy")
  17. register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
  18. count[0] = 0 // reset buy count for all players
  19. }
  20. public vipmenu( id )
  21. {
  22. if(!(get_user_flags(id) & ADMIN_LEVEL_A))
  23. {
  24. ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
  25. return PLUGIN_HANDLED
  26. }
  27. if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
  28. {
  29. ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
  30. }
  31. else
  32. {
  33. new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
  34. {
  35. menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
  36. }
  37. {
  38. menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
  39. }
  40. {
  41. menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
  42. }
  43. {
  44. menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
  45. }
  46. {
  47. menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
  48. }
  49. menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
  50. menu_display( id, menu, 0 );
  51. }
  52. return PLUGIN_HANDLED;
  53. }
  54. public menu_handler( id, menu, item )
  55. {
  56. switch( item )
  57. {
  58. case 0:
  59. {
  60. new money = zp_cs_get_user_money(id)
  61. if (count[id] >= 1) // change 1 to your max purchase per map
  62. {
  63. ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
  64. return PLUGIN_HANDLED;
  65. }
  66. else
  67. {
  68. zp_cs_set_user_money(id, money + 75000)
  69. }
  70. }
  71. case 1:
  72. {
  73. new points = get_user_point(id)
  74. if (count[id] >= 1) // change 1 to your max purchase per map
  75. {
  76. ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
  77. return PLUGIN_HANDLED;
  78. }
  79. else
  80. {
  81. set_user_point(id, points + 150)
  82. }
  83. }
  84. case 2:
  85. {
  86. new exp = zp_get_user_exp(id)
  87. if (count[id] >= 1) // change 1 to your max purchase per map
  88. {
  89. ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
  90. return PLUGIN_HANDLED;
  91. }
  92. else
  93. {
  94. zp_set_user_exp(id, exp + 250)
  95. }
  96. }
  97. case 3:
  98. {
  99. new hp = get_user_health(id)
  100. if (count[id] >= 1) // change 1 to your max purchase per map
  101. {
  102. ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
  103. return PLUGIN_HANDLED;
  104. }
  105. else
  106. {
  107. set_user_health(id, hp + 250)
  108. }
  109. }
  110. case 4:
  111. {
  112. new ap = get_user_armor(id)
  113. if (count[id] >= 1) // change 1 to your max purchase per map
  114. {
  115. ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
  116. return PLUGIN_HANDLED;
  117. }
  118. else
  119. {
  120. set_user_armor(id, ap + 150)
  121. }
  122. }
  123. }
  124. menu_destroy( menu );
  125. return PLUGIN_HANDLED;
  126. }
  127.  
  128. // Stock: ChatColor!
  129. stock ChatColor(const id, const input[], any:...)
  130. {
  131. new count = 1, players[32]
  132. static msg[191]
  133. vformat(msg, 190, input, 3)
  134.  
  135. replace_all(msg, 190, "!g", "^4") // Green Color
  136. replace_all(msg, 190, "!y", "^1") // Default Color
  137. replace_all(msg, 190, "!t", "^3") // Team Color
  138. replace_all(msg, 190, "!t2", "^0") // Team2 Color
  139.  
  140. if (id) players[0] = id; else get_players(players, count, "ch")
  141. {
  142. for (new i = 0; i < count; i++)
  143. {
  144. if (is_user_connected(players[i]))
  145. {
  146. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  147. write_byte(players[i]);
  148. write_string(msg);
  149. message_end();
  150. }
  151. }
  152. }
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement