diff options
| author | Cristei Gabriel <cristei.g772@gmail.com> | 2023-11-15 05:17:24 +0200 |
|---|---|---|
| committer | Cristei Gabriel <cristei.g772@gmail.com> | 2023-11-15 05:17:24 +0200 |
| commit | 159db05faf44daf8a8ed326e4fbfd1e98b839a2f (patch) | |
| tree | 2b59697e8f0dc9e84556f38489bcc3d224c7ad3b /sourcemod | |
| parent | 66e9367d4713ae5fe2df20d6c0200c637e78fac0 (diff) | |
should fix stuck on equip bot
Diffstat (limited to 'sourcemod')
| -rw-r--r-- | sourcemod/scripting/bot2player_public.sp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sourcemod/scripting/bot2player_public.sp b/sourcemod/scripting/bot2player_public.sp index a9ca0b3..b9a2be6 100644 --- a/sourcemod/scripting/bot2player_public.sp +++ b/sourcemod/scripting/bot2player_public.sp @@ -229,7 +229,19 @@ public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:an SetConVarInt(NoEndRoundHandle, 1) } ForcePlayerSuicide(iTarget) + + // 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); + CS_RespawnPlayer(iClient) + + SetEntProp(iClient, Prop_Send, "m_bDucked", ducked, 1); + SetEntProp(iClient, Prop_Send, "m_bDucking", ducking, 1); + TeleportEntity(iClient, iTargetOrigin, iTargetAngles, NULL_VECTOR) SetConVarInt(NoEndRoundHandle, 0) PrintToChatAll("%N took control of %N", iClient, iTarget) @@ -459,4 +471,4 @@ public EpicFail(String:FailReason[]) PrintToServer("[%s] - Fatal Error: %s", PLUGIN_NAME, FailReason) SetFailState("[%s] - Fatal Error: %s", PLUGIN_NAME, FailReason) } -//End of
\ No newline at end of file +//End of |
