|
Member
Join Date: May 2016
Location: Mind Prison
|
05-17-2018
, 17:05
Re: [L4D] Infected No Block On Ladder
|
#9
|
Quote:
Originally Posted by Silvers
wow, this plugin could be like 50 lines and a config with preset ladder positions. One simple function to create the trigger_multiple instead of repeating the same thing over and over just with different positions for different maps - this is where a config with each specific map could list the various points.
But forget that, it could probably be 50 lines without any config and to support any map. Simply detect when someone is on a ladder by checking if MOVETYPE_LADDER and use SDKHooks: SDKHook_ShouldCollide / SDKHook_StartTouch.
|
Like this?
Spoiler
Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
public Plugin:myinfo =
{
name = "[L4D]No Block On Ladder",
description = "Removes blocking on the ladder.",
author = "Silvers",
version = "1.0",
url = "https://forums.alliedmods.net"
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (!IsClientInGame(client) || GetClientTeam(client) != 3 || GetEntProp(client, Prop_Send, "m_zombieClass") != 8)
return Plugin_Continue;
if (GetEntityMoveType(client) == MOVETYPE_LADDER)
{
SDKHook(client, SDKHook_StartTouch, StartTouch);
}
else if (GetEntityMoveType(client) == MOVETYPE_WALK)
{
SDKHook(client, SDKHook_StartTouch, EndTouch);
}
return Plugin_Continue;
}
public StartTouch(client)
{
SDKUnhook(client, SDKHook_StartTouch, StartTouch);
if (client) SetEntProp(client, Prop_Data, "m_CollisionGroup", 2);
}
public EndTouch(client)
{
SDKUnhook(client, SDKHook_StartTouch, EndTouch);
if (client) SetEntProp(client, Prop_Data, "m_CollisionGroup", 6);
}
|
|
|
|