Raised This Month: $ Target: $400
 0% 

More effective timer than this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-05-2010 , 19:51   More effective timer than this?
Reply With Quote #1

PHP Code:
public thirtyoneid )
{
    
set_hudmessage(25500, -1.00.006.01.0)
    
show_hudmessage(id"NightCrawlers: 0:31")
    
set_task(1.0"thirty")
}

public 
thirtyid )
{
    
set_hudmessage(25500, -1.00.006.01.0)
    
show_hudmessage(id"NightCrawlers: 0:30")
    
set_task(1.0"thirty")

Any more effect timer than doing this 130 times?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-05-2010 , 20:00   Re: More effective timer than this?
Reply With Quote #2

Code:
#define TASKID  1996 new iTimer = 90 public plugin_init() {     set_task( 1.0, "TaskCount", TASKID, _, _, "b" ) } public TaskCount() {     set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 1.0)     show_hudmessage(id, "NightCrawlers: %i", iTimer--)         if( iTimer <= 0 )     {         remove_task( TASKID )     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-05-2010 , 20:02   Re: More effective timer than this?
Reply With Quote #3

Quote:
Originally Posted by wrecked_ View Post
Code:
#define TASKID  1996 new iTimer = 90 public plugin_init() {     set_task( 1.0, "TaskCount", TASKID, _, _, "b" ) } public TaskCount() {     set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 1.0)     show_hudmessage(id, "NightCrawlers: %i", iTimer--)         if( iTimer <= 0 )     {         remove_task( TASKID )     } }
I should kill myself. I sat there for 30 minutes redoing what I posted about 130 times. Thanks.. do you have a fuckin rope?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-05-2010 , 20:04   Re: More effective timer than this?
Reply With Quote #4

Quote:
Originally Posted by GXLZPGX View Post
I should kill myself. I sat there for 30 minutes redoing what I posted about 130 times. Thanks.. do you have a fuckin rope?
Haha no problem. If you have any questions on things you should ask before just winging it, because while you may learn from fixing it yourself, you're also killing hours for each issue and you're also learning by being corrected.

Feel free to add me on Steam if you have any more issues like this.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-05-2010 , 20:23   Re: More effective timer than this?
Reply With Quote #5

Oops, sorry. This is fixed the fixed version.

Code:
#define TASKID  1996 new iTimer = 90 set_task( 1.0, "TaskCount", id + TASKID, _, _, "b" ) public TaskCount( TASK ) {     new id = TASK - TASKID         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 1.0)     show_hudmessage(id, "NightCrawlers: %i", --iTimer)         if( iTimer <= 0 )     {         remove_task( TASK )     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2010 , 20:32   Re: More effective timer than this?
Reply With Quote #6

If you use flag a you can specify the number of times it repeats. The optimal way for this is with a thinking entity but no need to confuse you with that.

set_task( 1.0 , "function" , id + TASKID , _, _, "a" , 90 );
__________________
Bugsy is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-05-2010 , 20:33   Re: More effective timer than this?
Reply With Quote #7

Fixed with a certain extra request via Steam and Bugsy's advice.

Code:
new iTimer = 90 yourfunc() {     iTimer = 90     set_task( 1.0, "TaskCount", _, _, _, "a", 90 ) } public TaskCount() {     set_hudmessage( 255, 0, 0, -1.0, 0.0, 0, 6.0, 1.0 )     show_hudmessage( 0, "NightCrawlers: %i:%i", floatround( ( iTimer / 60.0 ), floatround_floor ), ( iTimer-- % 60 ) ) }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 06-05-2010 at 20:47.
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2010 , 20:41   Re: More effective timer than this?
Reply With Quote #8

Just make sure to set iTimer to 90 each time you call that set_task line.
__________________
Bugsy is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-05-2010 , 20:43   Re: More effective timer than this?
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
Just make sure to set iTimer to 90 each time you call that set_task line.
Done.

EDIT: Fixed with the timer numbers proper.

Code:
new iTimer = 90 yourfunc() {     iTimer = 90     set_task( 1.0, "TaskCount", _, _, _, "a", 90 ) } public TaskCount() {     set_hudmessage( 255, 0, 0, -1.0, 0.0, 0, 6.0, 1.0 )     new iNum =  floatround( float( iTimer % 60 ) ) // floats are not compatible with the modulo operator     show_hudmessage( 0, "NightCrawlers: %i:%s%i", floatround( ( iTimer / 60.0 ), floatround_floor ), ( 0 <= iNum < 10 ) ? "0" : "", iNum )     iTimer-- }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 06-05-2010 at 21:36.
wrecked_ 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 05:26.


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