Building a payday function
#1

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:
PHP код:
public OnGameModeInit()
{
    
SetTimer("MinuteTimer"1000true);
        return 
true;

The MinuteTimer stock function
PHP код:
stock MinuteTimer()
{
    new 
hoursminutesseconds;
    
gettime(hoursminutesseconds);
    
    
// 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=0MAX_PLAYERSi++)
    {
        
SendClientMessage(i, -1"Timer called.");
        
Player[i][pMinutes]++;
        
        if(
Player[i][pMinutes]>= 15)
        {
            
Paycheck(i);
        }
    }
    
    return 
1;

Payday function:
PHP код:
stock Paycheck(playerid)
{
    
SendClientMessage(playerid, -1"Timer worked.");

Well, it just doesn't work. Can someone explain me why it doesn't?

Thanks in advance
Reply


Messages In This Thread
Building a payday function - by Josh_Lotus - 08.01.2016, 20:07
Re: Building a payday function - by Mencent - 08.01.2016, 20:13
Re: Building a payday function - by Josh_Lotus - 08.01.2016, 20:26
Re: Building a payday function - by Mencent - 08.01.2016, 20:32

Forum Jump:


Users browsing this thread: 2 Guest(s)