StefanN

Untitled

Aug 17th, 2013
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.84 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <cstrike>
  4. #include <fakemeta>
  5. #include <engine>
  6. #include <hamsandwich>
  7. #include <colorchat>
  8.  
  9. #define PLUGIN "Deathmatch Vip Advanced"
  10. #define VERSION "1.0"
  11. #define AUTHOR "AMD(Pozajmljen shop i Multijump iz COD Mod-a)"
  12.  
  13. new g_msg_screenfade;
  14.  
  15.  
  16. new const maxAmmo[31]={0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100};
  17.  
  18. new broj_skokova_igraca[33];
  19. new bool:freezetime = true;
  20. new ImaZoom[33]
  21. new cena2
  22.  
  23. public plugin_init()
  24. {
  25. register_plugin(PLUGIN, VERSION, AUTHOR);
  26.  
  27. RegisterHam(Ham_TakeDamage, "player", "OstecenIgrac");
  28. RegisterHam(Ham_Spawn, "player", "spawned", 1)
  29. register_forward(FM_CmdStart, "CmdStart");
  30. register_forward(FM_EmitSound, "EmitSound");
  31.  
  32. register_event("Damage", "Damage", "b", "2!=0");
  33. register_event("CurWeapon","CurWeapon","be", "1=1");
  34. register_clcmd("say /kupi", "Shop");
  35. register_clcmd("say /cena", "cena");
  36. cena2 = register_cvar("amx_cena","2")
  37.  
  38. g_msg_screenfade = get_user_msgid("ScreenFade");
  39. }
  40.  
  41. public spawned(id)
  42. {
  43. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255)
  44. }
  45.  
  46. public plugin_cfg()
  47. {
  48. server_cmd("sv_maxspeed 9999");
  49. }
  50.  
  51. public CmdStart(id, uc_handle)
  52. {
  53. if(!is_user_alive(id))
  54. return FMRES_IGNORED;
  55.  
  56. new button = get_uc(uc_handle, UC_Buttons);
  57. new flags = pev(id, pev_flags);
  58. new oldbutton = pev(id, pev_oldbuttons);
  59.  
  60. if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && broj_skokova_igraca[id] > 0)
  61. {
  62. broj_skokova_igraca[id]--;
  63. new Float:velocity[3];
  64. pev(id, pev_velocity,velocity);
  65. velocity[2] = random_float(265.0,285.0);
  66. set_pev(id, pev_velocity,velocity);
  67. }
  68. else if(get_user_flags(id) & ADMIN_LEVEL_H)
  69. {
  70. if(flags & FL_ONGROUND)
  71. {
  72. broj_skokova_igraca[id] = 0;
  73. if(is_user_alive(id))
  74. broj_skokova_igraca[id]++;
  75. }
  76. }
  77. if(button & IN_ATTACK && get_user_flags(id) & ADMIN_LEVEL_H)
  78. {
  79. new Float:punchangle[3];
  80. new weapon = get_user_weapon(id)
  81. if(weapon == CSW_AK47 || weapon == CSW_M4A1 || weapon == CSW_M249)
  82. {
  83. set_pev(id, pev_punchangle, punchangle);
  84. for(new i=0; i<3;i++)
  85. punchangle[i]*=0.9;
  86. set_pev(id, pev_punchangle, punchangle);
  87. }
  88. }
  89.  
  90. if(get_user_flags(id) & ADMIN_RCON)
  91. {
  92. if(button & IN_DUCK)
  93. {
  94. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 8)
  95. }
  96. else
  97. {
  98. set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255)
  99. }
  100. }
  101.  
  102. if(button & IN_ATTACK2 && !(pev(id, pev_oldbuttons) & IN_ATTACK2) && get_user_flags(id) & ADMIN_RCON)
  103. {
  104. new weapon= get_user_weapon(id)
  105.  
  106. if(weapon == CSW_AK47 && !ImaZoom[id])
  107. {
  108. ImaZoom[id] = true;
  109. cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 1);
  110. emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100);
  111. }
  112.  
  113. else if (ImaZoom[id])
  114. {
  115. ImaZoom[id] = false;
  116. cs_set_user_zoom(id, CS_RESET_ZOOM, 0);
  117. }
  118. }
  119. if(get_user_flags(id) & ADMIN_LEVEL_H)
  120. {
  121. if(button & IN_JUMP && button & IN_DUCK && flags & FL_ONGROUND && get_gametime() > 4.0)
  122. {
  123. new Float:velocity[3];
  124. VelocityByAim(id, 700, velocity);
  125. velocity[2] = random_float(265.0,285.0);
  126. set_pev(id, pev_velocity, velocity);
  127. }
  128. }
  129. return FMRES_IGNORED;
  130. }
  131.  
  132. public Pocetak(id)
  133. {
  134. if(!is_user_alive(id) || !is_user_connected(id))
  135. return PLUGIN_CONTINUE;
  136. new weapons[32];
  137. new weaponsnum;
  138. get_user_weapons(id, weapons, weaponsnum);
  139. for(new i=0; i<weaponsnum; i++)
  140. if(is_user_alive(id))
  141. if(maxAmmo[weapons[i]] > 0)
  142. cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
  143.  
  144. PostaviAtribute(id)
  145.  
  146. return PLUGIN_CONTINUE;
  147. }
  148.  
  149. public PostaviAtribute(id)
  150. {
  151. set_user_health(id,100);
  152. }
  153.  
  154. public OstecenIgrac(this, idinflictor, idattacker, Float:damage, damagebits)
  155. {
  156. if(!is_user_alive(this) || !is_user_connected(this) || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker))
  157. return HAM_IGNORED;
  158.  
  159. new health = get_user_health(this);
  160. new weapon = get_user_weapon(idattacker);
  161.  
  162. if(health < 2)
  163. return HAM_IGNORED;
  164.  
  165. if(weapon == CSW_AWP)
  166. damage=float(health);
  167.  
  168. if(get_user_flags(idattacker) && ADMIN_LEVEL_H)
  169. damage+=100;
  170.  
  171. if((weapon = CSW_DEAGLE))
  172. damage = float(health);
  173.  
  174. return PLUGIN_CONTINUE
  175. }
  176.  
  177. public Damage(id)
  178. {
  179. new attacker = get_user_attacker(id);
  180. if(!is_user_alive(attacker) || !is_user_connected(attacker) || id == attacker )
  181. return PLUGIN_CONTINUE;
  182.  
  183. if(get_user_flags(id) && ADMIN_LEVEL_H)
  184. Display_Fade(id,1<<14,1<<14 ,1<<16,0,200,250,230);
  185.  
  186. return PLUGIN_CONTINUE;
  187. }
  188.  
  189. public Death()
  190. {
  191. new id = read_data(2);
  192. new attacker = read_data(1);
  193. new hp = get_user_health(attacker)
  194.  
  195. if(!is_user_alive(attacker) || !is_user_connected(attacker))
  196. return PLUGIN_CONTINUE;
  197.  
  198.  
  199. if(get_user_team(attacker) != get_user_team(id))
  200. {
  201. set_user_health(attacker, hp + 25)
  202. }
  203. return PLUGIN_CONTINUE;
  204. }
  205.  
  206. public CurWeapon(id)
  207. {
  208. if(freezetime)
  209. return PLUGIN_CONTINUE;
  210.  
  211. new weapons[32];
  212. new weaponsnum;
  213. get_user_weapons(id, weapons, weaponsnum);
  214. for(new i=0; i<weaponsnum; i++)
  215. if(is_user_alive(id))
  216. if(maxAmmo[weapons[i]] > 0)
  217. cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
  218.  
  219. return PLUGIN_CONTINUE;
  220. }
  221.  
  222.  
  223. stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
  224. {
  225. message_begin( MSG_ONE, g_msg_screenfade,{0,0,0},id );
  226. write_short( duration ); // Duration of fadeout
  227. write_short( holdtime ); // Hold time of color
  228. write_short( fadetype ); // Fade type
  229. write_byte ( red ); // Red
  230. write_byte ( green ); // Green
  231. write_byte ( blue ); // Blue
  232. write_byte ( alpha ); // Alpha
  233. message_end();
  234. }
  235.  
  236.  
  237. public plugin_precache()
  238. {
  239. precache_sound("amd/belch.wav")
  240. precache_sound("amd/chipsy.wav")
  241. }
  242.  
  243. public podrigni(id)
  244. {
  245. client_cmd(id, "spk amd/belch")
  246. }
  247. public Shop(id)
  248. {
  249. if(get_user_flags(id) & ADMIN_LEVEL_H)
  250. {
  251. new menu = menu_create("Shop:", "Shop_Handle");
  252. menu_additem(menu, "Mars [Dodaje 15 HP] Cena: 1500$");
  253. menu_additem(menu, "Chipsy [Dodaje 45 HP] Cena: 3000$");
  254. menu_additem(menu, "Pivo [Dodaje 125 HP] Cena: 5000$");
  255. menu_additem(menu, "Nevidljivost Cena: 10000$");
  256. menu_additem(menu, "Mix dodataka Cena: 12000$");
  257. menu_display(id, menu);
  258. }
  259. else
  260. {
  261. ColorChat(id,NORMAL,"^3[Deathmatch Vip]^4 Nazalost nisi Vip,ali uvek mozes da kupis Vip status");
  262. ColorChat(id,NORMAL,"^3[Deathmatch Vip]^4 Da saznas koja je cena Vip statusa,say: /cena");
  263. }
  264. }
  265. public cena(id)
  266. {
  267. ColorChat(id,NORMAL,"^3[Deathmatch Vip]^4 Cena je %i eura", get_pcvar_num(cena2));
  268. }
  269. public Shop_Handle(id, menu, item)
  270. {
  271. if(item == MENU_EXIT)
  272. {
  273. menu_destroy(menu);
  274. return PLUGIN_CONTINUE;
  275. }
  276. menu_display(id, menu);
  277. new hp = get_user_health(id);
  278. new pare_igraca = cs_get_user_money(id);
  279. switch(item)
  280. {
  281. case 0:
  282. {
  283. new cena = 1500;
  284. if (pare_igraca<cena)
  285. {
  286. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Nemas dovoljno para.");
  287. return PLUGIN_CONTINUE;
  288. }
  289. else
  290. {
  291. new ammount=20;
  292. new nova_energija = hp+ammount;
  293. set_user_health(id, nova_energija);
  294. ColorChat(id,GREEN,"[Deathmatch Vip] ^1kupio si ^3Mars");
  295. cs_set_user_money(id, pare_igraca-cena);
  296. menu_destroy(menu);
  297. }
  298. }
  299. case 1:
  300. {
  301. new cena = 3000;
  302. if (pare_igraca<cena)
  303. {
  304. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Nemas dovoljno para.");
  305. return PLUGIN_CONTINUE;
  306. }
  307. else
  308. {
  309. new ammount=50;
  310. new nova_energija = hp+ammount
  311. client_cmd(id, "spk amd/chipsy")
  312. set_user_health(id, nova_energija)
  313. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Kupio si^3 Chipsy");
  314. cs_set_user_money(id, pare_igraca-cena);
  315. menu_destroy(menu);
  316. }
  317. }
  318. case 2:
  319. {
  320. new cena = 5000;
  321. if (pare_igraca<cena)
  322. {
  323. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Nemas dovoljno para.");
  324. return PLUGIN_CONTINUE;
  325. }
  326. else
  327. {
  328. new ammount=100;
  329. new nova_energija = hp+ammount
  330. set_user_health(id, nova_energija);
  331. set_task(2.0, "podrigni")
  332. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Kupio si^3 Pivo");
  333. cs_set_user_money(id, pare_igraca-cena);
  334. menu_destroy(menu);
  335. }
  336. }
  337. case 3:
  338. {
  339. new cena = 10000;
  340. if (pare_igraca<cena)
  341. {
  342. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Nemas dovoljno para.");
  343. return PLUGIN_CONTINUE;
  344. }
  345. else
  346. {
  347. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
  348. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Kupio si^3 Nevidljivost");
  349. cs_set_user_money(id, pare_igraca-cena);
  350. menu_destroy(menu);
  351. }
  352. }
  353. case 4:
  354. {
  355. new cena = 12000;
  356. if (pare_igraca<cena)
  357. {
  358. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Nemas dovoljno para.");
  359. return PLUGIN_CONTINUE;
  360. }
  361. else
  362. {
  363. new ammount=100;
  364. new nova_energija = hp+ammount
  365. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 10);
  366. set_user_health(id, nova_energija);
  367. ColorChat(id,GREEN,"[Deathmatch Vip] ^1Kupio si^3 Mix Dodataka");
  368. cs_set_user_money(id, pare_igraca-cena);
  369. menu_destroy(menu);
  370. }
  371. }
  372. }
  373. return PLUGIN_CONTINUE;
  374. }
Advertisement
Add Comment
Please, Sign In to add comment