View Single Post
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Old 02-25-2015 , 06:26   Re: Auto Sprint Source
Reply With Quote #35

Thanks for your review Red.

Well to be honest, even if I often say I'm not a pro in scripting, I still fully understand this user ID / client index issue.

So, in my case, I need to stop any timer at player spawn, not on only at OnPlayerDisconnect.
As it seems mandatory, in your opinion, for this plugin to use client serials instead of userids (in order to avoid timer handles), I decided to play the game and make another version (see attached file).
In this version I use booleans to check if a player is being sprinting or not.

But now, you may understand the issue:

- If a server sets sm_ass_time (sprint duration) to a pretty high value like 10 seconds for example

- if a player on this server starts to sprint shortly before a team scores, or before he/she dies

- when the round restarts or when the player respawns, this timer might not be reset. Thus (i made the test), if the player starts a new sprint at respawn, this sprint is stopped after 1 or 2 seconds (instead of 10) because the former timer (supposed to stop former sprint) was not killed.
Because, there is no way to kill a one time timer if not using handles (and when I say this, I'm just repeating Sourcemod Wiki.)
And, because a respawned player at roundstart keeps the same identifier.

I really hope you'll understand the issue and see why I have to use handles, like so many other approved plugins do, btw.
You can compare both codes (the one in first post and the one below) if you want for a better comprehension.

Thanks for taking time to review the code anyway.

Cheers,

St00ne
Attached Files
File Type: sp Get Plugin or Get Source (auto_sprint_source_rev2.sp - 290 views - 7.7 KB)
__________________

*** *** ***
-My plugins-

Last edited by St00ne; 02-27-2015 at 11:50.
St00ne is offline