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)
- }
- }
- 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)
- {
- new entity = -1;
- while ((entity = FindEntityByClassname2(entity, "weapon_molotovt_spawn")) != -1)
- {
- float origin[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin);
- AcceptEntityInput(entity, "kill");
- LittleFlower(origin)
- }
- }
- /*
- 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()
- }
- }
- */
- FindEntityByClassname2(startEnt, const String:classname[])
- {
- while (startEnt > -1 && !IsValidEntity(startEnt)) startEnt--;
- return FindEntityByClassname(startEnt, classname);
- }
- public Action timerpipe(Handle timer, any client)
- {
- float origin2[3];
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", origin2);
- ForcePlayerSuicide(client);
- LittleFlower(origin2)
- }
- stock LittleFlower(Float:pos[3])
- {
- /* Cause fire(type=0) or explosion(type=1) */
- new entity = CreateEntityByName("prop_physics");
- if (IsValidEntity(entity))
- {
- pos[2] += 10.0;
- DispatchKeyValue(entity, "model", "models/props_junk/propanecanister001a.mdl");
- DispatchSpawn(entity);
- SetEntData(entity, GetEntSendPropOffs(entity, "m_CollisionGroup"), 1, 1, true);
- TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
- AcceptEntityInput(entity, "break");
- }
- }
- 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