|
Member
|
09-08-2017
, 00:52
Re: Looking for a pluggin - Auto slay bunnyhoppers.
|
#11
|
Quote:
Originally Posted by ssphreak
Hello fiction - i have tested this last version, and it is super close. It makes it a lot harder, but players are still able to bunnyhop as the timing for the bunnyhop is before the hitting the ground. I presume almost instantly, if hit is not pressed at the precise moment this plugin stops them for the tic inputed (i tested 1,3,5,10,50) all intervals they were able to bhop.
How about after a player presses jump, each jump pressed afterwards does nothing for a set amount of tics? almost a combo of the two?
Thank you so much for your time!
|
PHP Code:
#pragma semicolon 1 #pragma newdecls required
#include <sourcemod> #include <sdktools>
ConVar g_cvJumpBlockedTicks;
int g_iPassedTicks[MAXPLAYERS + 1] = {-1, ...};
public void OnPluginStart() { HookEvent("player_spawn", Event_PlayerSpawn); HookEvent("player_jump", Event_PlayerJump);
g_cvJumpBlockedTicks = CreateConVar("sm_jump_blocked_ticks", "100", "Ticks/frames after jumping before you are able to jump again.", _, true, 0.0); }
public void Event_PlayerSpawn(Event event, const char[] command, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); g_iPassedTicks[client] = -1; }
public void Event_PlayerJump(Event event, const char[] command, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); g_iPassedTicks[client] = 0; }
public Action OnPlayerRunCmd(int client, int &buttons) { Action iReturn = Plugin_Continue; static bool bReleasedJump[MAXPLAYERS + 1] = {true, ...}; if(!IsPlayerAlive(client) || IsFakeClient(client)) return iReturn;
if(g_cvJumpBlockedTicks.IntValue > g_iPassedTicks[client] >= 0) { g_iPassedTicks[client]++;
if(buttons & IN_JUMP) { buttons &= ~IN_JUMP; iReturn = Plugin_Changed; } } else if(g_iPassedTicks[client] == g_cvJumpBlockedTicks.IntValue) { g_iPassedTicks[client] = -1; bReleasedJump[client] = false; }
if(g_iPassedTicks[client] == -1 && !bReleasedJump[client]) { if(!(buttons & IN_JUMP)) bReleasedJump[client] = true;
if(!bReleasedJump[client]) { buttons &= ~IN_JUMP; iReturn = Plugin_Changed; } }
return iReturn; }
Last edited by fiction; 09-08-2017 at 00:53.
|
|
|
|