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

[CSS] How to kill sent tempent?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anathematized
Junior Member
Join Date: May 2012
Old 06-13-2012 , 04:55   [CSS] How to kill sent tempent?
Reply With Quote #1

I got a little problem with temp ents. I set TE_SetupBeamFollow which I send only to a single player. The colours of beam are different for both teams and there appears a problem. Life time of a beam is 10 secs and when alive player is changing his team the colours blend each other and I get violet instead of red and blue :/

Is it possible to remove or kill a temp ent, which has been already sent to a client?
Anathematized is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-13-2012 , 05:43   Re: [CSS] How to kill sent tempent?
Reply With Quote #2

https://developer.valvesoftware.com/...mporary_entity
Quote:
Originally Posted by Valve wiki
Temporary entities are used by the server to create short-lived or one-off effects on clients. They are different to standard entities in that they are 'fire and forget'; once one has been created, the server has nothing more to do with it. TEs have no edict or entity index, and do not count toward the entity limit.
TEs are unreliable and get dropped if too many are created at once. The maximum per update is 32 in multiplayer and 255 in single player.
How to stop TE

Last edited by Bacardi; 06-13-2012 at 05:47.
Bacardi is offline
Anathematized
Junior Member
Join Date: May 2012
Old 06-13-2012 , 09:08   Re: [CSS] How to kill sent tempent?
Reply With Quote #3

Thanks a lot, but how to make it visible only to a single player? When I spawn it as en entity all players are able to see the beam.

Last edited by Anathematized; 06-13-2012 at 10:53.
Anathematized is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-13-2012 , 11:31   Re: [CSS] How to kill sent tempent?
Reply With Quote #4

I think you would need a SetTransmit hook or something (from SDKHooks ?) as the entity does not support showing itself to a certain player only.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Anathematized
Junior Member
Join Date: May 2012
Old 06-13-2012 , 14:14   Re: [CSS] How to kill sent tempent?
Reply With Quote #5

Quote:
Originally Posted by berni View Post
I think you would need a SetTransmit hook or something (from SDKHooks ?)
I read that using Hook_SetTransmit I can hide anything to anyone but still don't know how :/
Could you please explain how should I use it to hide an entity for all players except one chosen?
Anathematized is offline
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 06-13-2012 , 16:39   Re: [CSS] How to kill sent tempent?
Reply With Quote #6

Quote:
Originally Posted by Anathematized View Post
I read that using Hook_SetTransmit I can hide anything to anyone but still don't know how :/
Could you please explain how should I use it to hide an entity for all players except one chosen?
Code:
public SpawnEntity(bla bla bla)
{
   //after you've spawned your entity
   SDKHook(entities[client], SDKHook_SetTransmit, Hook_SetTransmit);
}
public Action:Hook_SetTransmit(entity, client)
{	
	if(entities[client] && EntRefToEntIndex(entities[client]) == entity )
		return Plugin_Handled;
	return Plugin_Continue;
}

Last edited by Zylius; 06-13-2012 at 16:39.
Zylius is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-13-2012 , 17:11   Re: [CSS] How to kill sent tempent?
Reply With Quote #7

Quote:
Originally Posted by Zylius View Post
Code:
public SpawnEntity(bla bla bla)
{
   //after you've spawned your entity
   SDKHook(entities[client], SDKHook_SetTransmit, Hook_SetTransmit);
}
public Action:Hook_SetTransmit(entity, client)
{    
    if(entities[client] && EntRefToEntIndex(entities[client]) == entity )
        return Plugin_Handled;
    return Plugin_Continue;
}
As mentioned earlier, TEs have no edict or entity index, so this code doesn't exactly work.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 06-13-2012 , 19:51   Re: [CSS] How to kill sent tempent?
Reply With Quote #8

Quote:
Originally Posted by Anathematized View Post
I read that using Hook_SetTransmit I can hide anything to anyone but still don't know how :/
Could you please explain how should I use it to hide an entity for all players except one chosen?
blodia is offline
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 06-14-2012 , 02:06   Re: [CSS] How to kill sent tempent?
Reply With Quote #9

Quote:
Originally Posted by Powerlord View Post
As mentioned earlier, TEs have no edict or entity index, so this code doesn't exactly work.
As I understood, OP started using regular entities

Last edited by Zylius; 06-14-2012 at 02:15.
Zylius is offline
Anathematized
Junior Member
Join Date: May 2012
Old 06-14-2012 , 05:29   Re: [CSS] How to kill sent tempent?
Reply With Quote #10

Yes. I finally create env_spritetrail entity insted of using tempents so SetTransmit should work. I think good idea would be changing topic title but I don't know if I should do this.
Zylius, I'll check your code when I come home. This will hide entities[client] for client? Is my thinking good? Sorry for stupid questions. This is my first time using SetTransmit.

Last edited by Anathematized; 06-14-2012 at 05:29.
Anathematized 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 16:46.


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