#include <amxmodx>
#include <fun>
#include <cstrike>
#define PLUGIN "Speed and Gravity Control"
#define VERSION "1.0.0"
#define AUTHOR "EdLirius"
#define MAXSPEED 1000.0
#define MAXGRAVITY 0.25
#define REFILL_INTERVAL 1.0
new g_MaxPlayers
new bool:g_IsRoundEnd = false
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("SendAudio", "on_round_end", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "on_round_end", "a", "2&%!MRAD_ctwin")
register_logevent("on_round_start", 2, "1=Round_Start")
g_MaxPlayers = get_maxplayers()
}
public on_round_end()
{
g_IsRoundEnd = true
set_speed_and_gravity()
set_task(REFILL_INTERVAL, "set_speed_and_gravity", _, _, _, "b")
}
public on_round_start()
{
g_IsRoundEnd = false
for (new id = 1; id <= g_MaxPlayers; id++)
{
if (is_user_connected(id))
{
set_user_maxspeed(id, -1.0)
set_user_gravity(id, 1.0)
}
}
}
public set_speed_and_gravity()
{
if (!g_IsRoundEnd) return
for (new id = 1; id <= g_MaxPlayers; id++)
{
if (is_user_connected(id) && cs_get_user_weapon(id) != 0)
{
set_user_maxspeed(id, MAXSPEED)
set_user_gravity(id, MAXGRAVITY)
}
}
set_task(REFILL_INTERVAL, "set_speed_and_gravity", _, _, _, "b")
}