Speedometer

Started by Acidas
20/10/2008 14:09
Page 1 of 1
Acidas20/10/2008 14:09(edited 04/11/2008 19:10)

This plugin is NOT SAFE for recording. Do not use this plugin while being in a run. Having the plugin and not using is SAFE. -SchlumPF

Description: This plugin shows player speed when your are moving, jumping, climbing a ladder, or in air.

Cvars:
/speed - enables/disables the plugin.
speed_colors - set color off the hud msg (rrr ggg bbb)
showspeed - sets the auto showing off speed

Useful for: Kreedz servers, HNS servers, Surf servers.

Changelog:
1.2 - fixed bugs + optimized code
1.1 - added showspeed, speed_colors.

Credits:
Numb - for his LJstats, where from i have taken the code
skyjur - helping with the code
SchlumPF - helping optimize the code + taken speed_colors from his script

Download: http://forums.alliedmods.net/showthread.php?t=79278

SchlumPF20/10/2008 15:13(edited 20/10/2008 15:15)

had a quick overview:

speed = floatround(vector_length(velocity))
velocity[2] = 0.0
speedh = floatround(vector_length(velocity))

->

speed as a float instead of an int
speed = vector_length( velocity );
speedh = floatsqroot( floatpower( velocity[0], 2.0 ) + floatpower( velocity[1], 2.0 ) );

but a float with a taskintervall of 1 looks ugly :S

what about simply getting speed and showing it to player each prethink?

Acidas20/10/2008 15:17

Hm... I will try to remake it...

Kevlarrrr20/10/2008 17:06

SchlumPF your far to clever for a 16 year old.

Acidas20/10/2008 17:39

Updated, read the 1st post.

SchlumPF20/10/2008 17:47(edited 20/10/2008 17:58)

for the color thingy you should have a look at my kz_stats. i just call a function on using the cmd for changing color/position of the hudmessage and store the new values in global variables.

have a look at this http://schlumpf.ampaste.net/f278aa793

%3.2f should be %.3f

new i, maxplayers = get_maxplayers()
new Float:velocity[3]
new Float:speed, Float:speedh
static colors[16], r[4], g[4], b[4]

for(i=1; i<=maxplayers; i++)

->

new g_iMaxPlayers = get_maxplayers() // gloabal variable

static i
static Float:velocity[3]
static Float:speed, Float:speedh
static colors[16], r[4], g[4], b[4]

for(i=1; i<=g_iMaxPlayers; i++)

Acidas20/10/2008 17:56

From the weapon ulitys :D

SchlumPF20/10/2008 18:00

forget about weapon_utilitys or w/e... most of them are not optimized whcih i should so...
but your plugins is trying to get colors once per second PER PLAYER = max 32 times per second. mine is called when player switches weapon which shouldnt be often unless player is spamming "lastinv" :)

Acidas20/10/2008 18:52

Updated, read the 1st post.

Alucard^26/10/2008 06:17

good plugin, very usefull for me...

oh, a suggestion... cool if u add maxspeed too :p

Acidas26/10/2008 11:11

Why do you need maxspeed? If you fall off a kz map eg: kzus_longwaydown i think you can do 2000+ maxspeed, so i dont know if its needed...

Page 1 of 1

Please log in to post replies.