Raised This Month: $ Target: $400
 0% 

[STOCK] Clear a timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 10-06-2012 , 00:29   [STOCK] Clear a timer
Reply With Quote #1

I'm making a BIG plugin for CS:S Jailbreak and it uses some timers, so I made this but in a native (the plugin will include an API with this native):
PHP Code:
stock ClearTimer(&Handle:Timer)
{
    if(
Timer != INVALID_HANDLE)
    {
        
CloseHandle(Timer);
        
Timer INVALID_HANDLE;
    }

Paste it in the bottom of your plugin and use it like in this example:
PHP Code:
new coolInt;

public 
Action:hellobuddy(clientargs)
{
          new 
Handle:MyTimer CreateTimer(30.0blabla_TIMER_FLAG_NOMAPCHANGE);
          
          switch(
coolInt)
          {
                    case 
3:
                    {
                              
ClearTimer(MyTimer);
                              
coolInt 0;
                    }
                    
                    
                    default:
                    {
                              
coolInt++;
                              
PrintToServer("hey homie the coolInt is now %i."coolInt);
                    }
          }

__________________
retired

Last edited by shavit; 10-06-2012 at 04:22.
shavit is offline
 



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:28.


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