Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- Handle timeout;
- int pipe_peremenya = 0;
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, float vel[3], float angles[3], int& weapon)
- {
- 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"))
- {
- CreateTimer(6.0, timerpipe, client, TIMER_FLAG_NO_MAPCHANGE);
- timeout = CreateTimer(1.0, TimerOut, client, TIMER_REPEAT);
- }
- else if (!(buttons & IN_USE))
- {
- // CreateTimer(6.0 - pipe_peremenya, TimerBomb, client)
- KillTimer(timeout);
- timeout = null;
- }
- }
- return Plugin_Continue;
- }
- public OnEntityCreated(entity, const String:classname[])
- {
- if (StrEqual(classname, "pipe_bomb_projectile"))
- {
- CreateTimer(6.0 - pipe_peremenya, TimerBomb, entity)
- }
- }
- public Action TimerBomb(Handle timer, any entity)
- {
- float origin[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin);
- AcceptEntityInput(entity, "kill");
- }
- /*
- public Action TimerBomb(Handle timer, any client)
- {
- new entity = -1;
- while ((entity = FindEntityByClassname2(entity, "pipe_bomb_projectile")) != -1)
- {
- float origin[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin);
- AcceptEntityInput(entity, "kill");
- LittleFlower()
- }
- }
- */
- public Action timerpipe(Handle timer, any client)
- {
- float origin2[3];
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", origin2);
- ForcePlayerSuicide(client);
- }
- public Action TimerOut(Handle timer, client)
- {
- pipe_peremenya = 6;
- if(pipe_peremenya > 0)
- {
- pipe_peremenya--;
- }
- else
- {
- ForcePlayerSuicide(client)
- }
- }
- stock bool bIsSurvivor(int client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment