30.04.2014, 13:53
Hi and thanks that you wasted your time and looked at my thread first of all
.
Ok, so i'm tryin' to make a RP gamemode and i have a problem with the PayDay system. I made a timer, that activates another timer at the next minute:00 and the last activated timer is set on repeat, so basically it should call my function at every minute:00. Here is my code:
It should give the PayDay to players at all hours:00:00, but the problems is that i've got a delay. I know that Timers use resources but i don't know how else could i give the payday to players at all :00 hours.
Here's the serverlog:
As you can see the function gets called after more than a minute every time. Some ideas? :-s
.Ok, so i'm tryin' to make a RP gamemode and i have a problem with the PayDay system. I made a timer, that activates another timer at the next minute:00 and the last activated timer is set on repeat, so basically it should call my function at every minute:00. Here is my code:
Код:
public OnGameModeInit()
{
new h,mi,s;
gettime(h,mi,s);
SetTimer("setminutetime", 60000-(s*1000), 0);
}
public setminutetime()
{
MinuteTime();
MinuteTimer = SetTimer ( "MinuteTime" , 60000 , 1 ) ;
return 1;
}
public MinuteTime()
{
print("peleme");
new Ora, Minut, Secunde;
gettime ( Ora , Minut , Secunde );
if(Minut == 0){
foreach (Player , i) {
if ( IsPlayerConnected(i) == 1 ) PayDay ( i ) ;
}
}
}
Here's the serverlog:
Quote:
|
[16:41:35] Number of vehicle models: 0 [16:41:57] peleme [16:43:03] peleme [16:44:09] peleme [16:45:16] peleme [16:46:22] peleme [16:47:28] peleme [16:48:33] peleme [16:49:39] peleme |


