[FilterScript] System Time 1.0
#1

System Time 2.0
@Explanation,

This FilterScript nature sends messages good morning, good afternoon, good night, for the players.
Many of you will think and say, "oh that code easy" this and that, anyway What do not have much to explain, this code itself takes the real-time and verifies whether it is night, day, afternoon or if this early in the morning, hope you enjoy.


@Comments,

Was used binary numbering system and was made several optimizations,


@Development,

Neutron97 and Lucas Vinнcius

@Thanks,

Willian Luigi

@Code,

pawn Код:
#include <a_samp>
 
#define function::%0(%1) forward %0(%1); public %0(%1)
 
public OnFilterScriptInit() {
        print("© Copyright Lucas Vinнcius, Willian Luigi and Neutron97/Developers\n"), print("System Time @ThunderGamesBR\n"), SetTimer("RealTimeClock", 60000, 1);
        return 0b1;
}
 
function::RealTimeClock() {
        new hour, minutes, second, sInfo[40], sFormat[128];
        gettime(hour, minutes, second);
 
        if(!minutes) {
        new i = 0b0;
        while (++i != GetMaxPlayers()) {
                if(IsPlayerConnected(i)) SetPlayerTime(i, hour, 0b0);
        }
        switch(hour) {
            case 0b0, 0b1: sInfo = "Have a good start early, good fun!";
            case 0b10 .. 0b101: sInfo = "Have a good morning, good fun!";
            case 0b110 .. 0b1011: sInfo = "Good morning, good fun!";
            case 0b1100 .. 0b1110: sInfo = "Have a Good early afternoon, good fun!";
            case 0b1111 .. 0b10010: sInfo = "Good afternoon, good fun!";
            case 0b10011 .. 0b10111: sInfo = "Good night, good fun!";
        }
        format(sFormat, 128, "* Is %02dhrs, %s *", sInfo);
        SendClientMessageToAll(0x0080FFAA, sFormat);
        }
        return 0b1;
}
Quote:

This was posted on the board filterscript Portuguese before someone comes to say that I copy. Sorry my bad english. Found bugs/errors reporting me by pm or by topic. Has no pictures, I'm no GTA
Reply
#2

Good for RP servers also unique idea
Good work
Reply
#3

It's good to see my name at 'thanks', good job.

+2rep.
Reply
#4

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
It's good to see my name at 'thanks', good job.

+1rep.
no need to say anything but
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)