#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
new switch1 = 1
public plugin_init()
{
register_plugin("FastRun","1.0","Sophia - Dias")
register_forward( FM_CmdStart, "FMCmdStart" );
RegisterHam(Ham_Spawn, "Player", "spawn_fastrun")
}
public FMCmdStart( id, uc_handle, randseed )
{
new Float:fmove, Float:smove;
get_uc(uc_handle, UC_ForwardMove, fmove);
get_uc(uc_handle, UC_SideMove, smove );
new Float:maxspeed;
pev(id, pev_maxspeed, maxspeed);
new Float:walkspeed = (maxspeed * 0.52);
fmove = floatabs( fmove );
smove = floatabs( smove );
if(fmove <= walkspeed && smove <= walkspeed && !(fmove == 0.0 && smove == 0.0))
{
if(switch1 == 1)
{
set_user_maxspeed(id, get_user_maxspeed(id) + 300.0)
client_print(id, print_chat, "Max Speed Up !!!")
switch1 = 0
set_task(7.0, "stop_fastrun", id)
}
}
}
public stop_fastrun(id)
{
set_user_maxspeed(id, 230.0)
client_print(id, print_chat, "Normal Speed.")
set_task(30.0, "spawn_fastrun", id)
}
public spawn_fastrun(id)
{
switch1 = 1
client_print(id, print_chat, "Fastrun Ready...")
}