PDA

View Full Version : FS] - Clock Made Easy [1hr = 60mins, 1min = 60sec's]


Kapil
10/07/2007, 04:21 AM
After a huge flame in the General Discussions Forum (http://forum.sa-mp.com/index.php?topic=22007.0) it has now beed updated and Striked Script Showroom also. But this time in the form of a filterscript !

What is it ?
This is a addon to your gamemode or script which creates a clock, like the one in Single Player. It has a perfect placement and transperent border which adds more reputations to its look.

What does it do ?
It collects the information about the current Time from your PC(i.e from where u r hosting your server) and arrages the clock at the top so that everyone who joins your server can see it.

lol ! I can do it with just TogglePlayerClock ! then why is this for ?
Yes u can just make a clock in your gamemode with just TogglePlayerClock, but the thing is that clock has unit 1min = 1 sec and 1hr = 60sec, and most of the rpg scripts cant use it as they give paydays and etc according to the time.

How about its tests ?

All the tests went fine, many were involved in testing it. Its a gaurentee that there r no bugs in it too.

How do I install it ?
-> Download ClockMadeEasy.
-> Unzip them into your SAMP folder.
-> Open server.cfg.
-> Replace "filterscripts adminspec actions" to "filterscripts adminspec actions Clock".
-> Save and Close server.cfg.

Cool ! But how does it look in my gamemode ? Any Screenshots ?

http://i13.tinypic.com/6hf3s7d.png

Whats new in this Update ?
-> The clock size and position has been fixed.
-> The clock will also have effect in the weather.
-> Transperent border is removed to dark black border.

Downloads -

It includes both .amx and .pwn files. <BLOCKED>

NOTE: It was a clear distrumptinon that there are no bugs and there will be no bugs, But still if u found any bugs dont ever hesitate to repley in this forum.

Tornado
10/07/2007, 04:50 AM
Nice

Malice
10/07/2007, 06:08 AM
Awesome, works great. You could shorten it to a measly 36 lines though if you want. :D

forward time();
#include <a_samp>
#define FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------");
print("Clock by Kapil");
print("--------------\n");
return 1;
}

public OnPlayerConnect(playerid)
{
time();
return 1;
}

public time(){
new Text:Clock;
TextDrawDestroy(Clock);
new hour,minute,second;
gettime(hour,minute,second);
new string[256];
if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
else {format(string,25,"%d:%d",hour,minute);}
TextDrawHideForAll(Clock);
Clock=TextDrawCreate(552,28,string);
TextDrawLetterSize(Clock,0.5,1.8);
TextDrawFont(Clock,3);
TextDrawBackgroundColor(Clock,40);
TextDrawSetOutline(Clock,2);
TextDrawShowForAll(Clock);
SetTimer("time",30000,0);
return 1;
}

Warriors_Tornado
10/07/2007, 08:13 AM
i had longer but thats not the problem

onehels
10/07/2007, 08:39 AM
I have lag with this FS!
In map "Public Enemy LS" do not work commands of map!
Plz fix this!

Kapil
10/07/2007, 09:03 AM
I have lag with this FS!
In map "Public Enemy LS" do not work commands of map!
Plz fix this!


omg I forgot it !!! thank U for remembering me and anyway I have fixed and updated it ! ;)

Malice
10/07/2007, 09:44 AM
Actually I don't think that will work, after shortening it myself I tested and saw it didn't work which is why I left

public OnPlayerConnect(playerid)
{
time();
return 1;
}

in the code... The version I posted works and is the shortest. :D

i had longer but thats not the problem

@ Warriors, the version I posted wasn't the one I got, I shortened it.
Edit: Yea, the new version is missing what I put... The version I posted before is shortened and working, just compile that.

onehels
10/07/2007, 11:30 AM
I have lag with this FS!
In map "Public Enemy LS" do not work commands of map!
Plz fix this!


omg I forgot it !!! thank U for remembering me and anyway I have fixed and updated it ! ;)

Ok, when fix say plz ;)

Duelos SA
10/07/2007, 02:40 PM
Not work for me :(

regards

Kapil
10/07/2007, 02:45 PM
Ok, when fix say plz
I said i fixed it.

Not work for me
well did u made changes in the server.cfg ?

onehels
10/07/2007, 02:58 PM
I said i fixed it.

Now watch did not work=(
My server SAMP 0.2.0

Duelos SA
10/07/2007, 03:00 PM
Ok, when fix say plz
I said i fixed it.

Not work for me
well did u made changes in the server.cfg ?


Of course i have add the srcipt in CFG, but dont work :'(


regards

Kapil
10/07/2007, 03:19 PM
Updated, Redownload plizzzz....as i used to say.

An Err is for Mankind, To forgive is for GOD
lol

onehels
10/07/2007, 06:45 PM
Now all work good!
Nice script!

[SMB]Bip
10/07/2007, 07:28 PM
works perfect on my server thanks mate :D

MaTrIx4057
10/07/2007, 07:29 PM
Yeah good work man.

Alejandro
10/07/2007, 07:54 PM
i enable this in server.cfg, but i dont see the clock. :|

Kapil
11/07/2007, 12:42 AM
i enable this in server.cfg, but i dont see the clock. :|


maybe u downloaded the old version of it, try redownloading. :roll:

Alejandro
11/07/2007, 12:53 AM
yep that was it. nice, i love the way it looks. u da man kapil :!: :P

Ze B@ND!D0
11/07/2007, 07:15 PM
Works perfectly!

Warriors_Tornado
11/07/2007, 07:57 PM
finally this script is working on my server too

Ze B@ND!D0
11/07/2007, 09:44 PM
Can somebody change the weather? Like 22h it's night and not day?

Warriors_Tornado
12/07/2007, 06:58 AM
when i always start a game or when i dead the time is changing to 00:00 at night.
And sometimes 3 peoples have different times
i had night others day beceause i dyded
can i set time to12:00 when i dyd and spawning to the spawn place

Kapil
12/07/2007, 11:43 AM
when i always start a game or when i dead the time is changing to 00:00 at night.
And sometimes 3 peoples have different times
i had night others day beceause i dyded
can i set time to12:00 when i dyd and spawning to the spawn place


You r using Samp Clock not this Clock Warrior, U can ask this question in the genreal discustion
__________________________________________________ _____________________________________

Next Update Notes:-

-> The clock will be little widened( width will increase).
-> The clock will also have effect in the weather.
-> Transperent border will be darkened.

If u have anymore suggestions or advices NEVER HESITATE

courage
12/07/2007, 01:53 PM
You must also understand that this clock is under a textdraw.
I know some filterscripts wich are using KillTextDraw, that COULD effect this clock.
Btw one of them is CarNames :P

Warriors_Tornado
12/07/2007, 01:55 PM
ok its god
iwill keep like it was my clock

Kapil
12/07/2007, 02:23 PM
You must also understand that this clock is under a textdraw.
I know some filterscripts wich are using KillTextDraw, that COULD effect this clock.
Btw one of them is CarNames :P


hmm...but did u forget that textdraws can be assigned a name ? rather like checkpoints and pickup's which cannot be assigned a name to it, textdraws can be assigned a name like for menu's, and a textdraw gets destroyed only if he does TextDrawDestroy(Clock), Anyway even though he destroys it, it will spawn back after every 30secs. ;) So there are no known bugs in this ! be patient the update will be done as soon as possible.

wdoyle2
12/07/2007, 07:25 PM
will f10 still take away all stuff off screen or will clock still apear

50p
12/07/2007, 07:32 PM
You must also understand that this clock is under a textdraw.
I know some filterscripts wich are using KillTextDraw, that COULD effect this clock.
Btw one of them is CarNames :P


hmm...but did u forget that textdraws can be assigned a name ? rather like checkpoints and pickup's which cannot be assigned a name to it, textdraws can be assigned a name like for menu's, and a textdraw gets destroyed only if he does TextDrawDestroy(Clock), Anyway even though he destroys it, it will spawn back after every 30secs. ;) So there are no known bugs in this ! be patient the update will be done as soon as possible.


AFAIK TextDraw can be assign to a "name" (variable tagged with Text). Try to use TextDrawDestroy(Text:2) and you'll see it will destroy text with id 2.
So the "name" holds a number. It is the same with menu.

Warriors_Tornado
12/07/2007, 08:52 PM
i will wate for update

tafi
13/07/2007, 11:22 AM
how to add black contour?

Warriors_Tornado
13/07/2007, 01:35 PM
ask kapil to pm he helped me

courage
13/07/2007, 03:05 PM
Kapil, yes i know that.
I just said that some filterscripts/gamemodes uses some functions, that destroys textdraw's.

Warriors_Tornado
13/07/2007, 03:09 PM
thats is possible

Kapil
15/07/2007, 02:12 PM
Atlast ! Updated !

http://i13.tinypic.com/6hf3s7d.png

Whats new in this Update ?
-> The clock size and position has been fixed.
-> The clock will also have effect in the weather.
-> Transperent border is removed to dark black border.

Remeber this is just a beta, so if at all u have found bugs report it !

Foxtrota
15/07/2007, 03:07 PM
ah nice job, weather too? i got a clock already though.

Kapil
15/07/2007, 03:21 PM
ah nice job, weather too? i got a clock already though.


other clock ??? other than Clock Made Easy ?? do u mean the SAMP one, oh well

Foxtrota
15/07/2007, 04:25 PM
ah nice job, weather too? i got a clock already though.


other clock ??? other than Clock Made Easy ?? do u mean the SAMP one, oh well


nah, i have no idea how it was made, by JohnSanders, i just choose not to mess with it.

Kapil
17/07/2007, 05:23 AM
UPDATED again.

FIXED BUGS->

-> Weather doesnt change everyhour....FIXED
-> At night it shows the sun :D....FIXED
-> The weather changes doesnt effect if a player connects a min before a hour....FIXED

Warriors_Tornado
17/07/2007, 12:52 PM
yes atleast kapil
the update are in your first post i guess
thx
becuese i didnt like when i start game at night thx again

Kapil
17/07/2007, 02:02 PM
yes atleast kapil
the update are in your first post i guess
thx
becuese i didnt like when i start game at night thx again


Well then its eazy, just dont play at night ! ;) lol

Warriors_Tornado
17/07/2007, 02:22 PM
but there isnt any chances to set 12:00 o clock always when you spawn

Kapil
18/07/2007, 01:26 AM
but there isnt any chances to set 12:00 o clock always when you spawn


U can, but why ?? anyway if u r hosting the server and u want time to start from 12:00, just change your computer time to 12:00 AM.

zeruel_angel
29/08/2007, 08:19 PM
Hi! I'm zeruel_angel I have made a Fuel+speedo FS
http://forum.sa-mp.com/index.php?topic=27691.msg193695#msg193695
and some ppl said that your FS and my FS can't work together...

How do i intergrate the follow filterscript that also used TextDraw?
http://forum.sa-mp.com/index.php?topic=23259.0

Thx,
Alexw

So I decided to take a look at your work and I edited it to make it compatible with my FS, here is the result, OF COURSE I have you total credits for your work, but I wanted you to take alook at it and to give me your aproval. Thanks
http://www.savefile.com/files/1014025

See you later!

Ze B@ND!D0
30/08/2007, 02:16 PM
Hi Kapil, can you put the border more dark?
Thanks ;)

pimpielauwie
09/10/2007, 03:00 PM
it's night @ 16.00 :roll:

[SWK]Acid
10/10/2007, 02:48 PM
Could be more efficient. You should indent your code too.

Curynga
17/10/2007, 10:10 PM
Hey, i need random weather :)

Somebody put in filsterscript the random weather ?

Thanks.

Obs: Sorry for my bad english, i dont speak very english.

nate660
17/10/2007, 10:19 PM
there is a random weather script floating around somewhere go look for it, i would search for it but for some reason my search button is being gay, **cough** **cough** :lol:

Curynga
17/10/2007, 10:22 PM
I did not find =/

Plz, giveme the link

Otis
10/11/2007, 07:09 PM
This still crash gta.exe... :s
I already tried to place the new Text:Clock in the top of the script and to hide TextDraw in OnPlayerDisconnect
But continue the crashs the client...

I am using the version 0.2.2
This version really has many problems with TextDraws...

What should make?

Streetplaya
18/11/2007, 08:45 AM
Well, you could replace the 24 IF's with one row:

SetWorldTime(hour);

and why did you make the pawno code from the original example code? (new.pwn)

Greez
Streetplaya ;)

JaTochNietDan
08/12/2007, 01:55 PM
Kapil FtW

Maniek
15/03/2008, 12:40 AM
Maby you will use TextDrawSetString do not doestry or create... ;)

Ze B@ND!D0
15/03/2008, 12:18 PM
This FS it's great but with PenLS or PenLV it doesn't work well

Zh3r0
15/03/2008, 01:19 PM
[color=red]Nice very nice but to me the [color=black]clock sometimes go very fast

adihash
30/05/2008, 03:38 PM
if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
else {format(string,25,"%d:%d",hour,minute);}


that's better:

format(string,25,"%d:%02d",hour,minute);

greets
adihash

fyndler
30/05/2008, 04:38 PM
Oh link gone wanted this one lol

aspire5630
20/04/2009, 01:20 AM
Wheres download link?