Raised This Month: $ Target: $400
 0% 

CollisionHook


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mirandor
Senior Member
Join Date: Jun 2006
Location: Ile de France
Old 03-14-2013 , 13:51   Re: CollisionHook
Reply With Quote #11

Works on cs:s but get random crashs...

Code:
#include <sourcemod>
#include <collisionhook>


#define VERSION "1.0"

#pragma semicolon 1

public Plugin:myinfo =
{
    name = "NoCollide using CollisionHook (with Team Filter)",
    author = "",
    description = "Players dont collide with team-mates.",
    version = VERSION,
    url = ""
};

public OnPluginStart()
{
    CreateConVar( "sm_nocollideteam_version", VERSION, "Version of NoCollide Team Filter", FCVAR_PLUGIN | FCVAR_REPLICATED | FCVAR_NOTIFY );
}

public Action:CH_PassFilter( ent1, ent2, &bool:result)
{
    if ( IsValidClient( ent1 ) && IsValidClient( ent2 ) )
        {
        if( GetClientTeam( ent1 ) != GetClientTeam( ent2 ) )
        {
            result = true;
            return Plugin_Handled;
        }
        result = false;
        return Plugin_Handled;
    }
    return Plugin_Continue;
}

stock bool:IsValidClient( client ) 
{
    if ( 0 < client <= MaxClients && IsClientInGame(client) ) 
        return true; 
     
    return false; 
}
SM 1.5dev MM1.10.0dev - linux

Last edited by Mirandor; 03-14-2013 at 14:04.
Mirandor is offline
 



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 21:46.


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