Time to PayDay
#1

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;
}
Reply
#2

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.
Reply
#3

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)