[Tutorial] How to make a simple server time system

Started by SA:MP, May 05, 2023, 05:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FrankJScott

To the lady asking about buy dasatinib, nad+ reduced, dhea effect, pentagalloylglucose, tocris rock inhibitor, rapamycin for sale, somatostatin octreotide, glucose cotransporter 2 inhibitor, virtual screening methods, d aspartic acid use,  I highly suggest this high rated amino acid details or tsa inhibitor, integrase inhibitors moa, paradol, emricasan, omeprazole a proton pump inhibitor, mouse to human dose calculator, wnt signaling beta catenin, auristatin e, sodium glucose transporter 2 inhibitor, menatetrenone use, which is worth considering with this updated amino acid forum bearing in mind dyclonine hcl, sodium glucose co transporter, essential acid, human dose to animal dose calculator, a aspartic acid, jak1 pathway, akt signal pathway, type 5 inhibitors, necessary amino acids for body, betahistine effects, alongside all this here for amino acid link which is also great. Also, have a look at this recommended amino acid link on top of activated protein kinase, jak kinases, cck8 kit, pembrolizumab anti pdl1, calcium blockers for hypertension, drug library screening, essential amino acid for infants, dhea abbreviation, vitamin b2 for, signal transduction pathway g protein coupled receptors, not to mention this sources tell me for amino acid advice not to mention sb inhibitor, a2a adenosine receptor, pdl pdl1, methenamine hippurate tablet 1 gm, hts high throughput screening,  this hyperlink on which is worth considering with calcium channel drugs, epigenetic diseases examples, 3 beta hydroxybutyrate, small molecule library screening, cfse dilution,  for good measure. Check more @ New Used Iphone 12 Guide 32f8d49

FrankJScott

For the person talking about red light therapy for skin rejuvenation, med spa botox, best chemical peel for skin tightening, wrinkles forehead botox, best co2 laser for face, dermal treatment, botox face wrinkles, laser skin tightening procedure, micro needling and red light therapy, smile fillers,  I highly suggest this awesome erectile dysfunction treatment sarasota site or best treatment for smooth skin, p injection, radiesse forehead, antiaging procedures, facial lines treatment, botox procedure for face, medical botox injections, platelet facial, cool peel facial, chemical peels, not forgetting sites such as this read more for penile rejuvenation therapy in sarasota url alongside all medical skin rejuvenation, chemical peel skin care, prp needling treatment, botox post, botox and facial, prp hair microneedling, radiesse lip, rf body treatment, body treatments, best skin treatment for fine lines, together with this that guy on non-invasive erectile dysfunction solutions sarasota details which is also great. Also, have a look at this recommended you read on erectile dysfunction solutions sarasota details together with reduce lip filler, frown wrinkle, best treatment for aged skin, face fillers before after, female o shot, most effective wrinkle filler, fillers for lines, facial for body, med spa sarasota fl, best treatment for smooth face, as well as this high rated pshot services sarasota link not to mention best forehead wrinkle treatment, botox laser treatment, best face fillers, rejuvenate 528 regenerative aesthetics medical spa, skin tightening and wrinkle reduction,  moved here for not forgetting sites such as care post treatment, microneedling for the body, red light therapy treatment, botox makeup, facial contouring with dermal fillers,  for good measure. Check more @ High Rated Pshot Injections Sarasota Blog 68456a0

SA:MP

[Tutorial] How to make a simple server time system

Hello this is my first tutorial Iam just gonna explain this fast (if there's anybody who needs this). This tutorial is about time on your server (not weather), how to make the server to automatically set the server time as the clock on your server...?

First you need to make a timer that will set server time every 1 hour (if you have a payday sistem which repeats every hour you can just put everything there):




Code:

forward Time(); // you should put this timer with the other timers in you server but it is not really important
public Time()
{
    // This is what will happen when timer's time run out
}

Second you need to get your server (clock) time inside that timer like this:




Code:

forward Time();
public Time()
{
    new h; // here we make a new variable in which we will store that time we get from server
    gettime(h); // here we store it to variable 'h'
}

Then we need to put server time as the variable 'h', but if in your country currently is winter probbably it is night at like 6 o'clock so you can make that too like this:




Code:

forward Time();
public Time()
{
    new h;
    gettime(h);
    if(h == 18 || h == 19) // here we check if it is 19h or 18h if it is we will set the world time to current time plus 5 hours so it will be night and so we are goin on with this below
    {
         SetWorldTime(h+5);
    }
    else if(h == 20 || h == 21)
    {
        SetWorldTime(h+4);
    }
    else if(h == 22 || h == 23)
    {
        SetWorldTime(h+2);
    }
    else   // here we check if current time is not 18,19,20,21,22,23 (everything that we haven't specified before) and if time is like 9h AM it will set your world time to 9
    {
        SetWorldTime(h);
    }
}

And one last thing is to actually set the timer and make it repeating every 1h (put this in your on gamemode init so it will be set as server is started):




Code:

SetTimer("Time", 3600000, true); // this is setting the public timer which you made before, 3600000 is the one hour in milliseconds and true means that timer will be repeated every time when interval get to 0 and your interval is 1hour (3600000)

This is my first tutorial and I haven't spend much time on it so don't hate a lot. And if there's mistakes type below

Source: [Tutorial] How to make a simple server time system