Raised This Month: $99 Target: $400
 24% 

Client cant pass entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 04-03-2018 , 05:20   Client cant pass entity
Reply With Quote #1

What i'm doing wrong here like everything is OK but its not working ?

PHP Code:
#include <collisionhook>

SetEntProp(entProp_Data"m_CollisionGroup"2);

public 
Action:CH_PassFilter(ent1ent2, &bool:result)
{
    new 
client ent2;
    new 
ent ent1;
    
    if(
<= client <= MaxClients && IsClientConnected(client) && IsValidEntity(ent) && GetClientTeam(client) == CS_TEAM_T)
    {
        
result false;
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;


Last edited by Kellan123; 04-05-2018 at 02:38.
Kellan123 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-03-2018 , 10:41   Re: Client cant pass entity
Reply With Quote #2

How about more of your code, what exactly is "ent"
__________________
Mitchell is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 04-04-2018 , 15:13   Re: Client cant pass entity
Reply With Quote #3

Quote:
Originally Posted by Kellan123 View Post
What i'm doing wrong here like everything is OK but its not working ?

PHP Code:
#include <collisionhook>

SetEntProp(entProp_Data"m_CollisionGroup"2);

public 
Action:CH_PassFilter(ent1ent2, &bool:result)
{
    new 
client ent2;
    new 
ent ent1;
    
    if(
<= client <= MaxClients && IsClientConnected(client) && IsValidEntity(ent) && GetClientTeam(client) == CS_TEAM_T)
        
result false;
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

Try setting result to true, so the entities collide and client doesn't pass entity, as the CollisionHook extension mentions:

simply set result to true if you wish for the entities to collide.
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 15$

Last edited by eyal282; 04-04-2018 at 15:14.
eyal282 is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 04-05-2018 , 02:39   Re: Client cant pass entity
Reply With Quote #4

can still pass...

Last edited by Kellan123; 04-05-2018 at 14:55.
Kellan123 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-13-2018 , 09:25   Re: Client cant pass entity
Reply With Quote #5

I mean you've given us barely any information of what "ent" is like i said before. So its pretty hard to help you.
__________________
Mitchell is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 04-17-2018 , 09:25   Re: Client cant pass entity
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
I mean you've given us barely any information of what "ent" is like i said before. So its pretty hard to help you.
Array ent, also the ent is player too too so yeah, why you ask if you dont event know what the ent is....

Last edited by Kellan123; 04-17-2018 at 09:26.
Kellan123 is offline
AdRiAnIlloO
Junior Member
Join Date: Jul 2015
Location: Spain
Old 04-17-2018 , 09:47   Re: Client cant pass entity
Reply With Quote #7

While in C/C++, you just have modify the value of reference parameters (&) to alter the outer variable aliased by them, in SM you also have to
Code:
return Plugin_Changed;
for the changes to happen on the caller stack. Well, at least for hook functions.

Replace
Code:
return Plugin_Handled;
with it.

Last edited by AdRiAnIlloO; 04-17-2018 at 09:52.
AdRiAnIlloO is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-17-2018 , 10:17   Re: Client cant pass entity
Reply With Quote #8

Quote:
Originally Posted by Kellan123 View Post
Array ent, also the ent is player too too so yeah, why you ask if you dont event know what the ent is....
Well seeing that what ever "ent" is actually you are setting it to have debris collision, i.e. ignores all collisions, even triggers. ent2 is a player, that's only given because you're assigning the "client" variable to ent2 (for some reason).
Also 'ent' isn't an array, im not even too sure why you mentioned it.
Where are you even setting the 'ent's collision?

provide. more. of. your. code.
__________________
Mitchell is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-17-2018 , 10:24   Re: Client cant pass entity
Reply With Quote #9

Quote:
Originally Posted by AdRiAnIlloO View Post
While in C/C++, you just have modify the value of reference parameters (&) to alter the outer variable aliased by them, in SM you also have to
Code:
return Plugin_Changed;
for the changes to happen on the caller stack.
This isn't really what's happening. The reference parameter is changed in the caller either way, but the caller is just a function in the extension. It's not a reference to real data the server is using. The convention could have been that the extension checks the parameters to see if they're changed but this would be irritating for the author, so instead it's just to check the return Action.
Fyren is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 04-17-2018 , 11:48   Re: Client cant pass entity
Reply With Quote #10

Quote:
Originally Posted by Fyren View Post
This isn't really what's happening. The reference parameter is changed in the caller either way, but the caller is just a function in the extension. It's not a reference to real data the server is using. The convention could have been that the extension checks the parameters to see if they're changed but this would be irritating for the author, so instead it's just to check the return Action.
true, its not working "return Plugin_Changed", dunno its so bad in SM... always need something special...

Last edited by Kellan123; 04-17-2018 at 11:49.
Kellan123 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 03:53.


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