Raised This Month: $ Target: $400
 0% 

Solved set_task according to flash duration


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 07-24-2017 , 08:12   set_task according to flash duration
Reply With Quote #1

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_ONEg_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.

Last edited by Syturi0; 07-24-2017 at 10:56.
Syturi0 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode