AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Limit sending an entitys property (???) (https://forums.alliedmods.net/showthread.php?t=316250)

wooler 05-14-2019 09:27

Limit sending an entitys property (???)
 
Hello,

I'm a beginner at SourcePawn and coding in general, and I have a problem with a plugin I'm trying to make.

I'm using the SetEntPropFloat function to set glowing outlines for a player using m_flDetectedByEnemySensorTime. I successfully managed to code the plugin, but my problem is that the outline is visible to all the players on the server. Could someone explain to me how I can limit it to be seen by only the player causing the damage (iAttacker)? By managing the way the data is sent I assume (Prop_Send ???)?

Here's the part of the code I need to change:
SetEntPropFloat(iVictim, Prop_Send, "m_flDetectedByEnemySensorTime", GetGameTime() + 5);

Even though I'm a noob at coding, I can do some efficient research, so any nudge towards the right direction would be appreciated if this is indeed possible! :)

MasterMind420 05-14-2019 15:16

Re: Limit sending an entitys property (???)
 
Quote:

Originally Posted by wooler (Post 2651611)
Hello,

I'm a beginner at SourcePawn and coding in general, and I have a problem with a plugin I'm trying to make.

I'm using the SetEntPropFloat function to set glowing outlines for a player using m_flDetectedByEnemySensorTime. I successfully managed to code the plugin, but my problem is that the outline is visible to all the players on the server. Could someone explain to me how I can limit it to be seen by only the player causing the damage (iAttacker)? By managing the way the data is sent I assume (Prop_Send ???)?

Here's the part of the code I need to change:
SetEntPropFloat(iVictim, Prop_Send, "m_flDetectedByEnemySensorTime", GetGameTime() + 5);

Even though I'm a noob at coding, I can do some efficient research, so any nudge towards the right direction would be appreciated if this is indeed possible! :)

in my experience trying to settransmit glows on clients has failed...i've heard from the grapevine there's a way but never figured it out, nor have i found anything on allied modders as how to do it.

Neuro Toxin 05-14-2019 18:38

Re: Limit sending an entitys property (???)
 
This should help...

https://forums.alliedmods.net/showthread.php?p=2476344

wooler 05-15-2019 08:37

Re: Limit sending an entitys property (???)
 
Quote:

Originally Posted by MasterMind420 (Post 2651654)
in my experience trying to settransmit glows on clients has failed...i've heard from the grapevine there's a way but never figured it out, nor have i found anything on allied modders as how to do it.

Thanks, settransmit helped alot :)

Quote:

Originally Posted by Neuro Toxin (Post 2651677)

I was looking through the glow plugins on alliedmodders and I managed to get this far, but as I'm a noob coder, I'm currently having some troubles with determining how to check if the player was the one dealing the damage. Here are the snippets from my code:

https://paste.ofcode.org/RZRDe6k8sw2hEcfxQD4BgM

Any suggestions on how I could produce the callback function for SDKHook that checks if the player was the one doing the damage (== if the glow should be transmitted to the player being checked)?

Can I somehow create a glows_caused list (entry deleted with a timer or in player_death event) for the iAttacker client that references the unique entities (glows) that a player has created by dealing damage, so I can check if a player is the one who caused that exact glow? If yes, how can i check if the hooked entity is found in a players glows_caused list? Does the SDKHook give me something unique about the entity I can check against?

Is there a more simple way of doing this? This is getting way over my head and skill-level :roll:

TLDR explanation of what I want from the plugin;
Player that takes damage shows a glow effect for the player dealing the damage. Only the player dealing the damage will see the glow, and the glow is removed after a timer runs out / playerdeath event.

8guawong 05-15-2019 13:28

Re: Limit sending an entitys property (???)
 
maybe you can use this

https://forums.alliedmods.net/showpo...&postcount=348

with m_flDetectedByEnemySensorTime

not sure


All times are GMT -4. The time now is 23:27.

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