PHP Code:
public Event_Flashed(id)
{
if(g_b_IsAlive[id])
{
if(g_b_IsMainMenuOpen[id] == true)
FecharMenuM(id)
g_b_IsPlayerFlashed[id] = true
remove_task(id + TASK_FLASH)
set_task(12.0, "RemoveFlash", id + TASK_FLASH)
}
if(g_b_HasHudSprite_Screenfade[id] == false)
{
message_begin(MSG_ONE, g_msgScreenfade, {0,0,0}, id)
write_short(read_data(1)) // Duration
write_short(read_data(2)) // Hold time
write_short(read_data(3)) // Fade type
write_byte(255) // Red
write_byte(255) // Green
write_byte(255) // Blue
write_byte(read_data(7)) // Alpha
message_end()
}
}
When you throw a flash grenade far away, the flash duration will be only 1-2 seconds, but if you are close it will be 12 seconds.
I want to set the time on
set_task according to the duration of the flash (far away = shorter, close = longer).
How can i do that.