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("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, 450.0)
set_hudmessage(255, 0, 0, 0.0, 0.0, 0, 6.0, 1.0)
show_hudmessage(id, "You brought Speed in %d sekund",has_speed[id])
set_task(20.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
}
?