Sorry for a slow update. I was called out of town on business.
CVar (used in amxx.cfg)
amx_speed (default = 325.0)
Code:
// =======================================================
// Player Max Speed
// by DarkMind
// Original Code by {HOJ} Batman
// =======================================================
new const PLUGIN[] = "amx_speed"
new const VERSION[] = "0.4"
new const AUTHOR[] = "DarkMind"
new gCurrentWeapon[33]
new wtf[33]
#include <amxmod>
#include <amxmisc>
// =======================================================
// Plugin Information
// =======================================================
public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
register_cvar(PLUGIN,VERSION,FCVAR_SERVER|FCVAR_SPONLY)
register_cvar("amx_speed","325.0")
register_event("CurWeapon","weapon_switch","be","1=1")
register_logevent("round_start",2,"0=World triggered","1=Round_Start")
return PLUGIN_CONTINUE
}
// =======================================================
// 'Weapon Switch'
// =======================================================
public weapon_switch(id) {
new Float:maxSpeed = get_cvar_float("amx_speed")
new weaponid = read_data(2)
if(gCurrentWeapon[id] != weaponid) {
gCurrentWeapon[id] = weaponid
set_user_maxspeed(id,maxSpeed)
}
}
// =======================================================
// 'Round Start'
// =======================================================
public round_start(id) {
new Float:maxSpeed = get_cvar_float("amx_speed")
new maxplayers = get_maxplayers()+1
for (new a=1; a<maxplayers; a++){
if(wtf[a] == 1){
set_user_rendering(a,kRenderFxNone,255,255,255,kRenderNormal,16)
wtf[a] = 0
}
set_user_maxspeed(id,maxSpeed)
}
return PLUGIN_CONTINUE
}
Note!
You must set a
float value in your AMXX.cfg file.
i.e. 325.0 or 400.0
This code has been taken from SuperHero Mod. It has been slightly modified but heavily trimmed for the purposes of running speed only. The true credit should be given to the SH Mod developers:
{HOJ} Batman
JTP10181
ASSKICR