I checked it and tested it on my friends server. It should work normally
PHP Code:
SpeedTask(id)
{
static get
new name[32]
get_user_name(id, name, 31)
static i, target
static Float:velocity[3]
static Float:speed, Float:speedh
static Float:lastSpeedCheck[33]
static Float:lastAmmoPackTime[33]
static Float:cooldownTime = 10.0
for(i=1; i<=maxplayers; i++)
{
if(!is_user_connected(i)) continue
if(!plrSpeed[i]) continue
target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
pev(target, pev_velocity, velocity)
speed = vector_length(velocity)
speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
static r, g, b
if(speedh >= 1800 && lastSpeedCheck[i] < 1800)
{
lastSpeedCheck[i] = speedh
Float currentTime = get_gametime()
if(currentTime - lastAmmoPackTime[i] >= cooldownTime)
{
lastAmmoPackTime[i] = currentTime
zp_set_user_ammo_packs(i, zp_get_user_ammo_packs(i) + 1)
ColorChat(i, TEAM_COLOR, "^4[ZP] ^1You Got^3 1 ^4Ammo Pack")
}
}
if(speedh < 1800 && lastSpeedCheck[i] >= 1800)
{
lastSpeedCheck[i] = speedh
}
// SPEED
if(speedh >= 1800)
{
r = 255
g = 20
b = 20
set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
ShowSyncHudMsg(i, SyncHud, "%3.2f units/second^n%3.2f velocity^n^nWow! You Hit 1800 Speed!!!!", speed, speedh)
}
else if(speedh >= 1000)
{
r = 255
g = 215
b = 0
set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
ShowSyncHudMsg(i, SyncHud, "%3.2f units/second^n%3.2f velocity^n^nYou Hit 1000 Speed", speed, speedh)
}
else if(speedh >= 500)
{
r = 20
g = 255
b = 20
set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
ShowSyncHudMsg(i, SyncHud, "%3.2f units/second^n%3.2f velocity^n^nYou Hit 500 Speed", speed, speedh)
}
else
{
r = 255
g = 255
b = 255
set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
ShowSyncHudMsg(i, SyncHud, "%3.2f units/second^n%3.2f velocity", speed, speedh)
}
}
}