SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/04/2017, 05:34 PM   #1
Man43
Big Clucker
 
Man43's Avatar
 
Join Date: Feb 2017
Posts: 117
Reputation: 0
Question Timer.

Hello everyone im making a lottery system but i need help here!!!!

The Timer:-

My problem is I Want it given him the message at 6:00 and lottery winning's at 16:00 how should i did it?... i already make a timer and everything is done but i dont knw what is timers like

15000 = what ... so can u help me?

EDITED:- I Want LottoShow()must be show at 6:00
Code:
new time;
forward LottoShow();
public LottoShow()
{
   new string[256];
   format(string, sizeof(string), "{00FF00}[LOTTERY]: The current Jackpot is: $%d The Lottery will be draw in 4 game Hours!",Jackpot);
   SendClientMessageToAll(COLOR_WHITE, string);
   KillTimer(Timer);
   time = SetTimer("LottoWiner",15000,1);
   return 1;
}

And this at 16:00
forward LottoWiner();
public LottoWiner()
{
	KillTimer(time);
	new rand = randomEx(1,MAX_NUMBERS);
	if(rand < MAX_NUMBERS - 3) { rand += 3; }
	Timer = SetTimer("LottoShow", 1000*(LottoTime*60), 1);
	Lotto(rand);

}
Is this you want?> pls help
Man43 is offline   Reply With Quote
Old 21/04/2017, 05:49 PM   #2
[G]am3r
Huge Clucker
 
[G]am3r's Avatar
 
Join Date: Nov 2016
Location: Graveyard
Posts: 208
Reputation: 21
Default Re: Timer.

15000 is 15 seconds, that's what I know…
[G]am3r is offline   Reply With Quote
Old 21/04/2017, 06:04 PM   #3
Man43
Big Clucker
 
Man43's Avatar
 
Join Date: Feb 2017
Posts: 117
Reputation: 0
Default Re: Timer.

@Tom, i need if timer starting at 00:00 The message given him after 6:00 so at 16:00 = who's winning lotto.

i find one is: 400000 = 6mintes and 600000 = 10mintes... but how should i use it
Man43 is offline   Reply With Quote
Old 21/04/2017, 06:19 PM   #4
Sew_Sumi
High-roller
 
Join Date: Jun 2008
Posts: 4,660
Reputation: 313
Default Re: Timer.

Larger timer values will become inaccurate.

If you are using a filterscript to do your game time, then you could call the lotto functions from the filterscript. That'd then make it synced to the right time.

Otherwise, smaller timers, using gettime and checking how long in total they've been running could be a better plan.


I've always been a fan of a 1 second tick timer, that simply does smaller things. You could run a 1 minute one, or for more 'accuracy' you could do a 15 second one to track the segments, 4 hours in gametime being 4 minutes, and then needing to track the other 20 hours (20 minutes) to restart the drawing.

http://wiki.sa-mp.com/wiki/Gettime
Sew_Sumi is offline   Reply With Quote
Old 21/04/2017, 06:58 PM   #5
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,858
Reputation: 2567
Default Re: Timer.

I suppose you already have something that advances the clock so just hook it into there.
__________________
Vince is online now   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Question , Per Player Timer vs Timer that loops through all players [Bios]Marcel Scripting Help 14 12/12/2016 09:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 04:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 09:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 03:50 PM
[Timer Help] Score saving timer, should it always be running or should it be killed? Ghost100 Scripting Help 6 08/10/2012 10:12 PM


All times are GMT. The time now is 08:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.