TextDrawShow/Hide are under OnPlayerSpawn/OnPlayerDisconnect TextDrawDestroy for paydaytext
pawn Код:
new Text:server;
new Text: clock;
OnGameModeInit
server = TextDrawCreate(498,9,"Projekt Sunset RP");
TextDrawFont(server,0);
TextDrawColor(server,0xFFFFFFFF);
TextDrawBackgroundColor(server,0x000000FF);
TextDrawUseBox(server,0);
TextDrawSetShadow(server,1);
new time_now[3], time[128];
gettime(time_now[0], time_now[1], time_now[2]);
format(time, sizeof(time), "%d:%d",time_now[0], time_now[1]);
clock = TextDrawCreate(547.000000, 22.000000, time);
TextDrawAlignment(clock, 0);
TextDrawBackgroundColor(clock, 0x000000ff);
TextDrawFont(clock, 3);
TextDrawLetterSize(clock, 0.599999, 1.900000);
TextDrawColor(clock, 0xffffffff);
TextDrawSetOutline(clock, 1);
TextDrawSetProportional(clock, 1);
TextDrawSetShadow(clock, 1);
timer
new time[3], c[30], test[50];
gettime(time[0], time[1], time[2]);
if(time[1] < 10)
{
format(c, sizeof(c),"%d:0%d", time[0], time[1]);
TextDrawSetString(clock, c);
}
else
{
format(c, sizeof(c),"%d:%d",time[0], time[1]);
TextDrawSetString(clock, c);
}
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][pDonateRank] > 1)
{
format(test, sizeof(test), "~r~PayDay Zeit: ~w~%d/50",PlayerInfo[i][pPayDayTime]);
TextDrawSetString(paydaytext[i], test);
}
else
{
format(test, sizeof(test), "~r~PayDay Zeit: ~w~%d/60",PlayerInfo[i][pPayDayTime]);
TextDrawSetString(paydaytext[i], test);
}
OnPlayerSpawn
new payday[50], maxp;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
maxp = 50;
}
else maxp = 60;
format(payday, sizeof(payday), "~r~PayDay Zeit~w~ %d/%d",PlayerInfo[playerid][pPayDayTime], maxp);
paydaytext[playerid] = TextDrawCreate(454,425, payday);
//TextDrawFont(paydaytext[playerid],3);
TextDrawAlignment(paydaytext[playerid], 0);
TextDrawBackgroundColor(paydaytext[playerid], 0x000000ff);
TextDrawFont(paydaytext[playerid], 3);
//TextDrawLetterSize(clock, 0.599999, 1.900000);
//TextDrawColor(paydaytext[playerid], COLOR_RED);
TextDrawSetOutline(paydaytext[playerid], 1);
TextDrawSetProportional(paydaytext[playerid], 1);
TextDrawSetShadow(paydaytext[playerid], 1);
TextDrawShowForPlayer(playerid, paydaytext[playerid]);