Raised This Month: $51 Target: $400
 12% 

[CS:S/CS:GO] Tube Anti Bhop (for mods like Zombiemod)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 03-28-2014 , 15:03   [CS:S/CS:GO] Tube Anti Bhop (for mods like Zombiemod)
Reply With Quote #1

This small plugin blocks bhop inside tubes, but allows bhop elsewhere.

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1

#define PLUGIN_VERSION "1.0"

#define JUMP_COOLDOWN 0.2

public Plugin:myinfo 
{
name "Tube Anti BHop",
author "Zipcore",
description "Stops Bunnyhoppers inside tubes etc.",
version PLUGIN_VERSION,
};

new 
Float:g_fNextJump[MAXPLAYERS+1];

public 
OnPluginStart()
{
HookEvent("player_spawn"Event_PlayerSpawn);
HookEvent("player_jump"Event_Jump);
}

public 
Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new 
client GetClientOfUserId(GetEventInt(event"userid"));

g_fNextJump[client] = GetGameTime();

return 
Plugin_Continue;
}

public 
Action:Event_Jump(Handle:event,const String:name[],bool:dontBroadcast)
{
new 
client GetClientOfUserId(GetEventInt(event"userid"));

g_fNextJump[client] = GetGameTime()+JUMP_COOLDOWN;
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
new 
Float:time GetGameTime();

//Is player allowed to jump
if(buttons IN_JUMP && g_fNextJump[client] > time)
{
buttons &= ~IN_JUMP//block jump
TeleportEntity(clientNULL_VECTORNULL_VECTORFloat:{0.0,0.0,0.0}); //Set speed to zero
return Plugin_Changed;
}

return 
Plugin_Continue;

__________________

Last edited by asherkin; 01-14-2015 at 19:58.
zipcore is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode