Raised This Month: $32 Target: $400
 8% 

Bhop only for CT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 09-14-2017 , 07:31   Bhop only for CT
Reply With Quote #1

Hello guys im using this plugin for a VIP SYSTEM, and I want the auto bunnyhop only for CT side and I dont have any ideia from where I should start, can someone help me?

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <vip_core>

public Plugin:myinfo =
{
    
name "[VIP] Bhop",
    
author "KOROVKA",
    
version "1.0.1"
};

#define VIP_BHOP                "BunnyHop"

public VIP_OnVIPLoaded()
{
    
VIP_RegisterFeature(VIP_BHOPBOOL);
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon

    if (
IsPlayerAlive(client) && VIP_IsClientVIP(client) && VIP_IsClientFeatureUse(clientVIP_BHOP) && buttons IN_JUMP && !(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(clientProp_Data"m_nWaterLevel") <= 1
        
buttons &= ~IN_JUMP;

__________________

Last edited by sHoC; 09-14-2017 at 07:31.
sHoC is offline
Vasto_Lorde
Junior Member
Join Date: Oct 2016
Old 09-14-2017 , 07:34   Re: Bhop only for CT
Reply With Quote #2

Function - https://sm.alliedmods.net/new-api/clients/GetClientTeam
cstrike.inc:
Code:
#define CS_TEAM_NONE		0	/**< No team yet. */
#define CS_TEAM_SPECTATOR	1	/**< Spectators. */
#define CS_TEAM_T 			2	/**< Terrorists. */
#define CS_TEAM_CT			3	/**< Counter-Terrorists. */
Vasto_Lorde is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-14-2017 , 10:21   Re: Bhop only for CT
Reply With Quote #3

What Vasto_Lorde Said

Last edited by Halt; 09-14-2017 at 10:22.
Halt is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-14-2017 , 12:00   Re: Bhop only for CT
Reply With Quote #4

untested
Code:
#include <sourcemod>
#include <sdktools>
#include <vip_core>

#pragma semicolon 1
#pragma newdecls required

public void VIP_OnVIPLoaded()
{
    // do your vip things here
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
{
	if(!IsPlayerAlive(client) || IsFakeClient(client) || !VIP_IsClientVIP(client) && !VIP_IsClientFeatureUse(client, "BunnyHop") || GetClientTeam(client) != 3)
	{
		return Plugin_Continue;
	}

	int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
	bool bInWater = (GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 2);
	bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER);

	if((buttons & IN_JUMP) > 0 && iGroundEntity == -1 && !bOnLadder && !bInWater)
	{
		buttons &= ~IN_JUMP;
	}
}
__________________
retired

Last edited by shavit; 09-14-2017 at 12:05.
shavit is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 09-14-2017 , 13:49   Re: Bhop only for CT
Reply With Quote #5

Quote:
Originally Posted by shavit View Post
untested
Code:
#include <sourcemod>
#include <sdktools>
#include <vip_core>

#pragma semicolon 1
#pragma newdecls required

public void VIP_OnVIPLoaded()
{
    // do your vip things here
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
{
	if(!IsPlayerAlive(client) || IsFakeClient(client) || !VIP_IsClientVIP(client) && !VIP_IsClientFeatureUse(client, "BunnyHop") || GetClientTeam(client) != 3)
	{
		return Plugin_Continue;
	}

	int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
	bool bInWater = (GetEntProp(client, Prop_Send, "m_nWaterLevel") >= 2);
	bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER);

	if((buttons & IN_JUMP) > 0 && iGroundEntity == -1 && !bOnLadder && !bInWater)
	{
		buttons &= ~IN_JUMP;
	}
}
I got this errors
__________________
sHoC is offline
fiction
Member
Join Date: May 2017
Old 09-14-2017 , 15:09   Re: Bhop only for CT
Reply With Quote #6

Quote:
Originally Posted by sHoC View Post
I got this errors
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <vip_core>

#pragma semicolon 1
#pragma newdecls required

public int VIP_OnVIPLoaded()
{
    
// do your vip things here
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if(!
IsPlayerAlive(client) || IsFakeClient(client) || !VIP_IsClientVIP(client) && !VIP_IsClientFeatureUse(client"BunnyHop") || GetClientTeam(client) != CS_TEAM_CT)
        return 
Plugin_Continue;

    
int iGroundEntity GetEntPropEnt(clientProp_Send"m_hGroundEntity");
    
bool bInWater = (GetEntProp(clientProp_Send"m_nWaterLevel") >= 2);
    
bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER);

    if((
buttons IN_JUMP) > && iGroundEntity == -&& !bOnLadder && !bInWater)
        
buttons &= ~IN_JUMP;

    return 
Plugin_Continue;

fiction is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 09-14-2017 , 17:45   Re: Bhop only for CT
Reply With Quote #7

Quote:
Originally Posted by fiction View Post
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <vip_core>

#pragma semicolon 1
#pragma newdecls required

public int VIP_OnVIPLoaded()
{
    
// do your vip things here
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if(!
IsPlayerAlive(client) || IsFakeClient(client) || !VIP_IsClientVIP(client) && !VIP_IsClientFeatureUse(client"BunnyHop") || GetClientTeam(client) != CS_TEAM_CT)
        return 
Plugin_Continue;

    
int iGroundEntity GetEntPropEnt(clientProp_Send"m_hGroundEntity");
    
bool bInWater = (GetEntProp(clientProp_Send"m_nWaterLevel") >= 2);
    
bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER);

    if((
buttons IN_JUMP) > && iGroundEntity == -&& !bOnLadder && !bInWater)
        
buttons &= ~IN_JUMP;

    return 
Plugin_Continue;

I get exactly the same errors.
__________________
sHoC is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 09-15-2017 , 07:54   Re: Bhop only for CT
Reply With Quote #8

How do I fix this error?


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

#pragma semicolon 1 
#pragma newdecls required 

#define VIP_BHOP                "BunnyHop"

public VIP_OnVIPLoaded()
{
    
VIP_RegisterFeature(VIP_BHOPBOOL);
}

public 
Action OnPlayerRunCmd(int clientint &buttons

    if(!
IsPlayerAlive(client) || IsFakeClient(client) || !VIP_IsClientVIP(client) && !VIP_IsClientFeatureUse(client"BunnyHop") || GetClientTeam(client) != CS_TEAM_CT
        return 
Plugin_Continue

    
int iGroundEntity GetEntPropEnt(clientProp_Send"m_hGroundEntity"); 
    
bool bInWater = (GetEntProp(clientProp_Send"m_nWaterLevel") >= 2); 
    
bool bOnLadder = (GetEntityMoveType(client) == MOVETYPE_LADDER); 

    if((
buttons IN_JUMP) > && iGroundEntity == -&& !bOnLadder && !bInWater
        
buttons &= ~IN_JUMP

    return 
Plugin_Continue

__________________
sHoC is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 09-15-2017 , 08:46   Re: Bhop only for CT
Reply With Quote #9

Try adding return type to VIP_OnVipLoaded, I think thats required in new syntax.
If it returns integer for example then it should be public int VIP_OnVipLoaded or if it returns nothing then public void VIP_OnVipLoaded

Or if you don't want to bother with new syntax, remove that #pragma newdecls required up the top

Last edited by hmmmmm; 09-15-2017 at 08:47.
hmmmmm is offline
fiction
Member
Join Date: May 2017
Old 09-15-2017 , 09:58   Re: Bhop only for CT
Reply With Quote #10

Quote:
Originally Posted by sHoC View Post
How do I fix this error?
That error is because you reverted a change that I put in my first response to you, you removed the "int" between public and VIP_OnVIPLoaded.
fiction is offline
Reply


Thread Tools
Display Modes

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 23:58.


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