Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. new idx = GetEntProp(GetPlayerWeaponSlot(client, 1), Prop_Send, "m_iItemDefinitionIndex");
  2. if (StrEqual(weapon3, "tf_weapon_lunchbox") && TF2_GetPlayerClass(client) != TFClass_Heavy && !pEatCooldown[client] && !pLongEatCooldown[client])
  3. {
  4. TF2_StunPlayer(client, Float:3.8, Float:0.0, TF_STUNFLAG_BONKSTUCK|TF_STUNFLAG_NOSOUNDOREFFECT, 0);
  5. if (idx == 42) SetSandvich(client);
  6. if (idx == 159) SetDalokohs(client);
  7. }
  8.  
  9. SetDalokohs(client)
  10. {
  11. CreateTimer(1.0, SetDalokohsTimer, any:client, TIMER_REPEAT);
  12. pEatCooldown[client] = true;
  13. if (!pDalokohsBuff[client])
  14. {
  15. Command_Weapon(client, 2159);
  16. pDalokohsBuff[client] = true;
  17. DalokohsBuffTimer[client] = CreateTimer(30.1, DalokohsBuffTime, any:client);
  18. }
  19. if (GetClientHealth(client) < TF2_GetMaxHealth(client))
  20. {
  21. EatCooldownTimer[client] = CreateTimer(30.1, Eat_CooldownTime, any:client);
  22. pLongEatCooldown[client] = true;
  23. SetSpeshulAmmo(client, 1, 0);
  24. }
  25. else if (GetClientHealth(client) >= TF2_GetMaxHealth(client)) EatCooldownTimer[client] = CreateTimer(4.3, Eat_CooldownTime, any:client);
  26. }
  27.  
  28. public Action:SetDalokohsTimer(Handle:timer, any:client)
  29. {
  30. static NumPrinted = 0;
  31. if (NumPrinted == 0) EmitSoundToAll("vo/SandwichEat09.wav", client);
  32. if (NumPrinted++ >= 4)
  33. {
  34. NumPrinted = 0;
  35. return Plugin_Stop;
  36. }
  37. if (GetClientHealth(client) < TF2_GetMaxHealth(client) && (GetClientHealth(client) + 15 > TF2_GetMaxHealth(client)))
  38. {
  39. SetEntityHealth(client, TF2_GetMaxHealth(client));
  40. return Plugin_Stop;
  41. }
  42. else if (GetClientHealth(client) < TF2_GetMaxHealth && (GetClientHealth(client) + 15) < TF2_GetMaxHealth(client))
  43. {
  44. SetEntityHealth(client, (GetClientHealth(client) + 15));
  45. return Plugin_Continue;
  46. }
  47. return Plugin_Continue;
  48. }
  49.  
  50. public Action:Eat_CooldownTime(Handle:timer, any:client)
  51. {
  52. if(pEatCooldown[client])
  53. {
  54. pEatCooldown[client] = false;
  55. if (pLongEatCooldown[client])
  56. {
  57. PrintHintText(client, "[TF2Items]Randomizer: Your Food has Recharged");
  58. EmitSoundToClient(client, "player/recharged.wav");
  59. pLongEatCooldown[client] = false;
  60. }
  61. SetSpeshulAmmo(client, 1, 1);
  62. }
  63. EatCooldownTimer[client] = INVALID_HANDLE;
  64. }
  65.  
  66. public Action:DalokohsBuffTime(Handle:timer, any:client)
  67. {
  68. if (pDalokohsBuff[client])
  69. {
  70. pDalokohsBuff[client] = false;
  71. Command_Weapon(client, 159);
  72. }
  73. SetSpeshulAmmo(client, 1, 1);
  74. DalokohsBuffTimer[client] = INVALID_HANDLE;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement