Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

Commit

Permalink
Sources for ZoneMod Practice
Browse files Browse the repository at this point in the history
  • Loading branch information
AshesBeneath committed Apr 5, 2020
1 parent 504e707 commit 6d45dcf
Show file tree
Hide file tree
Showing 10 changed files with 791 additions and 0 deletions.
92 changes: 92 additions & 0 deletions 1v1helth.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
SourcePawn is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
SourceMod is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
Pawn and SMALL are Copyright (C) 1997-2008 ITB CompuPhase.
Source is Copyright (C) Valve Corporation.
All trademarks are property of their respective owners.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <colors>

new const String:SI_Names[][] =
{
"Unknown",
"Smoker",
"Boomer",
"Hunter",
"Spitter",
"Jockey",
"Charger",
"Witch",
"Tank",
"Not SI"
};

public Plugin:myinfo =
{
name = "1v1 Practice",
author = "Blade + Confogl Team, Tabun, Visor, AshesBeneath",
description = "1v1 EQ plugin with practice edits.",
version = "0.1",
url = "https://github.com/AshesBeneath/Dasogl"
};

public OnPluginStart()
{
// Server namer support
CreateConVar("l4d_ready_enabled", "1", "This cvar doesn't do anything, but if it is 0 the logger wont log this game.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
CreateConVar("l4d_ready_cfg_name", "ZoneMod Practice", "Configname to display on the ready-up panel", FCVAR_PRINTABLEONLY);

HookEvent("player_hurt", Event_PlayerHurt, EventHookMode_Post);
}

public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new victim = GetClientOfUserId(GetEventInt(event, "userid"));

if (!IsClientAndInGame(attacker))
return;

new zombie_class = GetZombieClass(attacker);

if (GetClientTeam(attacker) == 3 && zombie_class != 8)
{
new remaining_health = GetClientHealth(attacker);
CPrintToChatAll("{red}%N{default}({green}%s{default}) kalan HP: {olive}%d", attacker, SI_Names[zombie_class], remaining_health);

ForcePlayerSuicide(attacker);

if (remaining_health == 1)
{
CPrintToChat(victim, "You don't have to be mad...");
}
}
}

stock GetZombieClass(client) return GetEntProp(client, Prop_Send, "m_zombieClass");

stock bool:IsClientAndInGame(index)
{
if (index > 0 && index < MaxClients)
{
return IsClientInGame(index);
}
return false;
}
Binary file added compiled/1v1helth.smx
Binary file not shown.
Binary file added compiled/flying_ghosts.smx
Binary file not shown.
Binary file added compiled/kill.smx
Binary file not shown.
Binary file added compiled/l4d2_practice.smx
Binary file not shown.
Binary file added compiled/sm_give_givemenu.smx
Binary file not shown.
109 changes: 109 additions & 0 deletions flying_ghosts.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#include <sourcemod>

#define GROUND_CHECK_DELAY 0.25

public Plugin:myinfo =
{
name = "Flying Ghosts",
author = "CanadaRox",
description = "Allows ghosts to fly but only spawn like normal",
version = "1",
url =
"https://github.com/CanadaRox/sourcemod-plugins/tree/master/flying_ghosts"
};

new bool:bIsHoldingKey[MAXPLAYERS+1];
new bool:bBlockSpawn[MAXPLAYERS+1];
new Handle:hGroundCheckTimer[MAXPLAYERS+1];

public OnPluginStart()
{
HookEvent("round_start", RoundStart_Event, EventHookMode_PostNoCopy);
}

public OnMapStart()
{
for (new client = 1; client <= MAXPLAYERS; client++)
{
hGroundCheckTimer[client] = INVALID_HANDLE;
}
}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3],
Float:angles[3], &weapon)
{
if (IsClientInGame(client) && !IsFakeClient(client) &&
IsGhostInfected(client))
{
if (buttons & IN_RELOAD)
{
if (!bIsHoldingKey[client])
{
bIsHoldingKey[client] = true;
if (GetEntityMoveType(client) == MOVETYPE_WALK)
{
SetEntityMoveType(client, MOVETYPE_NOCLIP);
bBlockSpawn[client] = true;
hGroundCheckTimer[client] = CreateTimer(GROUND_CHECK_DELAY,
GroundCheck_Timer, GetClientUserId(client), TIMER_REPEAT |
TIMER_FLAG_NO_MAPCHANGE);
}
else
SetEntityMoveType(client, MOVETYPE_WALK);
}
}
else
{
bIsHoldingKey[client] = false;
}

if (buttons & IN_ATTACK)
{
if (bBlockSpawn[client])
buttons &= ~IN_ATTACK;
}
}
}

public Action:GroundCheck_Timer(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if (client == 0 || GetEntityFlags(client) & FL_ONGROUND)
{
bBlockSpawn[client] = false;
hGroundCheckTimer[client] = INVALID_HANDLE;
return Plugin_Stop;
}
return Plugin_Continue;
}


public RoundStart_Event(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new client = 1; client <= MaxClients; client++)
{
if(IsClientInGame(client))
{
bIsHoldingKey[client] = false;
if (hGroundCheckTimer[client] != INVALID_HANDLE)
CloseHandle(hGroundCheckTimer[client]);
hGroundCheckTimer[client] = INVALID_HANDLE;
bBlockSpawn[client] = false;
}
}
}

public OnClientDisconnect(client)
{
bIsHoldingKey[client] = false;
if (hGroundCheckTimer[client] != INVALID_HANDLE)
CloseHandle(hGroundCheckTimer[client]);
hGroundCheckTimer[client] = INVALID_HANDLE;
bBlockSpawn[client] = false;
}

stock IsGhostInfected(client)
{
return GetClientTeam(client) == 3 && IsPlayerAlive(client) &&
GetEntProp(client, Prop_Send, "m_isGhost");
}
21 changes: 21 additions & 0 deletions kill.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
name = "Yeter artık intihar ediyom len???",
author = "AshesBeneath",
description = "Zonemod pratiği için !kill komudu",
version = "1.0",
url = "https://github.com/AshesBeneath/Dasogl"
}

public OnPluginStart()
{
RegConsoleCmd("sm_kill", KurtarBeniBuCehaletten);
}

public Action:KurtarBeniBuCehaletten(client, args)
{
ForcePlayerSuicide(client);
}
Loading

0 comments on commit 6d45dcf

Please sign in to comment.