Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.06 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < engine >
  4. #include < fun >
  5. #include < xs >
  6. #include < cstrike >
  7. #include < fakemeta >
  8. #include < hamsandwich >
  9.  
  10.  
  11. #define PLUGIN "VIP Menu"
  12. #define VERSION "1.0"
  13.  
  14. // -- || Score TAB || -- //
  15. enum {
  16. SCOREATTRIB_ARG_PLAYERID = 1,
  17. SCOREATTRIB_ARG_FLAGS
  18. };
  19.  
  20. enum ( <<= 1 ) {
  21. SCOREATTRIB_FLAG_NONE = 0,
  22. SCOREATTRIB_FLAG_DEAD = 1,
  23. SCOREATTRIB_FLAG_BOMB,
  24. SCOREATTRIB_FLAG_VIP
  25. };
  26.  
  27.  
  28. #define VIP ADMIN_LEVEL_G
  29. #define IsPlayer(%0) (1 <= %0 <= g_iMaxPlayers)
  30. new g_iMaxPlayers;
  31.  
  32. // -- || Variabil's
  33. new SuperKnife[33], Speed[33], Gravity[33], Round[33], HasPower[33];
  34.  
  35. // -- || Constante
  36. new const v_superknife [ 64 ] = "models/v_sk3.mdl";
  37.  
  38. // -- || Power
  39.  
  40. //--| GodMode |--//
  41. new GodMode_Cooldown[33] = 0;
  42. new GodMode_DurationCooldown[33] = 0;
  43.  
  44. //--| Teleport |--//
  45. new TeleportSprite, TeleportSprite2;
  46. new Teleport_Cooldown[33];
  47. new const SOUND_BLINK[] = { "weapons/flashbang-1.wav" };
  48. const UNIT_SEC = 0x1000;
  49. const FFADE = 0x0000;
  50.  
  51. //------| Suicide Bomb |------//
  52. new SPR_SUICIDE_EXPLODE, SPR_SUICIDE_SMOKE, SPR_SUICIDE_BLAST
  53.  
  54. #define EXPLOSION_MAX_DAMAGE 100.0
  55. #define EXPLOSION_KNOCKBACK 5.0
  56. #define EXPLOSION_BLAST_RADIUS 250.0
  57.  
  58. #define TASK_EXPLOSION 160
  59. #define TASK_BEAMCYLINDER 192
  60.  
  61. #define SOUND_SUICIDE "ambience/particle_suck1.wav"
  62. new BloodSpray, BloodDrop;
  63.  
  64. // -- | Cvars | -- //
  65. new speed, gravity, cvar_he;
  66. new CvarGodModeCooldown, CvarGodModeDuration, CvarTeleportCooldown, CvarTeleportRange;
  67.  
  68. public plugin_init() {
  69. register_plugin(PLUGIN, VERSION, "Truth");
  70.  
  71. // Cvar's
  72. speed = register_cvar("vip_menu_speed", "400.0");
  73. gravity = register_cvar("vip_menu_gravity", "0.7");
  74. cvar_he = register_cvar("vip_menu_he", "3");
  75. CvarGodModeCooldown = register_cvar("vip_godmode_cooldown", "25"); // GodMode Cooldown
  76. CvarGodModeDuration = register_cvar("vip_godmode_duration", "2"); // GodMode Duration
  77. CvarTeleportCooldown = register_cvar("vip_teleport_cooldown", "10.0"); // Teleport Cooldown
  78. CvarTeleportRange = register_cvar("vip_teleport_range", "12345"); // Teleport Range
  79.  
  80. register_clcmd("say", "handle_say");
  81. register_clcmd("say_team", "handle_say");
  82.  
  83. register_clcmd("say /wantvip", "VIPHTML");
  84. register_clcmd("say_team /wantvip", "VIPHTML");
  85.  
  86. register_clcmd("say /furienvip", "VipCmd");
  87. register_clcmd("say_team /furienvip", "VipCmd");
  88.  
  89. register_clcmd("power", "Power");
  90.  
  91. register_event("CurWeapon", "CurrWeapon", "be", "1=1");
  92. register_event("DeathMsg", "EVENT_Death", "a");
  93.  
  94. RegisterHam(Ham_Spawn, "player", "Spawn", true);
  95. RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage");
  96. g_iMaxPlayers = get_maxplayers( );
  97.  
  98. register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
  99. // Add your code here...
  100. }
  101.  
  102. public plugin_precache() {
  103. precache_model(v_superknife);
  104.  
  105. TeleportSprite = precache_model( "sprites/shockwave.spr");
  106. TeleportSprite2 = precache_model( "sprites/blueflare2.spr");
  107.  
  108. BloodSpray = precache_model("sprites/bloodspray.spr");
  109. BloodDrop = precache_model("sprites/blood.spr");
  110. SPR_SUICIDE_EXPLODE = precache_model("sprites/zerogxplode.spr")
  111. SPR_SUICIDE_SMOKE = precache_model("sprites/steam1.spr")
  112. SPR_SUICIDE_BLAST = precache_model("sprites/ef_shockwave.spr")
  113. precache_sound(SOUND_SUICIDE)
  114. }
  115.  
  116. public VIPHTML ( id ) show_motd(id, "addons/amxmodx/configs/vip.html", "VIP");
  117.  
  118. public EVENT_Death ( ) {
  119.  
  120. new Victim = read_data ( 2 );
  121.  
  122. if(is_user_connected(Victim)) {
  123. if(HasPower[Victim] == 3) {
  124. Ultimate_SuicideExplode(Victim)
  125. }
  126.  
  127.  
  128. }
  129.  
  130. }
  131. public MessageScoreAttrib( iMsgId, iDest, iReceiver ) {
  132. new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );
  133.  
  134. if( access( iPlayer, VIP ) ) {
  135. set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
  136. }
  137. }
  138.  
  139. public Spawn ( id ) {
  140. SuperKnife[id] = false;
  141. Speed[id] = false;
  142. Gravity[id] = false;
  143. Round[ id ] = false;
  144. GodMode_Cooldown[id] = 0;
  145. GodMode_DurationCooldown[id] = 0;
  146. Teleport_Cooldown[id] = 0;
  147. HasPower[id] = 0;
  148.  
  149. }
  150.  
  151. public CurrWeapon( id ) {
  152. if ( SuperKnife [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
  153.  
  154. set_pev ( id, pev_viewmodel2, v_superknife );
  155. }
  156. if(Speed[id]) {
  157. set_user_maxspeed(id, get_pcvar_float(speed));
  158. }
  159. else
  160. {
  161. set_user_maxspeed(id, 260.0);
  162. }
  163. if(Gravity[id]) {
  164. set_user_gravity(id, get_pcvar_float(gravity));
  165. }
  166. else
  167. {
  168. set_user_gravity(id, 1.0);
  169. }
  170. }
  171.  
  172. public VipCmd( id ) {
  173. if(Round[id]) {
  174. ColorChat(id, "^x04[VIP]^x01 Poti utiliza meniul doar odata pe runda.");
  175. return 1;
  176. }
  177. if(!(is_user_alive(id))) {
  178. ColorChat(id, "^x04[VIP]^x01 Nu poti accesa meniul cand esti mort.");
  179. return 1;
  180. }
  181. if (get_user_flags(id) & read_flags("v")){
  182. ColorChat(id, "^x04[VIP]^x01 Meniul este numai pentru membri^x04 VIP");
  183. return 1;
  184. }
  185. new VipMenu = menu_create("Vip Menu", "give_menu");
  186.  
  187. if(get_user_team(id) == 1) {
  188. menu_additem(VipMenu, "\ySuper Knife \rx3 \yDMG", "1", 0);
  189. }
  190. else if(get_user_team(id) == 2) {
  191. menu_additem(VipMenu, "\ySpeed \r+ \yGravity", "1", 0);
  192. }
  193. menu_additem(VipMenu, "\yGod Mode", "2", 0);
  194. menu_additem(VipMenu, "\yTeleport", "3", 0);
  195. menu_additem(VipMenu, "\yPack \r500 \yHP \r+ \yAP", "4", 0);
  196. menu_additem(VipMenu, "\yHE Grenades", "5", 0);
  197. menu_additem(VipMenu, "\yExplode", "6", 0);
  198.  
  199. menu_setprop(VipMenu, MPROP_EXIT, MEXIT_ALL);
  200. menu_display(id, VipMenu, 0);
  201. return 1;
  202. }
  203.  
  204. public give_menu( id, VipMenu, item) {
  205. if(item == MENU_EXIT) {
  206. return 1;
  207. }
  208.  
  209. switch ( item )
  210. {
  211. case 0:
  212. {
  213. if(get_user_team(id) == 1) {
  214. SuperKnife[id] = true;
  215. CurrWeapon(id);
  216. Round[id] = true;
  217. ColorChat(id, "^x04[VIP]^x01 Ai ales Super Knife 3X DMG.");
  218. }
  219. else if (get_user_team(id) == 2) {
  220. Speed[id] = true;
  221. Gravity[id] = true;
  222. CurrWeapon(id);
  223. Round[id] = true;
  224. ColorChat(id, "^x04[VIP]^x01 Ai ales speed + gravity.");
  225. }
  226. }
  227. case 1:
  228. {
  229. HasPower[id] = 1;
  230. ColorChat(id, "^x04[VIP]^x01 Ai ales godmode.Apasa^x04 V^x01 pentru a-l activa.");
  231. Round[ id ] = true;
  232. }
  233. case 2:
  234. {
  235. HasPower[id] = 2;
  236. ColorChat(id, "^x04[VIP]^x01 Ai ales teleport.Apasa^x04 V^x01 pentru a te teleporta.");
  237. Round[ id ] = true;
  238. }
  239. case 3:
  240. {
  241. set_user_health(id, 500);
  242. set_user_armor(id, 500);
  243. ColorChat(id, "^x04[VIP]^x01 Ai ales Pack 500HP si 500AP.");
  244. Round[id] = true;
  245. }
  246. case 4:
  247. {
  248. give_item(id, "weapon_hegrenade");
  249. cs_set_user_bpammo(id, CSW_HEGRENADE, get_pcvar_num(cvar_he));
  250. ColorChat(id, "^x04[VIP]^x01 Ai ales HE Grenade. Ai %s grenazi.", cvar_he );
  251. Round[id] = true;
  252. }
  253. case 5:
  254. {
  255. HasPower[id] = 3;
  256. ColorChat(id, "^x04[VIP]^x01 Ai ales Explode.Cand vei muri vei exploda.");
  257. Round[id] = true;
  258. }
  259. }
  260. menu_destroy(VipMenu);
  261. return 1;
  262. }
  263.  
  264. public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits) {
  265. if(IsPlayer(iAttacker)) {
  266. if(iInflictor == iAttacker && SuperKnife[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && get_user_team(iAttacker) == 1) {
  267. SetHamParamFloat(4, fDamage * 3.0);
  268. return 1;
  269. }
  270. }
  271. return HAM_IGNORED;
  272. }
  273.  
  274. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  275. // GodMode |
  276. //==========================================================================================================
  277. public GodModeShowHUD(id) {
  278. if (!is_user_alive(id) || HasPower[id] != 1) {
  279. remove_task(id);
  280. GodMode_DurationCooldown[id] = 0;
  281. set_user_godmode(id, 0);
  282. return PLUGIN_HANDLED;
  283. }
  284. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  285. if(is_user_alive(id) && GodMode_DurationCooldown[id] == 1) {
  286. GodMode_DurationCooldown[id] --;
  287. show_hudmessage(id, "Ai GodMode pentru: %d secunda",GodMode_DurationCooldown[id]);
  288. }
  289. if(is_user_alive(id) && GodMode_DurationCooldown[id] > 1) {
  290. GodMode_DurationCooldown[id] --;
  291. show_hudmessage(id, "Ai GodMode pentru: %d secunde",GodMode_DurationCooldown[id]);
  292. }
  293. if(GodMode_DurationCooldown[id] <= 0) {
  294. show_hudmessage(id, "Nu mai ai GodMode");
  295. ColorChat(id,"^x03[Furien]^x04 Nu mai ai GodMode.");
  296. remove_task(id);
  297. set_user_godmode(id, 0);
  298. GodMode_DurationCooldown[id] = 0;
  299. GodMode_Cooldown[id] = get_pcvar_num(CvarGodModeCooldown);
  300. set_task(1.0, "GodModeShowHUD2", id, _, _, "b");
  301. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  302. if(get_pcvar_num(CvarGodModeCooldown) != 1) {
  303. show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarGodModeCooldown));
  304. }
  305. if(get_pcvar_num(CvarGodModeCooldown) == 1) {
  306. show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarGodModeCooldown));
  307. }
  308. return PLUGIN_HANDLED;
  309. }
  310. return PLUGIN_HANDLED;
  311. }
  312.  
  313. public GodModeShowHUD2(id) {
  314. if (!is_user_alive(id) || HasPower[id] != 1) {
  315. remove_task(id);
  316. GodMode_Cooldown[id] = 0;
  317. return PLUGIN_HANDLED;
  318. }
  319. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  320. if(is_user_alive(id) && GodMode_Cooldown[id] == 1) {
  321. GodMode_Cooldown[id] --;
  322. show_hudmessage(id, "Puterea iti va reveni in: %d secunda",GodMode_Cooldown[id]);
  323. }
  324. if(is_user_alive(id) && GodMode_Cooldown[id] > 1) {
  325. GodMode_Cooldown[id] --;
  326. show_hudmessage(id, "Puterea iti va reveni in: %d secunde",GodMode_Cooldown[id]);
  327. }
  328. if(GodMode_Cooldown[id] <= 0) {
  329. show_hudmessage(id, "Ti-a revenit puterea");
  330. ColorChat(id,"^x03[Furien]^x04 Iti poti folosi din nou puterea.");
  331. remove_task(id);
  332. GodMode_Cooldown[id] = 0;
  333. }
  334. return PLUGIN_HANDLED;
  335. }
  336.  
  337. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  338. // Teleport |
  339. //==========================================================================================================
  340. public TeleportShowHUD(id) {
  341. if (!is_user_alive(id) || HasPower[id] != 2) {
  342. remove_task(id);
  343. Teleport_Cooldown[id] = 0;
  344. return PLUGIN_HANDLED;
  345. }
  346. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  347. if(is_user_alive(id) && Teleport_Cooldown[id] == 1) {
  348. Teleport_Cooldown[id] --;
  349. show_hudmessage(id, "Puterea iti va reveni in: %d secunda",Teleport_Cooldown[id]);
  350. }
  351. if(is_user_alive(id) && Teleport_Cooldown[id] > 1) {
  352. Teleport_Cooldown[id] --;
  353. show_hudmessage(id, "Puterea iti va reveni in: %d secunde",Teleport_Cooldown[id]);
  354. }
  355. if(Teleport_Cooldown[id] <= 0) {
  356. show_hudmessage(id, "Ti-a revenit puterea");
  357. ColorChat(id,"^x03[Furien]^x04 Iti poti folosi din nou puterea.");
  358. remove_task(id);
  359. Teleport_Cooldown[id] = 0;
  360. }
  361. return PLUGIN_HANDLED;
  362. }
  363.  
  364. bool:teleport(id) {
  365. new Float:vOrigin[3], Float:vNewOrigin[3],
  366. Float:vNormal[3], Float:vTraceDirection[3],
  367. Float:vTraceEnd[3];
  368.  
  369. pev(id, pev_origin, vOrigin);
  370.  
  371. velocity_by_aim(id, get_pcvar_num(CvarTeleportRange), vTraceDirection);
  372. xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
  373.  
  374. engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
  375.  
  376. new Float:flFraction;
  377. get_tr2(0, TR_flFraction, flFraction);
  378. if (flFraction < 1.0) {
  379. get_tr2(0, TR_vecEndPos, vTraceEnd);
  380. get_tr2(0, TR_vecPlaneNormal, vNormal);
  381. }
  382.  
  383. xs_vec_mul_scalar(vNormal, 40.0, vNormal); // do not decrease the 40.0
  384. xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
  385.  
  386. if (is_player_stuck(id, vNewOrigin))
  387. return false;
  388.  
  389. emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM);
  390. tele_effect(vOrigin);
  391.  
  392. engfunc(EngFunc_SetOrigin, id, vNewOrigin);
  393.  
  394. tele_effect2(vNewOrigin);
  395.  
  396. return true;
  397. }
  398.  
  399. stock is_player_stuck(id, Float:originF[3]) {
  400. engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
  401.  
  402. if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  403. return true;
  404.  
  405. return false;
  406. }
  407.  
  408. stock tele_effect(const Float:torigin[3]) {
  409. new origin[3];
  410. origin[0] = floatround(torigin[0]);
  411. origin[1] = floatround(torigin[1]);
  412. origin[2] = floatround(torigin[2]);
  413.  
  414. message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
  415. write_byte(TE_BEAMCYLINDER);
  416. write_coord(origin[0]);
  417. write_coord(origin[1]);
  418. write_coord(origin[2]+10);
  419. write_coord(origin[0]);
  420. write_coord(origin[1]);
  421. write_coord(origin[2]+60);
  422. write_short(TeleportSprite);
  423. write_byte(0);
  424. write_byte(0);
  425. write_byte(3);
  426. write_byte(60);
  427. write_byte(0);
  428. write_byte(255);
  429. write_byte(255);
  430. write_byte(255);
  431. write_byte(255);
  432. write_byte(0);
  433. message_end();
  434. }
  435.  
  436. stock tele_effect2(const Float:torigin[3]) {
  437. new origin[3];
  438. origin[0] = floatround(torigin[0]);
  439. origin[1] = floatround(torigin[1]);
  440. origin[2] = floatround(torigin[2]);
  441.  
  442. message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
  443. write_byte(TE_BEAMCYLINDER);
  444. write_coord(origin[0]);
  445. write_coord(origin[1]);
  446. write_coord(origin[2]+10);
  447. write_coord(origin[0]);
  448. write_coord(origin[1]);
  449. write_coord(origin[2]+60);
  450. write_short(TeleportSprite);
  451. write_byte(0);
  452. write_byte(0);
  453. write_byte(3);
  454. write_byte(60);
  455. write_byte(0);
  456. write_byte(255);
  457. write_byte(255);
  458. write_byte(255);
  459. write_byte(255);
  460. write_byte(0);
  461. message_end();
  462.  
  463. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  464. write_byte(TE_SPRITETRAIL);
  465. write_coord(origin[0]);
  466. write_coord(origin[1]);
  467. write_coord(origin[2]+40);
  468. write_coord(origin[0]);
  469. write_coord(origin[1]);
  470. write_coord(origin[2]);
  471. write_short(TeleportSprite2);
  472. write_byte(30);
  473. write_byte(10);
  474. write_byte(1);
  475. write_byte(50);
  476. write_byte(10);
  477. message_end();
  478. }
  479.  
  480. // Suicide Explosion
  481. public Ultimate_SuicideExplode(id) {
  482. emit_sound(id, CHAN_STATIC, SOUND_SUICIDE, 1.0, ATTN_NORM, 0, PITCH_NORM);
  483. new parm[5], Origin[3];
  484. get_user_origin(id, Origin);
  485.  
  486. parm[0] = id;
  487. parm[1] = 6;
  488. parm[2] = Origin[0];
  489. parm[3] = Origin[1];
  490. parm[4] = Origin[2];
  491.  
  492. set_task(0.50, "SuicideExplode", TASK_EXPLOSION + id, parm, 5);
  493. set_task(0.50, "SuicideBlastCircles", TASK_BEAMCYLINDER + id, parm, 5);
  494.  
  495. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  496. write_byte(TE_IMPLOSION)
  497. write_coord(Origin[0]) // position(X)
  498. write_coord(Origin[1]) // position(Y)
  499. write_coord(Origin[2]) // position(Z)
  500. write_byte(100) // radius
  501. write_byte(20) // count
  502. write_byte(5) // life in 0.1's
  503. message_end()
  504. }
  505.  
  506. public SuicideExplode(parm[5]) {
  507. new id = parm[0];
  508.  
  509. new Origin[3];
  510. Origin[0] = parm[2];
  511. Origin[1] = parm[3];
  512. Origin[2] = parm[4];
  513.  
  514. new Float:Origin2[3];
  515. IVecFVec(Origin, Origin2);
  516.  
  517. message_begin(MSG_PVS, SVC_TEMPENTITY, Origin)
  518. write_byte(TE_EXPLOSION)
  519. write_coord(Origin[0]) // position(X)
  520. write_coord(Origin[1]) // position(Y)
  521. write_coord(Origin[2]) // position(Z)
  522. write_short(SPR_SUICIDE_EXPLODE) // sprite index
  523. write_byte((random_num(0,20) + 20)) // scale in 0.1's
  524. write_byte(12) // framerate
  525. write_byte(TE_EXPLFLAG_NONE) // flags
  526. message_end()
  527.  
  528. message_begin(MSG_PVS, SVC_TEMPENTITY, Origin)
  529. write_byte(TE_SMOKE)
  530. write_coord(Origin[0]) // position(X)
  531. write_coord(Origin[1]) // position(Y)
  532. write_coord(Origin[2]) // position(Z)
  533. write_short(SPR_SUICIDE_SMOKE) // Sprite index
  534. write_byte(60) // scale * 10
  535. write_byte(10) // framerate
  536. message_end()
  537.  
  538. for(new Victim = 1; Victim < get_maxplayers(); Victim++) {
  539. if(is_user_connected(Victim) && is_user_alive(Victim) && !get_user_godmode(Victim) && get_user_team(Victim) != get_user_team(id) && Victim != id) {
  540. new Float:VictimOrigin[3], Float:Distance_F, Distance;
  541. pev(Victim, pev_origin, VictimOrigin);
  542. Distance_F = get_distance_f(Origin2, VictimOrigin);
  543. Distance = floatround(Distance_F);
  544.  
  545. if(Distance <= EXPLOSION_BLAST_RADIUS) {
  546. new Float:DistanceRatio, Float:Damage;
  547. DistanceRatio = floatdiv(float(Distance), EXPLOSION_BLAST_RADIUS);
  548. Damage = EXPLOSION_MAX_DAMAGE - floatround(floatmul(EXPLOSION_MAX_DAMAGE, DistanceRatio));
  549.  
  550. new BloodColor = ExecuteHam(Ham_BloodColor, Victim);
  551. if(BloodColor != -1) {
  552. new Amount = floatround(Damage);
  553.  
  554. Amount *= 2; //according to HLSDK
  555.  
  556. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  557. write_byte(TE_BLOODSPRITE);
  558. write_coord(floatround(VictimOrigin[0]));
  559. write_coord(floatround(VictimOrigin[1]));
  560. write_coord(floatround(VictimOrigin[2]));
  561. write_short(BloodSpray);
  562. write_short(BloodDrop);
  563. write_byte(BloodColor);
  564. write_byte(min(max(3, Amount/10), 16));
  565. message_end();
  566. }
  567.  
  568. if(parm[1] == 6)
  569. make_knockback(Victim, Origin2, EXPLOSION_KNOCKBACK*Damage);
  570.  
  571. if(get_user_health(Victim) - Damage >= 1) {
  572. ExecuteHam(Ham_TakeDamage, Victim, id, id, Damage, DMG_BLAST);
  573.  
  574. }
  575. else
  576. death_message(id, Victim, "Suicide Explode");
  577. }
  578. }
  579. }
  580.  
  581. --parm[1];
  582.  
  583. if(parm[1] > 0)
  584. set_task(0.1, "SuicideExplode", TASK_EXPLOSION + id, parm, 5);
  585. }
  586.  
  587. public SuicideBlastCircles(parm[5]) {
  588. new Origin[3];
  589. Origin[0] = parm[2];
  590. Origin[1] = parm[3];
  591. Origin[2] = parm[4]-16;
  592.  
  593. new Float:Origin2[3];
  594. IVecFVec(Origin, Origin2);
  595.  
  596. engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin2, 0)
  597. write_byte(TE_BEAMCYLINDER) // TE id
  598. engfunc(EngFunc_WriteCoord, Origin2[0]) // x
  599. engfunc(EngFunc_WriteCoord, Origin2[1]) // y
  600. engfunc(EngFunc_WriteCoord, Origin2[2]) // z
  601. engfunc(EngFunc_WriteCoord, Origin2[0]) // x axis
  602. engfunc(EngFunc_WriteCoord, Origin2[1]) // y axis
  603. engfunc(EngFunc_WriteCoord, Origin2[2]+385.0) // z axis
  604. write_short(SPR_SUICIDE_BLAST) // sprite
  605. write_byte(0) // startframe
  606. write_byte(0) // framerate
  607. write_byte(4) // life
  608. write_byte(60) // width
  609. write_byte(0) // noise
  610. write_byte(255) // red
  611. write_byte(255) // green
  612. write_byte(255) // blue
  613. write_byte(200) // brightness
  614. write_byte(0) // speed
  615. message_end()
  616.  
  617. message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  618. write_byte(TE_DLIGHT);
  619. write_coord(Origin[0]); // x
  620. write_coord(Origin[1]); // y
  621. write_coord(Origin[2]); // z
  622. write_byte(floatround(EXPLOSION_BLAST_RADIUS/10.0)); // radius
  623. write_byte(255) // red
  624. write_byte(255) // green
  625. write_byte(255) // blue
  626. write_byte(8); // life
  627. write_byte(60); // decay rate
  628. message_end();
  629. }
  630.  
  631. //------| Client Power |------//
  632. public Power(id) {
  633. if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 1 && !GodMode_DurationCooldown[id]) {
  634.  
  635. if (GodMode_Cooldown[id]) {
  636. ColorChat(id,"^x03[Furien]^x04 Puterea iti va reveni in^x03 %d secunde.",GodMode_Cooldown[id]);
  637. return PLUGIN_CONTINUE;
  638. }
  639. set_user_godmode(id, 1);
  640. GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration)
  641. set_task(1.0, "GodModeShowHUD", id, _, _, "b");
  642. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  643. if(get_pcvar_num(CvarGodModeDuration) != 1) {
  644. show_hudmessage(id, "Ai GodMode pentru: %d secunde",get_pcvar_num(CvarGodModeDuration));
  645. }
  646. if(get_pcvar_num(CvarGodModeDuration) == 1) {
  647. show_hudmessage(id, "Ai GodMode pentru: %d secunda",get_pcvar_num(CvarGodModeDuration));
  648. }
  649. return PLUGIN_HANDLED;
  650. }
  651. if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 2) {
  652. if (Teleport_Cooldown[id]) {
  653. ColorChat(id,"^x03[Furien]^x04 Puterea iti va reveni in^x03 %d secunde.",Teleport_Cooldown[id]);
  654. return PLUGIN_CONTINUE;
  655. }
  656. if (teleport(id)) {
  657. emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM);
  658. remove_task(id);
  659. Teleport_Cooldown[id] = get_pcvar_num(CvarTeleportCooldown);
  660. set_task(1.0, "TeleportShowHUD", id, _, _, "b");
  661. set_hudmessage( 255, 0, 0, -1.0, 0.29, 0, 0.0, 1.0, 0.0, 1.0, 4);
  662. if(get_pcvar_num(CvarTeleportCooldown) != 1) {
  663. show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarTeleportCooldown));
  664. }
  665. if(get_pcvar_num(CvarTeleportCooldown) == 1) {
  666. show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarTeleportCooldown));
  667. }
  668. return PLUGIN_HANDLED;
  669. }
  670. else {
  671. Teleport_Cooldown[id] = 0;
  672. ColorChat(id, "^x03[Furien]^x04 Pozitia de teleportare este invalida.");
  673. return PLUGIN_HANDLED;
  674. }
  675. return 1;
  676. }
  677. return 0;
  678. }
  679.  
  680. ////////////////////////////////////////////////////////////////////////////////////////////////////////////
  681. // VIP's Online |
  682. //==========================================================================================================
  683. public print_adminlist(user) {
  684. new adminnames[33][32];
  685. new message[256];
  686. new id, count, x, len;
  687.  
  688. for(id = 1 ; id <= get_maxplayers() ; id++)
  689. if(is_user_connected(id))
  690. if(get_user_flags(id) & VIP)
  691. get_user_name(id, adminnames[count++], 31);
  692.  
  693. len = format(message, 255, "^x04 VIP ONLINE: ");
  694. if(count > 0) {
  695. for(x = 0 ; x < count ; x++) {
  696. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
  697. if(len > 96) {
  698. print_message(user, message);
  699. len = format(message, 255, "^x04 ");
  700. }
  701. }
  702. print_message(user, message);
  703. }
  704. else {
  705. len += format(message[len], 255-len, "No VIP online.");
  706. print_message(user, message);
  707. }
  708. }
  709. print_message(id, msg[]) {
  710. message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
  711. write_byte(id);
  712. write_string(msg);
  713. message_end();
  714. }
  715.  
  716. public handle_say(id) {
  717. new said[192];
  718. read_args(said,192);
  719. if(contain(said, "/vips") != -1)
  720. set_task(0.1,"print_adminlist",id);
  721. return PLUGIN_CONTINUE;
  722. }
  723.  
  724.  
  725. stock death_message(Killer, Victim, const Weapon[]) {
  726. if(is_user_connected(Killer) && is_user_connected(Victim)) {
  727. set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET);
  728. ExecuteHamB(Ham_Killed, Victim, Killer, 2);
  729. set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT);
  730.  
  731. make_deathmsg(Killer, Victim, 0, Weapon);
  732.  
  733. message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"));
  734. write_byte(Killer); // id
  735. write_short(pev(Killer, pev_frags)); // frags
  736. write_short(cs_get_user_deaths(Killer)); // deaths
  737. write_short(0); // class?
  738. write_short(get_user_team(Killer)); // team
  739. message_end();
  740.  
  741. }
  742. }
  743.  
  744. public make_knockback(Victim, Float:origin[3], Float:maxspeed) {
  745. new Float:fVelocity[3];
  746. kickback(Victim, origin, maxspeed, fVelocity);
  747. entity_set_vector(Victim, EV_VEC_velocity, fVelocity);
  748.  
  749. return(1);
  750. }
  751. stock kickback(ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3]) {
  752. new Float:fEntOrigin[3];
  753. entity_get_vector(ent, EV_VEC_origin, fEntOrigin);
  754.  
  755. new Float:fDistance[3];
  756. fDistance[0] = fEntOrigin[0] - fOrigin[0];
  757. fDistance[1] = fEntOrigin[1] - fOrigin[1];
  758. fDistance[2] = fEntOrigin[2] - fOrigin[2];
  759. new Float:fTime = (vector_distance(fEntOrigin,fOrigin) / fSpeed);
  760. fVelocity[0] = fDistance[0] / fTime;
  761. fVelocity[1] = fDistance[1] / fTime;
  762. fVelocity[2] = fDistance[2] / fTime;
  763.  
  764. return(fVelocity[0] && fVelocity[1] && fVelocity[2]);
  765. }
  766. stock ColorChat(const id, const input[], any:...) {
  767. new count = 1, players[32];
  768. static msg[191];
  769. vformat(msg, 190, input, 3);
  770.  
  771. replace_all(msg, 190, "!x04", "^4");
  772. replace_all(msg, 190, "!x01", "^1");
  773. replace_all(msg, 190, "!x03", "^3");
  774.  
  775. if(id) players[0] = id;
  776. else get_players(players, count, "ch"); {
  777. for(new i = 0; i < count; i++) {
  778. if(is_user_connected(players[i])) {
  779. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  780. write_byte(players[i]);
  781. write_string(msg);
  782. message_end();
  783. }
  784. }
  785. }
  786. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement