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

Cross map and restart timing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-29-2006 , 03:29   Cross map and restart timing
Reply With Quote #1

How to execute special events on a specific time?
Like I want to exec func() on 2006/12/24 22:00.

What is the best way?
I've been thinking of a file that I can edit to have the dates and times and so on, but I don't know where to start

Thx.
__________________
Sig(h)!
Obbin is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-29-2006 , 04:26   Re: Cross map and restart timing
Reply With Quote #2

get the time in plugin_init and calculate how many seconds later the specific
function shall be called and use the set_task Function. That is how I would do it.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-29-2006 , 05:49   Re: Cross map and restart timing
Reply With Quote #3

There exist a plugin for that:http://forums.alliedmods.net/showthread.php?p=11751
__________________
schnitzelmaker is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-29-2006 , 08:22   Re: Cross map and restart timing
Reply With Quote #4

Duh, that one does not work over mapchanges
__________________
Sig(h)!
Obbin is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-29-2006 , 11:03   Re: Cross map and restart timing
Reply With Quote #5

I made a Pawn and a PHP script for you.

To calculate the timestamp, go here: http://www.gotjuice.nl/extImg/getTimestamp.php
Here is the source of the PHP script: http://www.gotjuice.nl/extImg/getTimestamp.php.txt

---

Code:
#include <amxmodx> #include <amxmisc> #pragma semicolon 1 //This is the timestamp for 2006/12/24 22:00 //You can calculate your timestamp at http://www.gotjuice.nl/extImg/getTimestamp.php #define TIMESTAMP 1166994000 #define EXTRA_RANGE 5 public plugin_init() {     register_plugin("Kamikaze Watermellon", "Wall", "Button");         set_task(1.0, "checkTime", _, _, _, "b"); } public checkTime() {     //Are we within the range     if( TIMESTAMP <= get_systime() <= (TIMESTAMP + EXTRA_RANGE) )         doStuff();     return PLUGIN_CONTINUE; } doStuff() {     client_print(0, print_chat, "Event occured!"); }
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 10-30-2006 , 03:38   Re: Cross map and restart timing
Reply With Quote #6

Thanks!
__________________
Sig(h)!
Obbin is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 10-30-2006 , 06:00   Re: Cross map and restart timing
Reply With Quote #7

hmm,thx
I got a idea...
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-30-2006 , 13:05   Re: Cross map and restart timing
Reply With Quote #8

Code:
public plugin_init() {     register_plugin("Kamikaze Watermellon", "Wall", "Button");       // One thing I will do here is a least check the date.     // So you can might have this plugin loaded before the actually date.     // So your not running set_task always when it not.     set_task(1.0, "checkTime", _, _, _, "b"); }

Just an suggestion to you Obbin.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-30-2006 , 14:57   Re: Cross map and restart timing
Reply With Quote #9

Yeah. I gave him a very simple version just to show the idea.
Also, the message is displayed 5 times because it doesn't check wether the task already occured.
Again, it's only to show the idea.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Old 10-30-2006, 16:28
Nostrodamous
This message has been deleted by Nostrodamous.
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-30-2006 , 16:30   Re: Cross map and restart timing
Reply With Quote #10

WHAT?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
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 06:46.


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