Guest User

12d12d1

a guest
Mar 25th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 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, "weapon_flashbang")
  120. //give_item(player, "weapon_smokegrenade")
  121. give_item(player, "item_assaultsuit")
  122. give_item(player, "item_thighpack")
  123.  
  124. if (!get_pcvar_num(g_menu_active))
  125. return PLUGIN_CONTINUE
  126.  
  127. if(CurrentRound >= 3)
  128. {
  129. Showrod(player);
  130. }
  131. }
  132. }
  133. return PLUGIN_HANDLED
  134. }
  135.  
  136. public turn_vip_off() {
  137. canUse = 0;
  138. }
  139.  
  140. public Event_RoundRestart()
  141. {
  142. CurrentRound=0;
  143. }
  144.  
  145. public hook_death()
  146. {
  147. // Killer id
  148. nKiller = read_data(1)
  149.  
  150. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  151. {
  152. nHp_add = get_pcvar_num (health_hs_add)
  153. }
  154. else {
  155. nHp_add = get_pcvar_num (health_add)
  156. }
  157.  
  158.  
  159. nHp_max = get_pcvar_num (health_max)
  160. // Updating Killer HP
  161. if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H) && (canUse == 0))
  162. return;
  163.  
  164. nKiller_hp = get_user_health(nKiller)
  165. nKiller_hp += nHp_add
  166. // Maximum HP check
  167. if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
  168. set_user_health(nKiller, nKiller_hp)
  169. // Hud message "Healed +15/+30 hp"
  170. set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  171. show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
  172. // Screen fading
  173. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
  174. write_short(1<<10)
  175. write_short(1<<10)
  176. write_short(0x0000)
  177. write_byte(0)
  178. write_byte(0)
  179. write_byte(200)
  180. write_byte(75)
  181. message_end()
  182.  
  183. }
  184.  
  185. public Showrod(id) {
  186. show_menu(id, Keysrod, "Free VIP Guns^n\w1. Get M4A1+Deagle ^n\w2. Get AK47+Deagle^n0. Exit^n", -1, "rod") // Display menu
  187. }
  188. public Pressedrod(id, key) {
  189. /* Menu:
  190. * VIP Menu
  191. * 1. Get M4A1+Deagle
  192. * 2. Get AK47+Deagle
  193. * 0. Exit
  194. */
  195. switch (key) {
  196. case 0: {
  197. if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  198. HasC4[id] = true;
  199. else
  200. HasC4[id] = false;
  201.  
  202. strip_user_weapons (id)
  203. give_item(id,"weapon_m4a1")
  204. give_item(id,"ammo_556nato")
  205. give_item(id,"ammo_556nato")
  206. give_item(id,"ammo_556nato")
  207. give_item(id,"weapon_deagle")
  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,"ammo_50ae")
  215. give_item(id,"weapon_knife")
  216. give_item(id,"weapon_hegrenade")
  217. give_item(id, "weapon_flashbang");
  218. give_item(id, "weapon_flashbang");
  219. //give_item(id, "weapon_smokegrenade");
  220. give_item(id, "item_assaultsuit");
  221. give_item(id, "item_thighpack");
  222. client_print(id, print_center, "You Taked Free M4A1 and Deagle")
  223.  
  224. if (HasC4[id])
  225. {
  226. give_item(id, "weapon_c4");
  227. cs_set_user_plant( id );
  228. }
  229. }
  230. case 1: {
  231. if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
  232. HasC4[id] = true;
  233. else
  234. HasC4[id] = false;
  235.  
  236. strip_user_weapons (id)
  237. give_item(id,"weapon_ak47")
  238. give_item(id,"ammo_762nato")
  239. give_item(id,"ammo_762nato")
  240. give_item(id,"ammo_762nato")
  241. give_item(id,"weapon_deagle")
  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,"ammo_50ae")
  247. give_item(id,"ammo_50ae")
  248. give_item(id,"ammo_50ae")
  249. give_item(id,"weapon_knife")
  250. give_item(id,"weapon_hegrenade")
  251. give_item(id, "weapon_flashbang");
  252. give_item(id, "weapon_flashbang");
  253. //give_item(id, "weapon_smokegrenade");
  254. give_item(id, "item_assaultsuit");
  255. give_item(id, "item_thighpack");
  256. client_print(id, print_center, "You Taked Free AK47 and Deagle")
  257.  
  258. if (HasC4[id])
  259. {
  260. give_item(id, "weapon_c4");
  261. cs_set_user_plant( id );
  262. }
  263. }
  264. case 9: {
  265. }
  266. }
  267. return PLUGIN_CONTINUE
  268. }
  269.  
  270. public HandleCmd(id){
  271. if (!get_pcvar_num(g_awp_active))
  272. return PLUGIN_CONTINUE
  273. if(get_user_flags(id) & ADMIN_LEVEL_H)
  274. return PLUGIN_CONTINUE
  275. client_print(id, print_center, "Sniper's Only For VIP's")
  276. return PLUGIN_HANDLED
  277. }
  278.  
  279. public ShowMotd(id)
  280. {
  281. show_motd(id, "vip.txt")
  282. }
  283. public client_authorized(id)
  284. {
  285. set_task(30.0, "PrintText" ,id)
  286. }
  287. public PrintText(id)
  288. {
  289. client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
  290. }
  291.  
  292. public handle_say(id) {
  293. new said[192]
  294. read_args(said,192)
  295. if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
  296. set_task(0.1,"print_adminlist",id)
  297. return PLUGIN_CONTINUE
  298. }
  299.  
  300. public print_adminlist(user)
  301. {
  302. new adminnames[33][32]
  303. new message[256]
  304. new contactinfo[256], contact[112]
  305. new id, count, x, len
  306.  
  307. for(id = 1 ; id <= maxplayers ; id++)
  308. if(is_user_connected(id))
  309. if(get_user_flags(id) & ADMIN_LEVEL_H)
  310. get_user_name(id, adminnames[count++], 31)
  311.  
  312. len = format(message, 255, "%s VIP ONLINE: ",COLOR)
  313. if(count > 0) {
  314. for(x = 0 ; x < count ; x++) {
  315. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  316. if(len > 96 ) {
  317. print_message(user, message)
  318. len = format(message, 255, "%s ",COLOR)
  319. }
  320. }
  321. print_message(user, message)
  322. }
  323. else {
  324. len += format(message[len], 255-len, "No VIP online.")
  325. print_message(user, message)
  326. }
  327.  
  328. get_cvar_string("amx_contactinfo", contact, 63)
  329. if(contact[0]) {
  330. format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  331. print_message(user, contactinfo)
  332. }
  333. }
  334.  
  335. print_message(id, msg[]) {
  336. message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  337. write_byte(id)
  338. write_string(msg)
  339. message_end()
  340. }
Advertisement
Add Comment
Please, Sign In to add comment