Raised This Month: $ Target: $400
 0% 

[SNIPPET][CSS] Remove Player Stacking Limit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 05-26-2010 , 14:00   [SNIPPET][CSS] Remove Player Stacking Limit
Reply With Quote #1

When css was first released you could stack on top of other players as high as you wanted. i remember having fun on zombie horde servers where the whole human team would find a spot and make a wall of players stacking up 4-5 players high side by side.

Then valve decided to limit how high you could stack, currently only 1 player can stand on top of another, if a 3rd player tries to stand on top of both players they will not be able to move and will slide off. this might be ok for regular css and some mods but for others it kind of ruins teamwork like most zombie mods.

you need sdkhooks

PHP Code:
#include <sourcemod>
#include <sdkhooks>

#pragma semicolon 1

public OnPluginStart()
{
    for (new 
client 1client <= MaxClientsclient++) 
    { 
        if (
IsClientInGame(client)) 
        { 
            
SDKHook(clientSDKHook_PostThinkOnPostThink);
        } 
    }
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_PostThinkOnPostThink);
}

public 
OnPostThink(client)
{
    new 
GroundEnt GetEntPropEnt(clientProp_Send"m_hGroundEntity");
    
    if ((
GroundEnt 0) && (GroundEnt <= MaxClients))
    {
        
SetEntPropEnt(clientProp_Send"m_hGroundEntity"0);
    }

m_hGroundEntity stores the entity the player is standing on, the game will check if its a player, if it is then it will check if that player is standing on a player. by setting m_hGroundEntity to 0 you're telling the game the player is standing on the ground(world entity) so you can stack as high as you want.

Last edited by blodia; 07-29-2010 at 15:10.
blodia is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 05-27-2010 , 21:22   Re: [SNIPPET][CSS] Remove Player Stacking Limit
Reply With Quote #2

Is there a way to limit it by team so that the humans could use this but not the zombies?
__________________
zeroibis is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 05-28-2010 , 00:44   Re: [SNIPPET][CSS] Remove Player Stacking Limit
Reply With Quote #3

Humans = Counter-Terrorists


Blodia you're giving me so many ideas for mods it's insane, thanks a ton for these.
KyleS is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 05-28-2010 , 08:52   Re: [SNIPPET][CSS] Remove Player Stacking Limit
Reply With Quote #4

PHP Code:
public OnPostThink(client

    if (
GetClientTeam(client) != 3)
    {
        return;
    }
    
    new 
GroundEnt GetEntPropEnt(clientProp_Send"m_hGroundEntity"); 
     
    if ((
GroundEnt 0) && (GroundEnt <= MaxClients)) 
    { 
        
SetEntPropEnt(clientProp_Send"m_hGroundEntity"0); 
    } 

ct are team 3 and t are team 2.

only thing is if you're playing zombiemod or zombie reloaded humans on terrorist won't be able to stack until the 1st zombie spawns. you could probably stick another condition in the 1st if statement to check if the 1st zombie has spawned.

np kyle, thats why i stuck them up, i knew someone would find them useful.

Last edited by blodia; 05-28-2010 at 09:00.
blodia 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 18:25.


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