what is wrong with this perm blind
Code:
actionBlind(id, bool:OverrideTimer)
{
new Float:fTime = halflife_time();
//check if player is outside of cooldown time to use the boots of speed
if (fTime >= gfBlindNextUse[id] || OverrideTimer)
{
new Float:fTimeout = get_cvar_float("bm_blindtime");
//set a task to remove the boots of speed after time out amount
set_task(fTimeout, "taskBlindRemove", TASK_BLIND + id, "", 0, "a", 1);
//iterate through all players
for (new i = id; i <= id; ++i)
{
//make sure player is connected
if (is_user_connected(i))
{
//make the screen flash for a nuke effect
message_begin(MSG_ONE, gMsgScreenFade, {0, 0, 0}, i);
write_short(20000); //duration
write_short(30000); //hold time
write_short(4096); //type (in / out)
write_byte(0); //red
write_byte(0); //green
write_byte(0); //blue
write_byte(0); //alpha
message_end();
}
}
gfBlindTimeOut[id] = fTime + fTimeout;
gfBlindNextUse[id] = fTime + fTimeout + get_cvar_float("bm_blindcooldown");
}
else
{
set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
show_hudmessage(id, "Blind next use: %.1f", gfBlindNextUse[id] - fTime);
}
}
and this delay blind
Code:
actionBlindDelay(id, bool:OverrideTimer)
{
new Float:fTime = halflife_time();
//check if player is outside of cooldown time to use the boots of speed
if (fTime >= gfBlindNextUse[id] || OverrideTimer)
{
new Float:fTimeout = get_cvar_float("bm_blindnotime");
//set a task to remove the boots of speed after time out amount
set_task(fTimeout, "taskBlindRemove", TASK_BLIND + id, "", 0, "a", 1);
//iterate through all players
for (new i = id; i <= id; ++i)
{
//make sure player is connected
if (is_user_connected(i))
{
//make the screen flash for a nuke effect
message_begin(MSG_ONE, gMsgScreenFade, {0, 0, 0}, i);
write_short(20000); //duration
write_short(32000); //hold time
write_short(4096); //type (in / out)
write_byte(0); //red
write_byte(0); //green
write_byte(0); //blue
write_byte(0); //alpha
message_end();
}
}
gfBlindTimeOut[id] = fTime + fTimeout;
gfBlindNextUse[id] = fTime + fTimeout + get_cvar_float("bm_blindnocooldown");
}
else
{
set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
show_hudmessage(id, "Blind next use: %.1f", gfBlindNextUse[id] - fTime);
}
}