Stopwatch Plugin

Started by s1gh
19/03/2008 20:34
Page 1 of 2
s1gh19/03/2008 20:34

Hey everyone.

Many people who demo maps can probably tell you that sometimes they're not sure which of two ways is faster on a certain map. I would like to request a plugin that acts similarly to a stopwatch - you bind a key to start some sort of external timer, and then press it again, or press a different key, to stop it.

It's pretty simple, but also very useful.

Thanks.

maniac19/03/2008 21:29

nice idea... should be very easy to make this plugin! =)
gogogo coders! :D

stask0 Tournament #219/03/2008 23:06(edited 19/03/2008 23:07)

i think that there is already an plugin wich have /pause function ^^ but i cant remember the name of the plugin.... :s

s1gh19/03/2008 23:16

/pause doesn't help at all. I just want to be able to measure the time it takes to do different routes accurately, not necessarily in the beginning of the map. And having to start the timer each time i want to check something is a pain, and it doesn't allow accurate measurement.

raver mapper20/03/2008 00:09

I know what you mean, sometime like this:
/startsw - will start the stopwatch in the center of your screen
/stopsw - will stop the stopwatch
/resetsw - will Reset the stopwatch to 00:00:00

s1gh20/03/2008 00:16

Yes, that would work... Perhaps not in the center of the screen though.

SchlumPF20/03/2008 02:58(edited 20/03/2008 02:59)

i will create one 2morrow
shall i add some function to create a place where timer starts or stops if u touch it?

s1gh20/03/2008 03:28

First, thanks a whole lot SchlumPF*. Also, if I understand correctly, you mean that I could choose two exact spots that when I reach, timer starts and stops accordingly? If so, then yes, that would be great. I hope that it doesn't have to replace the function that I suggested, though.

Thanks a lot again.

SchlumPF20/03/2008 04:22

yep i meant that. as i said i will create one 2morrow... shouldnt be that much work ;D

s1gh20/03/2008 04:32

Okay.. Once again, thanks a lot. Remember to make it as precise as possible, so not just by seconds, include milliseconds too. :p

I'm off to bed now, so just post it whenever you can tomorrow.

TinTin20/03/2008 05:46(edited 20/03/2008 06:10)

Oh this would be great ^^ I am wondering too, actually.
I have so far been using the beta blockmaker by necro, which includes a timer. But then I need to add two timers every time I want to try.
Hope you will make it good SchlumPF* ^^

trb20/03/2008 07:58

u can doo that with an the old climbtimer plugin too.
just by set start & stoptimer position on this place u want to test how fast it is ;)

skyjur20/03/2008 15:15

Made one :) Not exactly the stopwatch. You will need to make a start checkpoint and stop checkpoint. After you have both checkpoints you can start a run.

Download it here: http://forums.alliedmods.net/showthread.php?p=599192

SchlumPF20/03/2008 15:48

http://rapidshare.com/files/100983148/Stopwatch.rar.html
hf
this plugin is emant for listenservers

peteR^20/03/2008 16:06

NICE SCHLUMPF<3

SchlumPF20/03/2008 16:15(edited 20/03/2008 16:34)

have to improve my plugin cause it is rubbish xD its working etc but coders will see i amde a mistake xD

update: http://rapidshare.com/files/100992497/Stopwatch.rar.html

skyjur20/03/2008 17:39

nice SchlumPF* but it would use ~ 10 times less cpu resources if you had saved entities ids into array instead of checking string each time fwdTouch is called.

I have noticed that most of kz plugins here arent perfect at all from side of performance. And it is verry bad when programmer does not think how to optimize his plugins...

SchlumPF20/03/2008 17:51(edited 20/03/2008 17:57)

did i forgot to do that oO i had that way before but did change it to test something. usually i look performance. thats one reason why im using fakemeta only.

edit to lazy to uplaod a new version but just replace the whole public fwdTouch function with this for some performance optimization:

[blockquote]public fwdTouch( touched, plr )
{
if( !is_user_alive( plr ) )
return FMRES_IGNORED;

static Float:fTime[33];

if( touched == g_iLocId[START][plr] )
{
fTime[plr] = get_gametime( );
g_bStopwatchStarted[plr] = true;

client_print( plr, print_center, "stopwatch started" );
}
else if( touched == g_iLocId[STOP][plr] && g_bStopwatchStarted[plr] )
{
new Float:fStopTime = get_gametime( ) - fTime[plr];
g_bStopwatchStarted[plr] = false;

client_print( plr, print_center, "stopwatch stopped" );
client_print( plr, print_chat, "^x04[Stopwatch] ^x01You have wasted %f seconds of time :E", fStopTime );
}

return FMRES_HANDLED;
}[/blockquote]

but replace the smile with ":E"


btw your right there are many plugins which could have abetter code and i posted some old plugins here which ahve the same problem but most plugins are very small so the cpu usage wont increase extreme.

s1gh20/03/2008 20:04

Thanks a lot SchlumPF*! I'll try it soon.

poison_art20/03/2008 20:26

but were i can get fakemeta and fakemeta_util \/ and where i must place it

Page 1 of 2

Please log in to post replies.