[FilterScript] Custom Clock speed
#1

I'm making my own RP-GM with a few friends and we thought it'd be cool to RP at night too without being playing sa-mp in the night (even though we can ). So I tried to edit the default clock that is included in sa-mp but it turned out to be slightly different so i decided to make a custom clock with a textdraw since I couldn't find any excisting FilterScripts with this. ( Maybe this is useless or nobody wants it or its too hard to make ) So here it is

Features:
Default clock speed is 3 times the real time speed so 1 game hour takes 20 real minutes.
The speed of the clock is defined by #define CLOCKSPEED.
The minutes are controlled by some calculations so whatever CLOCKSPEED you use it should always work fine. (Integer numbers only though.)
CLOCKSPEED 1 is normal speed.
CLOCKSPEED > 1 is faster speed.
CLOCKSPEED < 1 is slower speed. (Though i don't think anyone would like a slower speed)
Uses a textdraw to show the clock. The textdraw is updated every minute, update is triggered by a timer.
I have only tested this with CLOCKSPEED 3 and it works fine. Since its controlled with calculations that uses the define CLOCKSPEED it should work properly with other (integer) numbers too.
Whenever the hour changes it automatically syncs the WorldTime with the current hour.
V2.0:
It runs like a normal clock now 0:01 -> 0:02 -> 0:03 -> etc.
Added a function where you can choose between 24-Hour clock and 12-Hour clock and it adds AM and PM
The speed is now controlled by 1/CLOCKSPEED*60000 this way I could make it have 60 minutes instead of
60/CLOCKSPEED minutes.

(Possible) Bugs & Issues:
Assuming you have turned the default clock off (TogglePlayerClock) it should work fine. Otherwise you either see 2 clocks over eachother or you don't see any clock at all. (I haven't tested this since its pretty obvious you check this)
Since it works with minutes now I advise not to make the clockspeed too high since that will make it draw and hide TextDraws a lot wich may cause lag.

Pastebin(old):
http://pastebin.com/zFugygx4

Pastebin(V2.0):
http://pastebin.com/a9LbByNt

I haven't tested this FS myself but it should work fine since its just a modified version of the already working one.
If you find any bugs please let me know.

Note: I know you want some screens but its rather useless since it looks the same as the SinglePlayer clock.
Reply
#2

This is really nice, im using it already
Reply
#3

What about pics?Post some pics .
Reply
#4

Awesome!
Reply
#5

Any screens?
Reply
#6

A voice in my head says: Dude the crowd wants some pics!!! Normally I don't listen to it but in this case i'll post some pics.
Reply
#7

looks awesome ive been wanting something like this
Reply
#8

screen

For some reason it doesn't let me add pictures here so here's the link [url]http://imageshack.us/photo/my-images/814/samp20110604232007.jpg/

(Not much different from the normal clock though)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)