Raised This Month: $ Target: $400
 0% 

Using RoundTimer as my own timer.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 10-05-2010 , 17:54   Using RoundTimer as my own timer.
Reply With Quote #1

So as the title says I'm using that way RoundTimer. But I've got one problem...
Time doesn't project as it sould...
It works this way:
0:01
0:02
0:03
0:02
0:03
0:04 etc.
Tried to change halflife_time to game_time and value of calling task, but it doesn't help at all...
Code:
public plugin_init(){
    register_message( get_user_msgid( "RoundTime" ), "tajmer2" );
    
    RoundTime = get_user_msgid( "RoundTime" );
}

public tajmer2(msgid, dest, id) { 
        
    set_msg_arg_int( 1, ARG_SHORT, 0 );    
    set_task(0.5, "tajmer1", id+TASK_ID_START2);
    
}

public tajmer1(id){

    id -= TASK_ID_START2;
    new EndTime = stock_get_user_roundtime(id) + 1;
    
    if(!is_user_alive(id))
        return PLUGIN_HANDLED;
        
    message_begin(MSG_ONE, RoundTime, _, id);
    write_short(EndTime);
    message_end();

    set_task(0.5, "tajmer1", id+TASK_ID_START2);
    return PLUGIN_CONTINUE;
}

stock stock_get_user_roundtime( const id ) {
    if(!g_RoundEnd){
        g_EndTime2 = floatround(halflife_time() - g_StartTime[id], floatround_method:floatround_ceil  );
    }    
    return g_EndTime2;
}
g_StartTime is of course halflife_time took on player's spawn.

Oh, and if I'll show
Code:
stock_get_user_roundtime(id)
in HUD timer, it works correct..

Last edited by FiFiX; 10-05-2010 at 17:57.
FiFiX is offline
Send a message via Skype™ to FiFiX
Old 10-10-2010, 10:29
FiFiX
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Reply



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 10:16.


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