Raised This Month: $ Target: $400
 0% 

remaining second.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 07-24-2009 , 10:13   remaining second.
Reply With Quote #1

Does anyone knows how to set hudmessage to get remaining second.

meaning that it will show a hudmessage with second remaining.
Mr.Noobie is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-24-2009 , 10:47   Re: remaining second.
Reply With Quote #2

PHP Code:
/* 
*  AMX X Mod script. 

* (c) Copyright 2003, ST4life 
* Remade by TaL
* This file is provided as is (no warranties). 
*/ 

#include <amxmodx>
#include <engine>

#define VERSION "0.2.0" // Revision : ConnorMcLeod
/* 
* TimeProjector displays the remaining time and the next map on the top right corner of the client 
* display as a hudmessage. 

* History: 

* v0.1: - first release 
*/
#define clamp_byte(%1)        clamp(%1, 0x00, 0xFF)
#define clamp_channel(%1)    clamp(%1, 1, 4)

new g_pCvarNextMapg_pCvarColorg_pCvarChannel

public plugin_init() 

    
register_plugin("TimeProjector"VERSION"ST4life")

    
g_pCvarNextMap get_cvar_pointer("amx_nextmap")
    
g_pCvarColor register_cvar("time_projector_color""255 255 255")
    
g_pCvarChannel register_cvar("time_projector_channel""3")

    new 
iEnt create_entity("info_target")
    
entity_set_string(iEntEV_SZ_classname"time_projector")
    
register_think("time_projector""Show_Timer")
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 1.0)


public 
Show_TimeriEnt )
{
    static 
szMessage[128], szCurTime[9], niTimeLeftszColor[12], szRed[4], szGreen[4], szBlue[4], iRediGreeniBlue

    get_time
("%H:%M:%S"szCurTimecharsmax(szCurTime))
    
iTimeLeft get_timeleft()

    
formatex(szMessagecharsmax(szMessage), "Current Time: %s^nTime remaining: %d:%02d"szCurTimeiTimeLeft 60iTimeLeft 60)
     
    if( 
g_pCvarNextMap )
    {
        static 
szNextMap[32]
        
get_pcvar_string(g_pCvarNextMapszNextMapcharsmax(szNextMap))
        
+= formatex(szMessage[n], charsmax(szMessage)-n"^nNext map: %s"szNextMap)
    }

    
get_pcvar_string(g_pCvarColorszColorcharsmax(szColor))
    
parse(szColorszRedcharsmax(szRed), szGreencharsmax(szGreen), szBluecharsmax(szBlue))
    
iRed clamp_bytestr_to_num(szRed) )
    
iGreen clamp_bytestr_to_num(szGreen) )
    
iBlue clamp_bytestr_to_num(szBlue) )

    
set_hudmessage(iRediGreeniBlue0.750.0500.01.00.00.0clamp_channelget_pcvar_num(g_pCvarColor) )) 
    
show_hudmessage(0szMessage

    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 1.0)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 07-24-2009 , 11:20   Re: remaining second.
Reply With Quote #3

Mr.Noobie means he want a plugin that can show hudmessage during a duration of event.

Example:

warm up round show hudmessage second remaining before restarting the round.

I think he want the remaining seconds.
__________________
ƒa†es™ is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 07-24-2009 , 11:30   Re: remaining second.
Reply With Quote #4

Quote:
Originally Posted by ƒa†es™ View Post
Mr.Noobie means he want a plugin that can show hudmessage during a duration of event.

Example:

warm up round show hudmessage second remaining before restarting the round.

I think he want the remaining seconds.
Something like that.

I just want the code for the second remaining before an event.
Mr.Noobie is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-24-2009 , 11:32   Re: remaining second.
Reply With Quote #5

Before which event ?
Could you be more descriptive ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 07-24-2009 , 12:07   Re: remaining second.
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Before which event ?
Could you be more descriptive ?
I means

Example.

Starting Match is a warm up round during the warm up round there will be a hudmessage showing the remaining second before restarting the round.

I want the remaining second in hudmessage codes.
Mr.Noobie is offline
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 18:29.


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