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

Noblock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Heartless 1.0
Member
Join Date: Aug 2010
Old 03-30-2011 , 18:15   Noblock
Reply With Quote #1

If i use this method for noblock...

Code:
EnableNoBlock(client)
{
    SetEntData(client, g_CollisionOffset, 2, 4, true);
}
I can't run through other players but they can run through me. Is there any way around this without having to enable it globally, for all players. I want it the other way around. I want to be able to run through other players.
Heartless 1.0 is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 03-30-2011 , 18:56   Re: Noblock
Reply With Quote #2

That noblock method changes your collisiongroup. So for the engine you don't collide with other players and vice-versa. If you want to be able to not collide with other players but still making them collide with you (Which they'd get stuck on you when you walk inside them) you should study ShouldCollide functions and intercepting it.
Sammy-ROCK! is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-31-2011 , 04:32   Re: Noblock
Reply With Quote #3

If you use ShouldCollide, prediction will make it feel like you are walking through jelly.
__________________
asherkin is offline
Heartless 1.0
Member
Join Date: Aug 2010
Old 03-31-2011 , 07:33   Re: Noblock
Reply With Quote #4

I want to be able to run through other players, and have them run through me but without enabling noblock globally on all players.
__________________
My Plugins: Explode, Noblock Trigger
Heartless 1.0 is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-31-2011 , 18:18   Re: Noblock
Reply With Quote #5

Use SDKHooks Touch Hook, and execute your snippet on the Players you bump into?

Last edited by AtomicStryker; 03-31-2011 at 18:23.
AtomicStryker is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 03-31-2011 , 21:33   Re: Noblock
Reply With Quote #6

This works

http://forums.alliedmods.net/showthr...ns#post1270623

Players get hooked with

PHP Code:
    SDKHook(clientSDKHook_ShouldCollideOnCollide);
    
SDKHook(clientSDKHook_TouchPlayerTouched);
    
SDKHook(clientSDKHook_EndTouchPlayerUnTouched); 
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
Heartless 1.0
Member
Join Date: Aug 2010
Old 04-04-2011 , 11:22   Re: Noblock
Reply With Quote #7

Quote:
Originally Posted by Heartless 1.0 View Post
PHP Code:
EnableNoBlock(client)
{
    
SetEntData(clientg_CollisionOffset24true);

Quote:
Originally Posted by strontiumdog View Post

PHP Code:
    SDKHook(clientSDKHook_TouchPlayerTouched); 
I'm having trouble trying to integrate these function together along with a timer and a chat trigger; !noblock. Can anyone help me? An example of how i could do this would be nice.

Quote:
Use SDKHooks Touch Hook, and execute your snippet on the Players you bump into?
This is what i have so far...

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

new g_CollisionOffset;
 
public 
Plugin:myinfo =
{
    
name "Noblock Trigger",
    
author "Heartless",
    
description "Allows players to enable noblock on themselves for x seconds",
    
version "1.0",
    
url "http://www.badnetwork.net/"
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_noblock"Command_NoBlock);
    
g_CollisionOffset FindSendPropInfo("CBaseEntity""m_CollisionGroup");
}

public 
Action:Command_NoBlock(clientargs)
{
    if (
IsClientInGame(1) && IsPlayerAlive(1))
    {
        
EnableNoBlock(client);
        
PrintToChat(client"[SM] Noblock enabled for 5 second");
        
CreateTimer(5.0Timer_UnBlockPlayerclient);
    }
    else
    {
        
PrintToChat(client"[SM] You must be alive to use this command");
    }
}

EnableNoBlock(client)
{
    
// Noblock active ie: Players can walk thru each other
    
SetEntData(clientg_CollisionOffset24true);
}

public 
Action:Timer_UnBlockPlayer(Handle:timerany:client)
{
    
// CAN NOT PASS THRU ie: Players can jump on each other
    
SetEntData(clientg_CollisionOffset54true);
    
PrintToChat(client"[SM] Noblock is disabled");
    
    return 
Plugin_Handled;

__________________
My Plugins: Explode, Noblock Trigger
Heartless 1.0 is offline
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 04-06-2011 , 11:07   Re: Noblock
Reply With Quote #8

Quote:
Originally Posted by asherkin View Post
If you use ShouldCollide, prediction will make it feel like you are walking through jelly.
I've been trying to fix this issue but the in the opposite way, making players collide properly (DoD:S) If you were able to pass the "absolute" value of collisongroup in ShouldCollide, client and serverside (not in sdkhooks), you sould be able to fix the client prediction. Maybe someone more experienced than me can answer if it's clientside as well? I cannot find where ShouldCollide is called, i assume it's called from the engine...
Andersso is offline
Heartless 1.0
Member
Join Date: Aug 2010
Old 04-07-2011 , 16:31   Re: Noblock
Reply With Quote #9

Can someone help me? I can't for the life of me figure out how to complete this plugin.

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

new g_CollisionOffset;
 
public 
Plugin:myinfo =
{
    
name "Noblock Trigger",
    
author "Heartless",
    
description "Allows players to enable noblock on themselves for x seconds",
    
version "1.0",
    
url "http://www.badnetwork.net/"
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_noblock"Command_NoBlock);
    
g_CollisionOffset FindSendPropInfo("CBaseEntity""m_CollisionGroup");
}

public 
Action:Command_NoBlock(clientargs)
{
    if (
IsClientInGame(1) && IsPlayerAlive(1))
    {
    
SDKHook(clientSDKHook_TouchPlayerTouched);
    
PrintToChat(client"[SM] Noblock enabled for 5 seconds");
    
CreateTimer(5.0Timer_UnBlockPlayerclient);
    }
    else
    {
        
PrintToChat(client"[SM] You must be alive to use this command");
    }
}

public 
PlayerTouched(clientargs)
{
    
EnableNoBlock(client);
}

EnableNoBlock(client)
{
    
// Noblock active ie: Players can walk thru each other
    
SetEntData(clientg_CollisionOffset24true);
}

DisableNoBlock(client)
{
    
// CAN NOT PASS THRU ie: Players can jump on each other
    
SetEntData(clientg_CollisionOffset54true);
}

public 
Action:Timer_UnBlockPlayer(Handle:timerany:client)
{
    
SDKUnhook(clientSDKHook_TouchPlayerTouched);
    
DisableNoBlock(client);
    
PrintToChat(client"[SM] Noblock is disabled");
    
    return 
Plugin_Handled;    

__________________
My Plugins: Explode, Noblock Trigger
Heartless 1.0 is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 04-08-2011 , 00:31   Re: Noblock
Reply With Quote #10

Quote:
Originally Posted by Heartless 1.0 View Post
Can someone help me? I can't for the life of me figure out how to complete this plugin.

PHP Code:

What doesn't work? You should really use strontiumdog's method.
KyleS 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 14:07.


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