Raised This Month: $ Target: $400
 0% 

Milisecond Timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-15-2012 , 20:22   Milisecond Timer
Reply With Quote #1

hey,
is it possible to make a milisecond timer with steps per 50 miliseconds or lower?

I just made a 100milisecond step timer and i'm also wondering if this is a correct way to make a timer:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#define PLUGIN "ms Timer"
#define VERSION "1.0"
#define AUTHOR "striker07"
new g_iMiliSeconds;
new 
g_iSeconds;
new 
g_iMinutes;
new 
g_iSync;
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
g_iSync CreateHudSyncObj();
 
 
// Add your code here...
}
public 
Start_Timer()
{
 
set_task(0.1"Add_100ms" 1337__"b");
 
set_task(0.1"Update_Timer"___"b");
}
public 
Stop_Timer()
{
 
remove_task(1337);
}
public 
Add_100ms()
{
 
g_iMiliSeconds g_iMiliSeconds+100;
 
 if(
g_iMiliSeconds == 1000)
 {
  
g_iMiliSeconds 0;
  
g_iSeconds++;
 
  if(
g_iSeconds == 60)
  {
   
g_iSeconds 0;
   
g_iMinutes++;
  }
 }
}
public 
Update_timer()
{
 new 
Msg[512];
 
 
set_dhudmessage(25520400.01, -0.660_0.10.10.1);
 
 
format(Msg,511," Chronometer: ^n %i:%i.%.3i "g_iMinutesg_iSecondsg_iMiliSeconds );
 
ShowSyncHudMsg(0g_iSyncMsg);

__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-15-2012 at 20:23.
striker07 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 05:50.


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