Payday check
#7

Well, basically you have to do five things

1. Get the TickCount under OnPlayerConnect (furthermore at the point where he actually logs in)
2. Get the TickCount inside of your timer function
3. Get the difference using for example this method:

PHP код:
stock getTickDiff(newTickoldTick

    if (
oldTick && newTick >= 0) { 
        return 
newTick oldTick
    } else if (
oldTick >= && newTick || oldTick newTick) { 
        return (
cellmax oldTick 1) - (cellmin newTick); 
    } 
    return 
newTick oldTick

4. check if the difference (in ms) is more or equal to 25 minutes (assuming u want the payday to hapen every 25 minutes)
5. reset the "connectedTickCount" and do the payout



OR you just create a playertimer doing a payout every 25 minutes, as soon he connects
Reply


Messages In This Thread
Payday check - by vernz - 06.01.2017, 00:05
Re: Payday check - by BiosMarcel - 06.01.2017, 00:10
Re: Payday check - by vernz - 06.01.2017, 00:11
Re: Payday check - by BiosMarcel - 06.01.2017, 00:15
Re: Payday check - by vernz - 06.01.2017, 00:17
Re: Payday check - by ISmokezU - 06.01.2017, 00:23
Re: Payday check - by BiosMarcel - 06.01.2017, 00:24
Re: Payday check - by vernz - 06.01.2017, 00:30
Re: Payday check - by BiosMarcel - 06.01.2017, 00:37
Re: Payday check - by vernz - 06.01.2017, 00:53

Forum Jump:


Users browsing this thread: 3 Guest(s)