PayDay System
#1

Hello! I am Russian, so I apologize for my mistakes, I do not know very well English. Help please write a function call Public exactly %d:00 minutes. And then I had a little constipation.
Reply
#2

Quote:
Originally Posted by L0calNet
Посмотреть сообщение
Hello! I am Russian, so I apologize for my mistakes, I do not know very well English. Help please write a function call Public exactly %d:00 minutes. And then I had a little constipation.
What?


Ohh, I think I understand now, you want a function that get's called every hour exactly on the hour?
Reply
#3

You know how it works PayDay?
I need to be evoked once per hour. But no matter how much a player is logged in
Reply
#4

No, that function need me Sorry
Reply
#5

pawn Код:
//Anywhere in script but not in a callback
forward PayDay();
public PayDay()
{
    new hour, minute;
    gettime(hour, minute);
    if(minute == 0)
    {
        //Payday code here
    }
}

//GameModeInit
SetTimer("PayDay", 1000, true);
Reply
#6

Quote:
Originally Posted by [NWA]Hannes
Посмотреть сообщение
pawn Код:
//Anywhere in script but not in a callback
forward PayDay();
public PayDay()
{
    new hour, minute;
    gettime(hour, minute);
    if(minute == 0)
    {
        //Payday code here
    }
}

//GameModeInit
SetTimer("PayDay", 1000, true);
Example on " //PayDay code here " space

pawn Код:
forward PayDay();
public PayDay()
{
    new hour, minute;
    gettime(hour, minute);
    if(minute == 0)
    {
        for(new i = 0; i<MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            GivePlayerMoney(i, 5000);
        }
    }
}
That allows you to give to all player connected $5000
Reply
#7

This is my PayDay Code:
PHP код:
public PayDay() {
new 
hour,
        
minutes,
        
second;
gettime(hourminutessecond);
if(
minutes == 0) {
      for(new 
0i<MAX_PLAYERSi++) {
             new 
exp playerVariable[i][aLevel]*4+4;
             if(
playerVariable[aExp] == exp) {
                    
playerVariable[i][aLevel]++;
             }
             
GivePlayerMoney(ipaycheck); // paycheck - Global Variable
      
}
}

Reply
#8

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Example on " //PayDay code here " space

pawn Код:
forward PayDay();
public PayDay()
{
    new hour, minute;
    gettime(hour, minute);
    if(minute == 0)
    {
        for(new i = 0; i<MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            GivePlayerMoney(i, 5000);
        }
    }
}
That allows you to give to all player connected $5000



No! This code running all minute! Need check for seconds == 0
Reply
#9

Quote:
Originally Posted by L0calNet
Посмотреть сообщение
No! This code running all minute! Need check for seconds == 0
What i used "if" not "while". When the minute goes to 0 it does all the work not from 0 seconds to 59 seconds. LOL

Edit & Note: I didn't use the timer.

Edit2:


Quote:
Originally Posted by L0calNet
Посмотреть сообщение
This is my PayDay Code:
PHP код:
public PayDay() {
new 
hour,
        
minutes,
        
second;
gettime(hourminutessecond);
if(
minutes == 0) {
      for(new 
0i<MAX_PLAYERSi++) {
             new 
exp playerVariable[i][aLevel]*4+4;
             if(
playerVariable[aExp] == exp) {
                    
playerVariable[i][aLevel]++;
             }
             
GivePlayerMoney(ipaycheck); // paycheck - Global Variable
      
}
}

Where did you take paycheck from? I think you copied that system from your GameMode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)