PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new bool:has_speed[33]
public plugin_init() {
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_clcmd("say /buyspeed", "cmdBuySpeed")
}
public event_curweapon(id)
{
if(has_speed[id] == true)
{
set_user_maxspeed(id, 290.0)
}
}
public cmdBuySpeed(id)
{
if(!has_speed[id])
{
set_user_maxspeed(id, 290.0)
client_print(id, print_chat, "You brought Speed!")
set_task(10.0, "cmdRemoveSpeed", id)
}
else
{
client_print(id, print_chat, "You already brought Speed!")
}
}
public cmdRemoveSpeed(id)
{
set_user_maxspeed(id, 240.0) // Set normal speed after 10 Seconds
}
Try to understand its rly easy.
The CurWeapon event each time calls when the player shots or switch between weapons.
__________________