add timer for notoreity to remove automatically in freeroaming like as GTAV

Discussion in 'Get Help/Troubleshooting' started by THPSX, Jan 25, 2019.

Tags:
  1. I take the example from the .lua


    index 0 -----

    hud_timer_set( 0, MOL_JG_01_globals.current_timer, "mol_jg_01_failure_time_up_cb" ) --->

    MOL_JG_01_globals.current_timer = 0
    --->
    function mol_jg_01_failure_time_up_cb()
    mission_end_failure("mol_jg_01", "MOL_JG_01_FAILURE_TIME_UP")
    end



    MOL_JG_01_globals.max_timer = mol_jg_01_set_timer()
    MOL_JG_01_globals.current_timer = MOL_JG_01_globals.max_timer

    and put It in sandbox+ to make the timer of notoriety to automatically remove without staying there all day, I was going to make it GTAV behavior I did put in sandbox+ and it didn't work and the threads stopped functioning pretty much

    function wanted_level_ticking()

    if WANTED_COUNTDOWN < 0 then
    WANTED_COUNTDOWN = 0
    WANTED_RATE = 0
    hud_timer_stop(0)
    notoriety_reset("police")
    end
    end

    --hud_timer_hide(0, true)
    --hud_timer_pause(0, true)
    --hud_timer_stop(0)
    --hud_critical_timer_set(5000, "wanted_level_ticking", MULTI_SYNC_ALL )
    --hud_critical_timer_stop()
    --hud_critical_timer_get_remainder()
    function wanted_level()
    --if SANDBOX_COP_NOTORIETY_CHECK >= 0.1 and WANTED_RATE == 0 then

    if SANDBOX_COP_NOTORIETY_CHECK >= 0.1 and WANTED_RATE == 0 then
    hud_timer_set(0,WANTED_COUNTDOWN, "wanted_level_ticking", MULTI_SYNC_ALL)
    WANTED_COUNTDOWN = 30000
    WANTED_RATE = 1
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 1.0 and WANTED_RATE == 1 then

    WANTED_COUNTDOWN = 60000
    WANTED_RATE = 2
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 2.0 and WANTED_RATE == 2 then
    WANTED_COUNTDOWN = 120000
    WANTED_RATE = 3
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 3.0 and WANTED_RATE == 3 then
    WANTED_COUNTDOWN = 240000
    WANTED_RATE = 4
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 4.0 and WANTED_RATE == 4 then
    WANTED_COUNTDOWN = 300000
    WANTED_RATE = 5
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 5.0 and WANTED_RATE == 5 then
    WANTED_COUNTDOWN = 360000
    WANTED_RATE = 6
    elseif SANDBOX_COP_NOTORIETY_CHECK >= 6.0 and WANTED_RATE == 6 then
    WANTED_COUNTDOWN = 400000
    WANTED_RATE = 7
    elseif WANTED_COUNTDOWN < 0 or SANDBOX_COP_NOTORIETY_CHECK == 0.0 then
    notoriety_reset("police")
    WANTED_RATE = 0
    hud_timer_stop(0)
    if SANDBOX_COP_NOTORIETY_CHECK >= 3.0 then
    elseif vehicle_is_vtol(LOCAL_PLAYER) or vehicle_is_helicopter(LOCAL_PLAYER) or vehicle_is_tank(LOCAL_PLAYER) then
    hud_timer_pause(0, true)
    elseif not vehicle_is_vtol(LOCAL_PLAYER) or not vehicle_is_helicopter(LOCAL_PLAYER) or not vehicle_is_tank(LOCAL_PLAYER) then
    hud_timer_pause(0, false)
    end
    end
    end


    I add this function at the bottom

    function sr3_city_main()
    reset_all_zones()
    --Time_Ticking = thread_new("wanted_level_ticking")
    Wanted_Level = thread_new("wanted_level") --new
    Misc_Handle = thread_new("misc_thread")
    Keycombo_Handle = thread_new("keycombo_thread")
    Effects_Handle = thread_new("effects_thread")
    EAM_Handle = thread_new("eam_thread")
    Crib_Handle = thread_new("crib_thread")
    Elevator_Handle = thread_new("elevator_thread")
    Custom_Radio_Handle = thread_new("custom_radio_monitor")
    pcall(Create_Radio_Station_Tables(randomize_music))
    end
     

    Attached Files:

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice