Advertisement
Guest User

Untitled

a guest
Feb 11th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.75 KB | None | 0 0
  1. #define DAMAGE_RECIEVED
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. static const COLOR[] = "^x04" //green
  8. static const CONTACT[] = ""
  9. new maxplayers
  10. new gmsgSayText
  11. new mpd, mkb, mhb
  12. new g_MsgSync
  13. new health_add
  14. new health_hs_add
  15. new health_max
  16. new nKiller
  17. new nKiller_hp
  18. new nHp_add
  19. new nHp_max
  20. new g_awp_active
  21. new g_menu_active
  22. new CurrentRound
  23. new bool:HasC4[33]
  24. new canUse = 0;
  25. #define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
  26. #if defined DAMAGE_RECIEVED
  27. new g_MsgSync2
  28. #endif
  29.  
  30. public plugin_init()
  31. {
  32. register_plugin("VIP Eng Version", "3.0", "Dunno")
  33. mpd = register_cvar("money_per_damage","3")
  34. mkb = register_cvar("money_kill_bonus","200")
  35. mhb = register_cvar("money_hs_bonus","500")
  36. health_add = register_cvar("amx_vip_hp", "15")
  37. health_hs_add = register_cvar("amx_vip_hp_hs", "30")
  38. health_max = register_cvar("amx_vip_max_hp", "100")
  39. g_awp_active = register_cvar("awp_active", "1")
  40. g_menu_active = register_cvar("menu_active", "1")
  41. register_event("Damage","Damage","b")
  42. register_event("DeathMsg","death_msg","a")
  43. register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
  44. register_clcmd("awp","HandleCmd")
  45. register_clcmd("sg550","HandleCmd")
  46. register_clcmd("g3sg1","HandleCmd")
  47. register_clcmd("say /wantvip","ShowMotd")
  48. maxplayers = get_maxplayers()
  49. gmsgSayText = get_user_msgid("SayText")
  50. register_clcmd("say", "handle_say")
  51. register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
  52. register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
  53. register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
  54. register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
  55. register_event("DeathMsg", "hook_death", "a", "1>0")
  56. register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
  57. g_MsgSync = CreateHudSyncObj()
  58. #if defined DAMAGE_RECIEVED
  59. g_MsgSync2 = CreateHudSyncObj()
  60. #endif
  61. }
  62.  
  63. public on_damage(id)
  64. {
  65. new attacker = get_user_attacker(id)
  66.  
  67. #if defined DAMAGE_RECIEVED
  68. // id should be connected if this message is sent, but lets check anyway
  69. if ( is_user_connected(id) && is_user_connected(attacker) )
  70. if (get_user_flags(attacker) & ADMIN_LEVEL_H)
  71. {
  72. new damage = read_data(2)
  73.  
  74. set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
  75. ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
  76. #else
  77. if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
  78. {
  79. new damage = read_data(2)
  80. #endif
  81. set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
  82. ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
  83. }
  84. }
  85.  
  86. public Damage(id)
  87. {
  88. new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
  89. if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
  90. if (get_user_flags(attacker) & ADMIN_LEVEL_H)
  91. {
  92. if(canUse) {
  93. new money = read_data(2) * get_pcvar_num(mpd)
  94. if(hitpoint==1) money += get_pcvar_num(mhb)
  95. cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
  96. }
  97. }
  98. }
  99.  
  100. public death_msg()
  101. {
  102. if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  103. }
  104.  
  105. public LogEvent_RoundStart()
  106. {
  107. canUse = 1;
  108. set_task(10.0, "turn_vip_off");
  109. CurrentRound++;
  110. new players[32], player, pnum;
  111. get_players(players, pnum, "a");
  112. for(new i = 0; i < pnum; i++)
  113. {
  114. player = players[i];
  115. if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
  116. {
  117. give_item(player, "weapon_hegrenade")
  118. give_item(player, "weapon_flashbang")
  119. give_item(player, "item_assaultsuit")
  120. give_item(player, "item_thighpack")
  121.  
  122. if (!get_pcvar_num(g_menu_active))
  123. return PLUGIN_CONTINUE
  124.  
  125. if(CurrentRound >= 3)
  126. {
  127. Showrod(player);
  128. }
  129. }
  130. }
  131. return PLUGIN_HANDLED
  132. }
  133.  
  134. public turn_vip_off() {
  135. canUse = 0;
  136. }
  137.  
  138. public Event_RoundRestart()
  139. {
  140. CurrentRound=0;
  141. }
  142.  
  143. public hook_death()
  144. {
  145. // Killer id
  146. nKiller = read_data(1)
  147.  
  148. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  149. {
  150. nHp_add = get_pcvar_num (health_hs_add)
  151. }
  152. else {
  153. nHp_add = get_pcvar_num (health_add)
  154. }
  155.  
  156.  
  157. nHp_max = get_pcvar_num (health_max)
  158. // Updating Killer HP
  159. if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H) && (canUse == 0))
  160. return;
  161.  
  162. nKiller_hp = get_user_health(nKiller)
  163. nKiller_hp += nHp_add
  164. // Maximum HP check
  165. if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  166. set_user_health(nKiller, nKiller_hp)
  167. // Hud message "Healed +15/+30 hp"
  168. set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  169. show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
  170. // Screen fading
  171. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  172. write_short(1<<10)
  173. write_short(1<<10)
  174. write_short(0x0000)
  175. write_byte(0)
  176. write_byte(0)
  177. write_byte(200)
  178. write_byte(75)
  179. message_end()
  180.  
  181. }
  182.  
  183. public Showrod(id) {
  184. show_menu(id, Keysrod, "Free VIP Guns^n\w1. Get M4A1+Deagle ^n\w2. Get AK47+Deagle^n0. Exit^n", -1, "rod") // Display menu
  185. }
  186. public Pressedrod(id, key) {
  187. /* Menu:
  188. * VIP Menu
  189. * 1. Get M4A1+Deagle
  190. * 2. Get AK47+Deagle
  191. * 0. Exit
  192. */
  193. if(!canUse) return 0;
  194. switch (key) {
  195. case 0: {
  196. if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  197. HasC4[id] = true;
  198. else
  199. HasC4[id] = false;
  200.  
  201. strip_user_weapons (id)
  202. give_item(id,"weapon_m4a1")
  203. give_item(id,"ammo_556nato")
  204. give_item(id,"ammo_556nato")
  205. give_item(id,"ammo_556nato")
  206. give_item(id,"weapon_deagle")
  207. give_item(id,"ammo_50ae")
  208. give_item(id,"ammo_50ae")
  209. give_item(id,"ammo_50ae")
  210. give_item(id,"ammo_50ae")
  211. give_item(id,"ammo_50ae")
  212. give_item(id,"ammo_50ae")
  213. give_item(id,"ammo_50ae")
  214. give_item(id,"weapon_knife")
  215. give_item(id,"weapon_hegrenade")
  216. give_item(id, "weapon_flashbang");
  217. give_item(id, "item_assaultsuit");
  218. give_item(id, "item_thighpack");
  219. client_print(id, print_center, "You Taked Free M4A1 and Deagle")
  220.  
  221. if (HasC4[id])
  222. {
  223. give_item(id, "weapon_c4");
  224. cs_set_user_plant( id );
  225. }
  226. }
  227. case 1: {
  228. if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  229. HasC4[id] = true;
  230. else
  231. HasC4[id] = false;
  232.  
  233. strip_user_weapons (id)
  234. give_item(id,"weapon_ak47")
  235. give_item(id,"ammo_762nato")
  236. give_item(id,"ammo_762nato")
  237. give_item(id,"ammo_762nato")
  238. give_item(id,"weapon_deagle")
  239. give_item(id,"ammo_50ae")
  240. give_item(id,"ammo_50ae")
  241. give_item(id,"ammo_50ae")
  242. give_item(id,"ammo_50ae")
  243. give_item(id,"ammo_50ae")
  244. give_item(id,"ammo_50ae")
  245. give_item(id,"ammo_50ae")
  246. give_item(id,"weapon_knife")
  247. give_item(id,"weapon_hegrenade")
  248. give_item(id, "weapon_flashbang");
  249. give_item(id, "item_assaultsuit");
  250. give_item(id, "item_thighpack");
  251. client_print(id, print_center, "You Taked Free AK47 and Deagle")
  252.  
  253. if (HasC4[id])
  254. {
  255. give_item(id, "weapon_c4");
  256. cs_set_user_plant( id );
  257. }
  258. }
  259. case 9: {
  260. }
  261. }
  262. return PLUGIN_CONTINUE
  263. }
  264.  
  265. public HandleCmd(id){
  266. if (!get_pcvar_num(g_awp_active))
  267. return PLUGIN_CONTINUE
  268. if(get_user_flags(id) & ADMIN_LEVEL_H)
  269. return PLUGIN_CONTINUE
  270. client_print(id, print_center, "Sniper's Only For VIP's")
  271. return PLUGIN_HANDLED
  272. }
  273.  
  274. public ShowMotd(id)
  275. {
  276. show_motd(id, "vip.txt")
  277. }
  278. public client_authorized(id)
  279. {
  280. set_task(30.0, "PrintText" ,id)
  281. }
  282. public PrintText(id)
  283. {
  284. client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
  285. }
  286.  
  287. public handle_say(id) {
  288. new said[192]
  289. read_args(said,192)
  290. if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
  291. set_task(0.1,"print_adminlist",id)
  292. return PLUGIN_CONTINUE
  293. }
  294.  
  295. public print_adminlist(user)
  296. {
  297. new adminnames[33][32]
  298. new message[256]
  299. new contactinfo[256], contact[112]
  300. new id, count, x, len
  301.  
  302. for(id = 1 ; id <= maxplayers ; id++)
  303. if(is_user_connected(id))
  304. if(get_user_flags(id) & ADMIN_LEVEL_H)
  305. get_user_name(id, adminnames[count++], 31)
  306.  
  307. len = format(message, 255, "%s VIP ONLINE: ",COLOR)
  308. if(count > 0) {
  309. for(x = 0 ; x < count ; x++) {
  310. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  311. if(len > 96 ) {
  312. print_message(user, message)
  313. len = format(message, 255, "%s ",COLOR)
  314. }
  315. }
  316. print_message(user, message)
  317. }
  318. else {
  319. len += format(message[len], 255-len, "No VIP online.")
  320. print_message(user, message)
  321. }
  322.  
  323. get_cvar_string("amx_contactinfo", contact, 63)
  324. if(contact[0]) {
  325. format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  326. print_message(user, contactinfo)
  327. }
  328. }
  329.  
  330. print_message(id, msg[]) {
  331. message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  332. write_byte(id)
  333. write_string(msg)
  334. message_end()
  335. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement