08.01.2016, 20:07
Hello there,
First of all let me state that I'm new to scripting and so, if there is an obvious mistake here please don't laugh at me.
Anyways, I'm trying to build a simple timer interval; however, it doesn't seem to be working.
The OnGameModeInit function:
The MinuteTimer stock function
Payday function:
Well, it just doesn't work. Can someone explain me why it doesn't?
Thanks in advance
First of all let me state that I'm new to scripting and so, if there is an obvious mistake here please don't laugh at me.
Anyways, I'm trying to build a simple timer interval; however, it doesn't seem to be working.
The OnGameModeInit function:
PHP код:
public OnGameModeInit()
{
SetTimer("MinuteTimer", 1000, true);
return true;
}
PHP код:
stock MinuteTimer()
{
new hours, minutes, seconds;
gettime(hours, minutes, seconds);
// I know, there is no statement that checks for whole hours, that's because I'm still trying to get the Timer function properly.
for(i=0; i < MAX_PLAYERS; i++)
{
SendClientMessage(i, -1, "Timer called.");
Player[i][pMinutes]++;
if(Player[i][pMinutes]>= 15)
{
Paycheck(i);
}
}
return 1;
}
PHP код:
stock Paycheck(playerid)
{
SendClientMessage(playerid, -1, "Timer worked.");
}
Thanks in advance