Raised This Month: $51 Target: $400
 12% 

Fast Counter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 07-03-2014 , 15:27   Fast Counter
Reply With Quote #1

Hi all,

i try to create a fast counter. ex. 100 steps in 1 Secund.

I try this:

PHP Code:
//..
new Float:g_count 100.0;

FastCounter(Handle:data)
{
   
PrintHintTextToAll ("Debug: %.2f",g_count);   
   
g_count -= 1.00;
   if(
g_count 0.0) return;
   
   
CreateTimer(0.01Timer_OnFastCounterdataTIMER_FLAG_NO_MAPCHANGE);    
}

public 
Action:Timer_OnFastCounter(Handle:timerany:data)
{
    
FastCounter(data);
    return 
Plugin_Stop;    

But it takes 10 seconds until zero.

The reason is: i want to move a blue glow very fast through the map.

Can someone tell me how i can realize it?

Thanks for the effort.
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-03-2014 , 15:44   Re: Fast Counter
Reply With Quote #2

Timers are only called at most every 0.1 seconds.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 07-03-2014 , 16:03   Re: Fast Counter
Reply With Quote #3

OK THX. Timers are out!

Any idea how i can move (from one point to another point) a GLOW very fast through the map?
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-03-2014 , 16:15   Re: Fast Counter
Reply With Quote #4

Quote:
Originally Posted by HSFighter View Post
OK THX. Timers are out!

Any idea how i can move (from one point to another point) a GLOW very fast through the map?
OnGameFrame runs at the game server's tickrate.
On some games this is settable (CS:GO via -tickrate command, standard seems to be 128 or 64).
On some games this is locked... as I recall L4D and L4D2 lock it at 33; TF2, CS:S, DoD:S, and HL2:DM lock it at 66.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-03-2014 at 16:15.
Powerlord is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 07-04-2014 , 08:03   Re: Fast Counter
Reply With Quote #5

Thank you Powerlord.

Works fine
PHP Code:
//..
g_ShowCount false;
g_Count 2000// Effect begin hight
// g_fEndOrigin = Position of effect
CreateTimer(1.00Timer_OnFastCounterclientTIMER_FLAG_NO_MAPCHANGE);


public 
OnGameFrame()
{    
  if (
g_ShowCount)
  {
  
g_Count -= 30.00;

  
PrintHintTextToAll ("Debug: %.2f",g_Count);
  if(
g_Count 0.0g_ShowCount false;

  
g_fBeamOrigin[0] = g_fEndOrigin[0];
  
g_fBeamOrigin[1] = g_fEndOrigin[1];
  
g_fBeamOrigin[2] = g_fEndOrigin[2] + g_Count;
  
TE_SetupGlowSprite(g_fBeamOriging_iGlowSprite0.014.0255);
  
TE_SendToAll();
  }
}

public 
Action:Timer_OnFastCounter(Handle:timerany:client)
{
  
g_ShowCount true;
  return 
Plugin_Stop;

But the Lifetime of the Glow is to long.
The result of the effect is a long LaserBeam


-
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 07-04-2014 at 08:07.
HSFighter is offline
Send a message via ICQ to HSFighter
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 01:50.


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