Page 1 of 2

Round time 0:00

Posted: 2011 Jun 10 10:18
by KamiN
Kaip padaryti, kad kai round time pasibaige, 0:00, kintamieji hns ir catch pasidarytu false.

sitas netinka

Code: Select all

public Event_Roundend(){    if(hns)        hns = false     if(catch)        catch = false....            }
Meginau sitaip, bet irgi neveikia

Code: Select all

 pointnum = get_cvar_pointer("mp_roundtime"); public roundtimezero() {     g_roundtime = get_pcvar_num(pointnum);     if(g_roundtime == 0)     {         if(hns)            hns = false                else if(catch)            catch = false     }} 

Re: Round time 0:00

Posted: 2011 Jun 10 10:48
by psychical

Code: Select all

    register_logevent("round_start", 2, "1=Round_Start")

Code: Select all

public round_start(){    set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID)}

Code: Select all

public time_is_up() {    //darai ka nori}

Re: Round time 0:00

Posted: 2011 Jun 10 10:56
by KamiN
O jeigu pas mane jau yra

Code: Select all

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
tai padarius sitaip ar tiks?

Code: Select all

public event_round_start(){set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID)}

Re: Round time 0:00

Posted: 2011 Jun 10 11:00
by psychical
tiks, svarbu kad round prasidetu

Re: Round time 0:00

Posted: 2011 Jun 10 11:14
by KamiN
Alliedmoduose toki pati radau

http://forums.alliedmods.net/showthread.php?p=559412

Ka sitas daro gal lietuviskai paaiskint su kokiu pavyzdiu galit. Ar reikalingas cia jis man butu?

Code: Select all

public remove_existing_task() {    if (task_exists(TASK_ID))        remove_task(TASK_ID)}
Ir kodel toks didelis skaicius? Ar cia jis neturi visiskai reiksmes?

Code: Select all

#define TASK_ID 934279423

Re: Round time 0:00

Posted: 2011 Jun 10 11:30
by aurimasko
skaičius neturi reikšmės, tik jis turi būti nevienodas su kitas task define.

o dėl pirmo, tai jis sunaikina pradėtą taską.

-- 2011 Bir 10 12:32 --

daryk pagal psychical pavizdį ir kur yra time_up funkcija įterpk į ją task sunaikinimo kodą t.y. remove_task(TASK_ID)

Re: Round time 0:00

Posted: 2011 Jun 10 11:37
by psychical
aurimasko wrote:skaičius neturi reikšmės, tik jis turi būti nevienodas su kitas task define.

o dėl pirmo, tai jis sunaikina pradėtą taską.

-- 2011 Bir 10 12:32 --

daryk pagal psychical pavizdį ir kur yra time_up funkcija įterpk į ją task sunaikinimo kodą t.y. remove_task(TASK_ID)

task remove riektu deti i round_end, nes kai round prasides ir jei taskas nebaigtas, gali pradet bugintis, todel reik:

Code: Select all

     register_event("HLTV", "remove_existing_task", "a", "1=0", "2=0")

Code: Select all

public remove_existing_task() {        if (task_exists(TASK_ID))                remove_task(TASK_ID)}

Re: Round time 0:00

Posted: 2011 Jun 10 13:17
by aurimasko
tai galima ir taip:

Code: Select all

 public event_round_start(){    remove_task(TASK_ID)    set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID)} 

Re: Round time 0:00

Posted: 2011 Jun 10 13:23
by psychical
aurimasko wrote:tai galima ir taip:

Code: Select all

 public event_round_start(){    remove_task(TASK_ID)    set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID)} 
Galima, bet set_Task naujai nedek, nes naujai prasideda pradzioje round'o

Re: Round time 0:00

Posted: 2011 Jun 10 13:58
by KamiN
Tai dabar as padariau taip, ar bus gerai?

Code: Select all

#define TASK_ID 934279423

Code: Select all

new g_pcvar_mp_roundtime

Code: Select all

public plugin_init() {....    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")     g_pcvar_mp_roundtime = get_cvar_pointer("mp_roundtime")         register_logevent("Event_Roundend", 2, "1=Round_End") ....}

Code: Select all

public event_round_start(){...    set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID)}

Code: Select all

public time_is_up(){       if(specialday[20] == DAY_HNS)        hns = false     if(specialday[20] == DAY_CATCH)        catch = false}

Code: Select all

public Event_Roundend(){     if (task_exists(TASK_ID))                remove_task(TASK_ID)....}