Time to 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: Time to PayDay (
/showthread.php?tid=636292)
Time to PayDay -
MrTea - 24.06.2017
I tryed to make a command , when a player write /mypayday , for that player show up a text draw with time until payday. This TextDraw show up but don't count minutes. It show 60 minutes constantly.
http://imgur.com/a/adv2h
Код:
CMD:mypayday(playerid, params[])
{
format(pInfo[playerid][pGText], 31, "payday in: [%02i]", (pInfo[playerid][pPay]-gtm)/60);
TextDrawShowForPlayer(playerid, PayDayTD);
return 1;
}
I get this function from command time, that show a text not a text draw!
Код:
CMD:time(playerid, params[])
{
format(pInfo[playerid][pGText], 31, "~w~payday in: ~n~~g~%02i:%02i", (pInfo[playerid][pPay]-gtm)/60, (pInfo[playerid][pPay]-gtm)%60), GameTextForPlayer(playerid, pInfo[playerid][pGText], 1000, 1);
return 1;
}
Re: Time to PayDay -
Abagail - 24.06.2017
First off, using global textdraws (TextDraw_) won't be unique for players if you're using the same one. You should instead use player textdraws (PlayerTextDraw_) which allows you to customize the time per player.
Secondly, how do you expect the time to magically increase on its own? You need to manually update it when you want. If you want to update per minute, you could use timers (SetTimerEx...) although they're natively a little off time wise.
Re: Time to PayDay -
MrTea - 24.06.2017
Quote:
Originally Posted by Abagail
First off, using global textdraws (TextDraw_) won't be unique for players if you're using the same one. You should instead use player textdraws (PlayerTextDraw_) which allows you to customize the time per player.
Secondly, how do you expect the time to magically increase on its own? You need to manually update it when you want. If you want to update per minute, you could use timers (SetTimerEx...) although they're natively a little off time wise.
|
And how a can that text draw for each player?