#include <amxmodx>
#include <reapi>
new Float:g_fPlayerCustomAA[33]
enum Movevars
{
Float:Gravity,
Float:StopSpeed,
Float:MaxSpeed,
Float:SpectatorMaxSpeed,
Float:Accelerate,
Float:AirAccelerate,
Float:WaterAccelerate,
Float:Friction,
Float:EdgeFriction,
Float:WaterFriction,
Float:EntGravity,
Float:Bounce,
Float:StepSize,
Float:MaxVelocity,
Float:ZMax,
Float:WaveHeight,
Footsteps,
Float:RollAngle,
Float:RollSpeed,
Float:SkyColorRed,
Float:SkyColorGreen,
Float:SkyColorBlue,
Float:SkyVecX,
Float:SkyVecY,
Float:SkyVecZ,
SkyName[ 16 ],
};
new MoveVarsData[ Movevars ];
public plugin_init()
{
register_plugin("Custom Player AirAccelerate", "1.0", "Huehue a.k.a AJW1337//")
handleCache();
RegisterHookChain(RG_PM_AirMove, "PM_AirMove", false)
register_clcmd("say /aa", "ToggleAirAccelerateMenu")
}
public client_connect(id)
{
g_fPlayerCustomAA[id] = 10.0
}
public PM_AirMove(id)
{
set_movevar(mv_airaccelerate, g_fPlayerCustomAA[id])
}
public ToggleAirAccelerateMenu(id)
{
new szTitle[128]
formatex(szTitle, charsmax(szTitle), "\wAiraccelerate Menu^n\dCurrent Airaccelerate: \r%.f", g_fPlayerCustomAA[id])
new iMenu = menu_create(szTitle, "AirAccelerate_Menu_Handler")
menu_additem(iMenu, "Set \y10 \wAiraccelerate")
menu_additem(iMenu, "Set \y100 \wAiraccelerate")
menu_display(id, iMenu, 0)
}
public AirAccelerate_Menu_Handler(id, iMenu, Item)
{
if(Item == MENU_EXIT)
{
menu_destroy(iMenu)
return PLUGIN_HANDLED
}
switch(++Item)
{
case 1:
{
g_fPlayerCustomAA[id] = 10.0;
}
case 2:
{
g_fPlayerCustomAA[id] = 100.0;
}
}
sendNewMoveVars(id);
client_print(id, print_chat, "* You have changed your airaccelerate to %.0f", g_fPlayerCustomAA[id])
menu_destroy(iMenu)
return PLUGIN_HANDLED
}
public handleCache()
{
MoveVarsData[ Gravity ] = get_cvar_float("sv_gravity");
MoveVarsData[ StopSpeed ] = get_cvar_float("sv_stopspeed");
MoveVarsData[ MaxSpeed ] = get_cvar_float("sv_maxspeed");
MoveVarsData[ SpectatorMaxSpeed ] = get_cvar_float("sv_spectatormaxspeed");
MoveVarsData[ Accelerate ] = get_cvar_float("sv_accelerate");
MoveVarsData[ AirAccelerate ] = get_cvar_float("sv_airaccelerate");
MoveVarsData[ WaterAccelerate ] = get_cvar_float("sv_wateraccelerate");
MoveVarsData[ Friction ] = get_cvar_float("sv_friction");
MoveVarsData[ EdgeFriction ] = get_cvar_float("edgefriction");
MoveVarsData[ WaterFriction ] = get_cvar_float("sv_waterfriction");
MoveVarsData[ Bounce ] = get_cvar_float("sv_bounce");
MoveVarsData[ StepSize ] = get_cvar_float("sv_stepsize");
MoveVarsData[ MaxVelocity ] = get_cvar_float("sv_maxvelocity");
MoveVarsData[ ZMax ] = get_cvar_float("sv_zmax");
MoveVarsData[ WaveHeight ] = get_cvar_float("sv_wateramp");
MoveVarsData[ Footsteps ] = get_cvar_num("mp_footsteps");
MoveVarsData[ SkyColorRed ] = get_cvar_float("sv_skycolor_r");
MoveVarsData[ SkyColorGreen ] = get_cvar_float("sv_skycolor_g");
MoveVarsData[ SkyColorBlue ] = get_cvar_float("sv_skycolor_b");
MoveVarsData[ SkyVecX ] = get_cvar_float("sv_skyvec_x");
MoveVarsData[ SkyVecY ] = get_cvar_float("sv_skyvec_y");
MoveVarsData[ SkyVecZ ] = get_cvar_float("sv_skyvec_z");
get_cvar_string("sv_skyname", MoveVarsData[ SkyName ], charsmax( MoveVarsData[ SkyName ]));
MoveVarsData[ EntGravity ] = _:1.0;
MoveVarsData[ RollAngle ] = _:0.0;
MoveVarsData[ RollSpeed ] = _:0.0;
}
public sendNewMoveVars(id)
{
message_begin( MSG_ONE, SVC_NEWMOVEVARS, _, id);
{
write_long( _:MoveVarsData[ Gravity ] );
write_long( _:MoveVarsData[ StopSpeed ] );
write_long( _:MoveVarsData[ MaxSpeed ] );
write_long( _:MoveVarsData[ SpectatorMaxSpeed ] );
write_long( _:MoveVarsData[ Accelerate ] );
write_long( _:g_fPlayerCustomAA[ id ] );
write_long( _:MoveVarsData[ WaterAccelerate ] );
write_long( _:MoveVarsData[ Friction ] );
write_long( _:MoveVarsData[ EdgeFriction ] );
write_long( _:MoveVarsData[ WaterFriction ] );
write_long( _:MoveVarsData[ EntGravity ] );
write_long( _:MoveVarsData[ Bounce ] );
write_long( _:MoveVarsData[ StepSize ] );
write_long( _:MoveVarsData[ MaxVelocity ] );
write_long( _:MoveVarsData[ ZMax ] );
write_long( _:MoveVarsData[ WaveHeight ] );
write_byte( !!MoveVarsData[ Footsteps ] );
write_long( _:MoveVarsData[ RollAngle ] );
write_long( _:MoveVarsData[ RollSpeed ] );
write_long( _:MoveVarsData[ SkyColorBlue ] );
write_long( _:MoveVarsData[ SkyColorGreen ] );
write_long( _:MoveVarsData[ SkyColorRed ] );
write_long( _:MoveVarsData[ SkyVecX ] );
write_long( _:MoveVarsData[ SkyVecY ] );
write_long( _:MoveVarsData[ SkyVecZ ] );
write_string( MoveVarsData[ SkyName ] );
}
message_end();
}