SA-MP Forums Archive
Payday - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Payday (/showthread.php?tid=437276)



Payday - Tanush123 - 14.05.2013

Well in my server i got a payday system. How can i make a command called /paydaytime, make that command tell how many minutes are left for pday?
pawn Код:
#define PAYDAY_TIME 1800000

forward PayDay(playerid);

SetTimer("PayDay",PAYDAY_TIME,true);

public PayDay(playerid)
{
    Payday();
    return 1;
}



Re: Payday - Riddy - 14.05.2013

Basically,

pawn Код:
#define PAYDAY_TIME 1800000
new payTimer;

payTimer = SetTimer("PayDay2", PAYDAY_TIME, true);

public PayDay(playerid)
{
    Payday();
    return 1;
}

CMD:paydaytime(playerid, params[])
{
    new string[84];
    format(string, sizeof(string), "%d till payday", pTimer);
    return 1;
}



Re: Payday - Tanush123 - 14.05.2013

it shows 0 minutes
pawn Код:
CMD:paydaytime(playerid,params[])
{
    format(str,sizeof(str),"%d minutes till next payday",Paytimer/60000);
    SCM(playerid,lightgreen,str);
    return 1;
}



Re: Payday - Tanush123 - 15.05.2013

bump


Re: Payday - Zex Tan - 15.05.2013

pawn Код:
new payTimer = SetTimer("PayDay2", PAYDAY_TIME, true);
Not sure if this helps but I just notice in my script I can't put 2 same variables


Re: Payday - tyler12 - 15.05.2013

pawn Код:
new PaydayTime = 60;

SetTimer("PayDay",60000,true);

public PayDay()
{
    PayDayTime --;
    if(PayDayTime == 0)
    {
        Payday();
        PayDayTime = 60;
    }
    return 1;
}

CMD:paydaytime(playerid,params[])
{
    format(str,sizeof(str),"%d minutes until your next payday.",PayDayTime);
    SCM(playerid,lightgreen,str);
    return 1;
}



Re: Payday - Tanush123 - 16.05.2013

Thanks


Re: Payday - Pottus - 16.05.2013

Well, your timer will not be real minutes read this https://sampforum.blast.hk/showthread.php?tid=289675 timers are slow so a 60000 timer is about a minute and 7 seconds.


Re: Payday - Tanush123 - 16.05.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Well, your timer will not be real minutes read this https://sampforum.blast.hk/showthread.php?tid=289675 timers are slow so a 60000 timer is about a minute and 7 seconds.
Thanks for telling the link. On the topic, slice says it will fix the timer with the include, so i put the include on my gamemode.