Payday/Paycheck system ?
#1

Hi everybody,

I want to do a paycheck system that pay players connected every hour ( exemple 1:00, 2:00).
But I don't know where I should start, and how could I do it.


How should I proceed to do it please ?


Thank you !
Reply
#2

Top of script

Код:
forward Paycheck(); // setting a timer for paycheck
OnGameModeInit:

Код:
SetTimer("Paycheck", 3600000, true); // activating a timer
Now public for it:

Код:
public Paycheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
		if(IsPlayerConnected(i))
		{
			new rand = random(1000);
			GivePlayerMoney(i, rand);
        	        SendClientMessage(i, -1, "You get your paycheck");
    	}
	}
	return 1;
}
That's it
Reply
#3

Thank you, but the timer will start with Gamemode, if I start server at 2:44 It will pay them at (3:44,4:44 etc)

Anyway to do it when it's X:00 ?
Reply
#4

No ideas ?
Reply
#5

Yep, 1 minute repeating timer, use gettime() each time timer happens, and check if minutes equals to 0.
No any other ideas huh :/
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)