Payday every hour
#1

Hello

When i do payday system with GetTime, then how i can check the player is in 1 hour been online for 30 minutes?

Larry
Reply
#2

Use

pawn Код:
//on top of script
new Timerpday;
in OnPlayerConnect

pawn Код:
Timerpday = Settimer(funname[],interval,repeat);
And add this on player disconnect

pawn Код:
Destroytimer(Timerpday);
Remember create a public and forward for the funname like "forward payday(playerid); public payday(playerid)"
Reply
#3

dont use get time, i will make you a payday for every hour
Reply
#4

mm Okay, i be waiting
Reply
#5

use this code
OnPlayerConnect

pawn Код:
SetTimerEx("payday", 3600, true, "i", playerid);
outside any callback
pawn Код:
forward payday(playerid);
public payday(playerid)
{
    GivePlayerMoney(playerid, 1000);
    return 1;
}
Reply
#6

Thanks but the question was how to do the player have to be online for at least 30 minutes in 1 hour to get payday?
Reply
#7

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
use this code
pawn Код:
SetTimerEx("payday", 3600, true, "i", playerid);
3,6 seconds..

gg
Reply
#8

ok, heres the total code for you then
On Top Of script[pawn]new IsAllowedPayday[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
SetTimerEx("payday", 3600, true, "i", playerid);
SetTimerEx("allowed", 1800, false, "i", playerid);
outside any callback
pawn Код:
forward payday(playerid);
public payday(playerid)
{
    if(IsAllowedPayday[playerid] == 1)
    {
    GivePlayerMoney(playerid, 1000);
    }
    return 1;
}
forward allowed(playerid);
public allowed(playerid)
{
     IsAllowedPayday[playerid] = 1;
     return 1;
}
Reply
#9

And this is the best solution? In ideal this would be like, i can log-in and log-out every time, and every minute i have been in is saved.
Reply
#10

All of this thing wich time is one large bullshit,did you expect player to stay in server 1h wichout leaving - image if crash or lose connection , then what ? start timer 1h again
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)