Quote:
Originally Posted by Bonnis
I'm looking for a working Speedmeter plugin.
i only want the speedmeter function.
is there any plugin out there, thats work? iv'e search and i was finding alot but none working.
I want the meter in lower center as there is in "timer" plugins.
but i only want the speed meter.
can any1 fix?
thanks
//Bonnis
|
I made this plugin few months ago for one of my servers.
Its a nice speedmeter like in cs 1.6
Code:
/* Plugin Template generated by Pawn Studio */
#include < sourcemod >
#include < sdktools >
#include < sdkhooks >
public Plugin:myinfo = {
name = "SpeedMetter: CSGO",
author = "shoc^",
description = "SpeedMetter",
version = "1.0",
url = "http://steamcommunity.com/id/shocbenz"
}
new Handle: isPluginEnabled
new bool: SpeedMetterEnabled[ MAXPLAYERS + 1 ]
public OnPluginStart( ) {
isPluginEnabled = CreateConVar( "sm_speedmeter", "1", "1 - Active the speedmeter, 0 dezactiveaza", FCVAR_NOTIFY )
RegConsoleCmd( "speed", Command_Speed )
}
public OnClientPutInServer( client ) {
if( GetConVarInt( isPluginEnabled ) ) {
SDKHook( client, SDKHook_PreThink, OnPreThink )
SpeedMetterEnabled[ client ] = true
}
}
public Action: Command_Speed( client, args ) {
if( SpeedMetterEnabled[ client ] ) {
SpeedMetterEnabled[ client ] = false
PrintToChat( client, " \x04[SpeedMetter]\x09 now is\x02 disabled" )
}
else {
SpeedMetterEnabled[ client ] = true
PrintToChat( client, " \x04[SpeedMetter]\x09 now is\x06 activeted" )
}
}
public OnPreThink( client ) {
if( client != 0 && IsClientInGame( client ) && IsPlayerAlive( client ) && SpeedMetterEnabled[ client ] ) {
decl Float:VelFloat[ 3 ], Float:Speed
GetEntPropVector( client, Prop_Data, "m_vecVelocity", VelFloat )
for( new i = 0; i <= 2; i++ ) {
VelFloat[ i ] *= VelFloat[ i ]
}
Speed = SquareRoot( VelFloat[ 0 ] + VelFloat[ 1 ] + VelFloat[ 2 ] )
PrintHintText( client, "\n<font color='#EDED07' size='40'>%.1f </font>", Speed )
}
}
__________________