SA-MP Forums Archive
Perfect timer for.. [+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Perfect timer for.. [+REP] (/showthread.php?tid=384406)



Perfect timer for.. [+REP] - Larry123 - 11.10.2012

Hello

I want to do a system, that in every 24hours system changes specific variable to "50". What is good system to do that? Give me good solution, please.

Thanks,
Larry


Re: Perfect timer for.. [+REP] - XtremeR - 11.10.2012

its simple use this:
pawn Код:
forward ch();

public OnGameModeInit()
{
    print("Starting timer...");
    SetTimer("ch", 240000, false);
}
 
public ch()
{
    //code here
}



Re: Perfect timer for.. [+REP] - Glint - 11.10.2012

You can use my function here http://forum.sa-mp.com/showpost.php?...postcount=3631 it is helpful in your situation..


Re: Perfect timer for.. [+REP] - Larry123 - 11.10.2012

XtremeR -- But what happens when i restart my server before 24h? Then the variable doesn`t change.

Glint -- Can you give some examples? I didn`t understand very well.


Re: Perfect timer for.. [+REP] - Glint - 11.10.2012

Can you tell me what you want to do in more detail so i can help you more.


Re: Perfect timer for.. [+REP] - NewerthRoleplay - 11.10.2012

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
its simple use this:
pawn Код:
forward ch();

public OnGameModeInit()
{
    print("Starting timer...");
    SetTimer("ch", 240000, false);
}
 
public ch()
{
    //code here
}
Thats 4 minutes not 24 hours... http://*******/OrkQVx there, click it to see what 24hours is in milliseconds


Re: Perfect timer for.. [+REP] - Larry123 - 11.10.2012

I want to do a NPC, which has a variable(weed seeds) "50" in every 24hours.


Re: Perfect timer for.. [+REP] - Glint - 11.10.2012

Quote:
Originally Posted by Larry123
Посмотреть сообщение
I want to do a NPC, which has a variable(weed seeds) "50" in every 24hours.
Sorry i still didn't understand you :P, you mean the NPC will gain 50 Weed Seeds every 24 hour ?


Re: Perfect timer for.. [+REP] - NewerthRoleplay - 11.10.2012

Quote:
Originally Posted by Larry123
Посмотреть сообщение
I want to do a NPC, which has a variable(weed seeds) "50" in every 24hours.
Wait now I'm confused, does the NPC have 50 (weed seeds) every 24hours?


Re: Perfect timer for.. [+REP] - Larry123 - 11.10.2012

Glint, that's right