FlacoBey

Untitled

Jan 1st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.47 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. #define LoopPlayers(%0) for (int %0 = MaxClients; %0 != 0; --%0) if (IsClientInGame(%0))
  6.  
  7. int pipe_peremenya[MAXPLAYERS+1] = 0;
  8.  
  9. Handle:timerpip = INVALID_HANDLE;
  10.  
  11. public OnPluginStart()
  12. {
  13.     CreateTimer(1.0, TimerOut, _, TIMER_REPEAT);
  14. }
  15.  
  16. public Action:TimerOut(Handle timer, fuck)
  17. {
  18.     LoopPlayers(i)
  19.    
  20.     if (pipe_peremenya[i] > 0)
  21.     {
  22.         pipe_peremenya[i]--;
  23.     }
  24. }
  25.  
  26. public Action:OnPlayerRunCmd(client, &buttons,  &impulse, float vel[3], float angles[3], int& weapon)
  27. {
  28.     if (timerpip == INVALID_HANDLE)
  29.     {
  30.         new iCurrentWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  31.  
  32.         if(!IsValidEntity(iCurrentWeapon))
  33.         return Plugin_Continue;
  34.    
  35.         decl String:weaponclass[32];
  36.         GetEntityClassname(iCurrentWeapon, weaponclass, sizeof(weaponclass));
  37.         if(buttons & IN_ATTACK)
  38.         {
  39.             if (StrEqual(weaponclass, "weapon_pipe_bomb"))
  40.             {
  41.                 pipe_peremenya[client] = 6;
  42.                 timerpip = CreateTimer(6.0, timerpipe, client, TIMER_FLAG_NO_MAPCHANGE);
  43.             }
  44.             else if (!(buttons & IN_USE))
  45.             {
  46.                 if(timerpip != INVALID_HANDLE)
  47.                 {
  48.                     KillTimer(timerpip);
  49.                     timerpip = INVALID_HANDLE;
  50.                 }
  51.                 CreateTimer(6.0 - pipe_peremenya[client], TimerBomb, client);
  52.             }
  53.         }
  54.     }
  55.     return Plugin_Continue;
  56. }
  57.  
  58. public Action:TimerBomb(Handle timer, any entity)
  59. {
  60.     float origin[3];
  61.     GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin);
  62.     AcceptEntityInput(entity, "kill");
  63.     LittleFlower(origin)
  64. }
  65.  
  66. public Action:timerpipe(Handle timer, any client)
  67. {
  68.     float origin2[3];
  69.     GetEntPropVector(client, Prop_Send, "m_vecOrigin", origin2);
  70.     ForcePlayerSuicide(client);
  71.     LittleFlower(origin2);
  72. }
  73.  
  74. public LittleFlower(Float:pos[3])
  75. {
  76.     new entity = CreateEntityByName("prop_physics");
  77.     if (IsValidEntity(entity))
  78.     {
  79.         pos[2] += 1.0;
  80.         DispatchKeyValue(entity, "model", "models/props_junk/propanecanister001a.mdl");
  81.         DispatchSpawn(entity);
  82.         SetEntData(entity, GetEntSendPropOffs(entity, "m_CollisionGroup"), 1, 1, true);
  83.         SetEntityRenderMode(entity, RENDER_TRANSCOLOR);
  84.         SetEntityRenderColor(entity, 255, 255, 255, 0);
  85.         TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
  86.         AcceptEntityInput(entity, "break");
  87.     }
  88. }
  89.  
  90. stock bool:bIsSurvivor(int client)
  91. {
  92.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  93. }
Advertisement
Add Comment
Please, Sign In to add comment