PDA

View Full Version : [FF2] [Subplugin] Projectile Particles


Otokiru
04-30-2012, 20:22
http://i.imgur.com/evaSr.png

FF2 Projectile Particles. (Add trails effect on hales bullets!) (Latest Version: v1.2)
Original idea & credits, DarthNinja from HolyArrow (http://forums.alliedmods.net/showthread.php?t=145777) Plugin. Re-coded by Otokiru.

Installation:

ff2_otokiru_pp.ff2 -> plugins/freaks/
ff2_otokiru_pp.sp -> scripting/


CFG Configs:
Replace ? with your last ability number. DUH!
"ability?"
{
"name" "projectile_particles"
"arg1" "coin_large_blue" // Particles effect name
"arg2" "1" // Holyness level. The higher = The brighter = More lag.
"plugin_name" "ff2_otokiru_pp"
}

Other Notes:

Only works on these projectiles (aka bullets):

arrow
ball_ornament
energy_ball
energy_ring
flare
healing_bolt
jar
jar_milk
pipe
pipe_remote
rocket
sentryrocket
stun_ball
syringe
Other Particles Effects Names

YouTube video (http://www.youtube.com/watch?v=u8Z0fj7aklc) of some particles effect samples by SlimeCounty (http://forums.alliedmods.net/showpost.php?p=1685245&postcount=38).
https://developer.valvesoftware.com/wiki/List_of_TF2_Particles
Kindda outdated post, but there's more here (https://forums.alliedmods.net/showpost.php?p=1182812&postcount=1).
Some particles you might want to be careful due to this (http://forums.alliedmods.net/showpost.php?p=1377231&postcount=12).

ChangeLog:

v1.2:

Fixed Client index is invalid error. (yet again) :oops:
No other changes. Replace .ff2 will do in this update.

v1.1:

Fixed Client index is invalid error.
No other changes. Replace .ff2 will do in this update.

v1.0:

Initial Release.



Tell me if there's any problem. Enjoy! :3

Diviara27
04-30-2012, 21:19
FF2 Projectile Particles. (Add trails effect on hales bullets!)
Original idea & credits, DarthNinja from HolyArrow (http://forums.alliedmods.net/showthread.php?t=145777) Plugin. Re-coded by Otokiru.

Installation:

ff2_otokiru_pp.ff2 -> plugins/freaks/
ff2_otokiru_pp.sp -> scripting/


CFG Configs:
Replace ? with your last ability number. DUH!
"ability?"
{
"name" "projectile_particles"
"arg1" "coin_large_blue" // Particles effect name
"arg2" "1" // Holyness level. The higher = The brighter = More lag.
"plugin_name" "ff2_otokiru_pp"
}

Other Notes:

Do you know any other particles effect names?

Otokiru
04-30-2012, 22:50
Do you know any other particles effect names?

https://developer.valvesoftware.com/wiki/List_of_TF2_Particles

Some particles you might want to be careful due to this (http://forums.alliedmods.net/showpost.php?p=1377231&postcount=12).

//Edited
Kindda outdated post, but there's more here (https://forums.alliedmods.net/showpost.php?p=1182812&postcount=1).

Rainicorn
06-02-2014, 06:27
I love this plugin! I just wish that there was a way to replace the particle on a projectile in addition to adding one. For example, removing the smoke trail on rockets or flares, so that only this trail remains. The plugin as it is now functions wonderfully though. Thank you for making it!

friagram
06-05-2014, 05:26
They are clientside particles
You can try sending an input to stop the particle, but it probably won't work..
I know it works on models, but probably not projectiles.

Perhaps setting the projectiles model to something that has no particle on spawn hook (like a healthkit or some crap) would prevent it from showing up, but if the client predicts it, It probably will anyway.

sarysa
06-05-2014, 08:52
Actually friagram, when I worked on Button's projectiles (which originally used the Rescue Ranger) I originally tried to change them with OnEntityCreated / SDKHook_SpawnPost much like the easter bunny, but it wouldn't work. The code was indeed executing, but I think a good number of projectiles have some kind of script associated with them which executes even after SpawnPost.
Another thing that hints at this is if you try to give a normal gun arrow projectiles, they just drop like a rock, vecVelocity { 0, 0, decreasingNegativeFloat }.
And with the projectile turret I worked on, spawned arrows just have absolutely nothing...no particle effects or trails, not even collision. That really tells me the effects are independent of the models...

friagram
06-05-2014, 15:12
Seems Arcing projectiles will not be sent velocity (it won't be calculated) unless the weapon class specifies it, as it wouldn't make sense to do it since hitscan doesn't need it. You can just calculate the velocity manually and teleport them after creating them by name, manually.

sarysa
06-06-2014, 01:57
Oh, I know...and I did. But when I'd attempted to manually create tf_projectile_arrow via CreateEntityByName, it literally had nothing you'd expect a projectile to have by default. No trail, that's a given...but because of no collision, my turrets eventually caused the server to crash by running out of entities. They'd not only fail to hit players, but they'd fall through the world indefinitely and never despawn. :D

For whatever reasons, legit tf_projectile_arrow entities have some complicated logic going on that's very difficult for us to emulate. Probably not impossible, but beyond my patience level for the scope of the project. (since loose cannon projectiles are really what my project needed anyway, and they were easy)

friagram
06-06-2014, 17:14
Settheir collisiongroup to projectile, and set their solidflags.
I dont remember but I think its 13/0

sarysa
06-07-2014, 04:08
Settheir collisiongroup to projectile, and set their solidflags.
I dont remember but I think its 13/0

Yep, 13.

93SHADoW
01-02-2016, 02:07
Just a minor update so multiple bosses can use this passive ability, in addition to allowing all projectile types (tf_projectile) to use this ability.

Also fixed projectile particles applying only after the boss RAGES. Now starts applying upon round start.

CFG Config hasn't really changed at all, if the same particle effect is desired across all of the boss's projectiles.

"abilityX"
{
"name" "projectile_particles"
"arg1" "coin_large_blue" // Particles effect name
"arg2" "1" // Holyness level. The higher = The brighter = More lag.
"plugin_name" "ff2_otokiru_pp"
}


Otherwise, here's a new addition, if different particle effects for different projectiles are desired.

"abilityX"
{
"name" "projectile_particle_X" // replace X with a number from 0-16
"arg1" "tf_projectile_arrow" // Projectile Name
"arg2" "coin_large_blue" // Particle Effect Name
"arg3" "1" // Holyness level. The higher = The brighter = More lag.
"plugin_name" "ff2_otokiru_pp"
}

Transit Of Venus
01-03-2016, 00:25
If your getting this:

L 01/03/2016 - 16:24:14: [SM] Native "GetEntProp" reported: Entity 22 (22) is invalid
L 01/03/2016 - 16:24:14: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/03/2016 - 16:24:14: [SM] [0] Line 185, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/03/2016 - 16:24:14: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/03/2016 - 16:24:14: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()

Download the plugin again, it's been fixed.

Naydef
01-29-2016, 13:06
L 01/29/2016 - 19:16:13: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:16:13: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:16:13: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:16:13: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:16:13: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:17:02: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:17:02: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:17:02: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:17:02: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:17:02: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:18:53: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:18:53: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:18:53: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:18:53: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:18:53: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:19:55: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:19:55: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:19:55: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:19:55: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:19:55: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:21:27: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:21:27: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:21:27: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:21:27: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:21:27: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:23:06: [SM] Native "IsClientReplay" reported: Client 7 is not connected
L 01/29/2016 - 19:23:06: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:23:06: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:23:06: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:23:06: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:24:51: [SM] Native "IsClientReplay" reported: Client 9 is not connected
L 01/29/2016 - 19:24:51: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:24:51: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:24:51: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:24:51: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:25:59: [SM] Native "IsClientReplay" reported: Client 8 is not connected
L 01/29/2016 - 19:25:59: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:25:59: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:25:59: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:25:59: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:27:35: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:27:35: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:27:35: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:27:35: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:27:35: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:28:14: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:28:14: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:28:14: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:28:14: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:28:14: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:28:56: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:28:56: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:28:56: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:28:56: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:28:56: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:31:03: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:31:03: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:31:03: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:31:03: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:31:03: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:33:09: [SM] Native "IsClientReplay" reported: Client 3 is not connected
L 01/29/2016 - 19:33:09: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:33:09: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:33:09: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:33:09: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:34:07: [SM] Native "IsClientReplay" reported: Client 3 is not connected
L 01/29/2016 - 19:34:07: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:34:07: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:34:07: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:34:07: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:35:33: [SM] Native "IsClientReplay" reported: Client 9 is not connected
L 01/29/2016 - 19:35:33: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:35:33: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:35:33: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:35:33: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()

What do you think about this line 185:

if(IsClientInGame(clientIdx) && GetEntProp(clientIdx, Prop_Send, "m_bIsCoaching")) return false; // Client is coaching

Need to be on two lines:

if(!IsClientInGame(clientIdx)) return false;
if(GetEntProp(clientIdx, Prop_Send, "m_bIsCoaching")) return false;// Client is coaching

And why it's necessary to test two times for IsClientInGame(clientIdx)?

93SHADoW
01-29-2016, 15:54
L 01/29/2016 - 19:16:13: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:16:13: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:16:13: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:16:13: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:16:13: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:17:02: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:17:02: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:17:02: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:17:02: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:17:02: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:18:53: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:18:53: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:18:53: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:18:53: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:18:53: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:19:55: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:19:55: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:19:55: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:19:55: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:19:55: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:21:27: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:21:27: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:21:27: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:21:27: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:21:27: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:23:06: [SM] Native "IsClientReplay" reported: Client 7 is not connected
L 01/29/2016 - 19:23:06: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:23:06: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:23:06: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:23:06: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:24:51: [SM] Native "IsClientReplay" reported: Client 9 is not connected
L 01/29/2016 - 19:24:51: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:24:51: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:24:51: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:24:51: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:25:59: [SM] Native "IsClientReplay" reported: Client 8 is not connected
L 01/29/2016 - 19:25:59: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:25:59: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:25:59: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:25:59: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:27:35: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:27:35: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:27:35: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:27:35: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:27:35: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:28:14: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:28:14: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:28:14: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:28:14: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:28:14: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:28:56: [SM] Native "IsClientReplay" reported: Client 11 is not connected
L 01/29/2016 - 19:28:56: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:28:56: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:28:56: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:28:56: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:31:03: [SM] Native "IsClientReplay" reported: Client 4 is not connected
L 01/29/2016 - 19:31:03: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:31:03: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:31:03: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:31:03: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:33:09: [SM] Native "IsClientReplay" reported: Client 3 is not connected
L 01/29/2016 - 19:33:09: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:33:09: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:33:09: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:33:09: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:34:07: [SM] Native "IsClientReplay" reported: Client 3 is not connected
L 01/29/2016 - 19:34:07: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:34:07: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:34:07: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:34:07: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()
L 01/29/2016 - 19:35:33: [SM] Native "IsClientReplay" reported: Client 9 is not connected
L 01/29/2016 - 19:35:33: [SM] Displaying call stack trace for plugin "freaks\ff2_otokiru_pp.ff2":
L 01/29/2016 - 19:35:33: [SM] [0] Line 186, L:\scripting\ff2_otokiru_pp.sp::IsValidClient ()
L 01/29/2016 - 19:35:33: [SM] [1] Line 43, L:\scripting\ff2_otokiru_pp.sp::HookAbilities ()
L 01/29/2016 - 19:35:33: [SM] [2] Line 83, L:\scripting\ff2_otokiru_pp.sp::Event_RoundSt art()

What do you think about this line 185:

if(IsClientInGame(clientIdx) && GetEntProp(clientIdx, Prop_Send, "m_bIsCoaching")) return false; // Client is coaching

Need to be on two lines:

if(!IsClientInGame(clientIdx)) return false;
if(GetEntProp(clientIdx, Prop_Send, "m_bIsCoaching")) return false;// Client is coaching

And why it's necessary to test two times for IsClientInGame(clientIdx)?

I use IsClientInGame itself to return either true or false after initially checking their client index.

It's an extended version of this:

stock bool:IsValidClient(client, bool:lifecheck=false)
{
if(client<=0 || client>MaxClients) return false;
return lifecheck ? IsClientInGame(client) && IsPlayerAlive(client) : IsClientInGame(client);
}


which originally comes from sarysa's IsLivingPlayer stock:

stock bool:IsLivingPlayer(client)
{
if(client<=0 || client>MaxClients) return false;
return IsClientInGame(client) && IsPlayerAlive(client);
}

though i actually forgot to split the replay check a while back.

Naydef
01-29-2016, 15:56
But the errors are real, aren't they? The code on line 185 makes a check if the client is in game and is coaching, but this isclientingame check applies only for this line. And this is too much code for so simple check/s. Testing for example tv_enabled cvar is just using more resources for almost nothing, except if IsClientSourceTv doesn't report correctly. IsClientSourceTv already makes this check

93SHADoW
01-29-2016, 16:35
Patch is up.