From b0b6f32c17f5efa5b35926430e721735371c3bce Mon Sep 17 00:00:00 2001 From: Cristei Gabriel Date: Wed, 15 Nov 2023 06:05:24 +0200 Subject: make player take bot ducktime & more --- sourcemod/scripting/bot2player_public.sp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'sourcemod/scripting') diff --git a/sourcemod/scripting/bot2player_public.sp b/sourcemod/scripting/bot2player_public.sp index b9a2be6..3dccd34 100644 --- a/sourcemod/scripting/bot2player_public.sp +++ b/sourcemod/scripting/bot2player_public.sp @@ -232,15 +232,23 @@ public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:an // note(cristeigabriel): seems to fix getting stuck while // in position that requires crouching - int ducked; - int ducking; - ducked = GetEntProp(iTarget, Prop_Send, "m_bDucked", 1); - ducking = GetEntProp(iTarget, Prop_Send, "m_bDucking", 1); + int ducked, ducking; + float ducktime2, duckjumptime; + int injumpduck; + + ducked = GetEntProp(iTarget, Prop_Send, "m_bDucked", 1); + ducking = GetEntProp(iTarget, Prop_Send, "m_bDucking", 1); + ducktime2 = GetEntPropFloat(iTarget, Prop_Send, "m_flDucktime"); + duckjumptime = GetEntPropFloat(iTarget, Prop_Send, "m_flDuckJumpTime"); + injumpduck = GetEntProp(iTarget, Prop_Send, "m_bInDuckJump", 1); CS_RespawnPlayer(iClient) SetEntProp(iClient, Prop_Send, "m_bDucked", ducked, 1); SetEntProp(iClient, Prop_Send, "m_bDucking", ducking, 1); + SetEntPropFloat(iClient, Prop_Send, "m_flDucktime", ducktime2); + SetEntPropFloat(iClient, Prop_Send, "m_flDuckJumpTime", duckjumptime); + SetEntProp(iClient, Prop_Send, "m_bInDuckJump", injumpduck, 1); TeleportEntity(iClient, iTargetOrigin, iTargetAngles, NULL_VECTOR) SetConVarInt(NoEndRoundHandle, 0) @@ -327,7 +335,7 @@ public Action:DisplayTakeOverMessage(Handle:timer, any:iClient) { if (ClientCash >= BotTakeverCost[iClient]) { - PrintHintText(iClient, "Press the Use key [default E] to take control of %s", BotTakeverCost[iClient], BOTName) + PrintHintText(iClient, "Press the Use key [default E] to take control of %s", BOTName) return Plugin_Continue } else -- cgit v1.2.3