Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #define LoopPlayers(%0) for (int %0 = MaxClients; %0 != 0; --%0) if (IsClientInGame(%0))
- int pipe_peremenya[MAXPLAYERS+1] = 0;
- Handle:timerpip[MAXPLAYERS+1] = INVALID_HANDLE;
- new pipebomb[MAXPLAYERS+1];
- public OnPluginStart()
- {
- CreateTimer(1.0, TimerOut, _, TIMER_REPEAT);
- }
- public Action:TimerOut(Handle timer, fuck)
- {
- LoopPlayers(i)
- if (pipe_peremenya[i] > 0)
- {
- pipe_peremenya[i]--;
- }
- }
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, float vel[3], float angles[3], int& weapon)
- {
- if (timerpip[client] == INVALID_HANDLE)
- {
- new iCurrentWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- if(!IsValidEntity(iCurrentWeapon))
- return Plugin_Continue;
- decl String:weaponclass[32];
- GetEntityClassname(iCurrentWeapon, weaponclass, sizeof(weaponclass));
- if(buttons & IN_ATTACK)
- {
- if (StrEqual(weaponclass, "weapon_pipe_bomb"))
- {
- pipe_peremenya[client] = 6;
- timerpip[client] = CreateTimer(6.0, timerpipe, client, TIMER_FLAG_NO_MAPCHANGE);
- }
- else if (!(buttons & IN_USE))
- {
- if(timerpip[client] != INVALID_HANDLE)
- {
- KillTimer(timerpip[client]);
- timerpip[client] = INVALID_HANDLE;
- }
- CreateTimer(6.0 - pipe_peremenya[client], TimerBomb, client);
- }
- }
- }
- return Plugin_Continue;
- }
- public OnEntityCreated(int entity, const char[] classname)
- {
- if(StrEqual(classname, "pipe_bomb_projectile"))
- {
- new client = GetEntPropEnt(entity, Prop_Send, "m_hThrower");
- pipebomb[client] = EntIndexToEntRef(entity);
- }
- }
- public Action:TimerBomb(Handle:timer, any:client)
- {
- new entity = EntRefToEntIndex(pipebomb[client]);
- float origin[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin);
- AcceptEntityInput(pipebomb[client], "kill");
- LittleFlower(origin)
- }
- public Action:timerpipe(Handle:timer, any:client)
- {
- float origin2[3];
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", origin2);
- ForcePlayerSuicide(client);
- LittleFlower(origin2);
- }
Advertisement
Add Comment
Please, Sign In to add comment