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

Semiclip Help - Only when player is above?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-21-2011 , 18:03   Semiclip Help - Only when player is above?
Reply With Quote #1

Seems like there are a lot of semiclip requests today. this came up in suggestions/requests: Somebody wants to block players from standing on top of each other, but would still want them to block other players. So it seems like this would be a modified version of a semi clip. I was trying to understand the get_user_origin function, but am having trouble. Any suggestions?
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-21-2011 , 21:14   Re: Semiclip Help - Only when player is above?
Reply With Quote #2

search for anti-boost
__________________
Impossible is Nothing
Sylwester is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-22-2011 , 12:31   Re: Semiclip Help - Only when player is above?
Reply With Quote #3

cool thanks for the right keywords. my brain was stuck in semiclip mode...

Anyways, here is the link for the solution for anybody else looking.

http://forums.alliedmods.net/showpos...8&postcount=11

Edit: Tried to compile and received this error:
/tmp/textRSwiQW.sma(26) : error 001: expected token: ")", but found "{"

Anybody see where the mistake is?

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

new Float:g_ground_origin[33][3];

new 
g_max_players;

public 
plugin_init()
{
    
register_plugin("No Boosting T's""0.1""Exolent");
    
    
register_forward(FM_Touch"FwdTouch");
    
register_forward(FM_PlayerPreThink"FwdPlayerPreThink");
    
    
g_max_players global_get(glb_maxClients);
}

public 
FwdTouch(boosterplr)
{
    if( !
pev_valid(booster) || !pev_valid(plr)
    || !(
booster <= g_max_players) || !(plr <= g_max_players)
    || !
is_user_alive(booster || !is_user_alive(plr) )
    {
        return;
    }
    
    new 
CsTeams:plr_team cs_get_user_team(plr);
    
    if( 
cs_get_user_team(booster) != plr_team
    
|| plr_team != CS_TEAM_T )
    {
        return;
    }
    
    new 
Float:booster_origin[3], Float:plr_origin[3];
    
pev(boosterpev_originbooster_origin);
    
pev(plrpev_originplr_origin);
    
    if( !(
49.0 < (plr_origin[2] - booster_origin[2]) < 73.0) )
    {
        return;
    }
    
    if( 
pev(plrpev_flags)&FL_DUCKING )
    {
        
g_ground_origin[plr][2] -= 18.0;
    }
    
    
set_pev(plrpev_origing_ground_origin[plr]);
}

public 
FwdPlayerPreThink(plr)
{
    if( 
is_user_alive(plr) && pev(plrpev_flags)&FL_ONGROUND )
    {
        
pev(plrpev_origing_ground_origin[plr]);
    }

Edit 2: Nevermind, found error

Change this:
PHP Code:
|| !is_user_alive(booster || !is_user_alive(plr) ) 
To this:
PHP Code:
|| !is_user_alive(booster) || !is_user_alive(plr) ) 
So working code is:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

new Float:g_ground_origin[33][3];

new 
g_max_players;

public 
plugin_init()
{
    
register_plugin("No Boosting T's""0.1""Exolent");
    
    
register_forward(FM_Touch"FwdTouch");
    
register_forward(FM_PlayerPreThink"FwdPlayerPreThink");
    
    
g_max_players global_get(glb_maxClients);
}

public 
FwdTouch(boosterplr)
{
    if( !
pev_valid(booster) || !pev_valid(plr)
    || !(
booster <= g_max_players) || !(plr <= g_max_players)
    || !
is_user_alive(booster) || !is_user_alive(plr) )
    {
        return;
    }
    
    new 
CsTeams:plr_team cs_get_user_team(plr);
    
    if( 
cs_get_user_team(booster) != plr_team
    
|| plr_team != CS_TEAM_T )
    {
        return;
    }
    
    new 
Float:booster_origin[3], Float:plr_origin[3];
    
pev(boosterpev_originbooster_origin);
    
pev(plrpev_originplr_origin);
    
    if( !(
49.0 < (plr_origin[2] - booster_origin[2]) < 73.0) )
    {
        return;
    }
    
    if( 
pev(plrpev_flags)&FL_DUCKING )
    {
        
g_ground_origin[plr][2] -= 18.0;
    }
    
    
set_pev(plrpev_origing_ground_origin[plr]);
}

public 
FwdPlayerPreThink(plr)
{
    if( 
is_user_alive(plr) && pev(plrpev_flags)&FL_ONGROUND )
    {
        
pev(plrpev_origing_ground_origin[plr]);
    }

__________________

Last edited by joshknifer; 11-22-2011 at 13:06. Reason: Found Error
joshknifer is offline
Send a message via Skype™ to joshknifer
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 01:42.


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