SA-MP Forums Archive
Textdraws changing, why? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraws changing, why? (/showthread.php?tid=145753)



Textdraws changing, why? - Justsmile - 03.05.2010

Hey there,

i have a problem with the textdraws in my script, sometime they are changing. Text A ist over text B and so on.
Code is perfectly right, some else a solution?


Re: Textdraws changing, why? - -Rebel Son- - 03.05.2010

Do you have multiple textdraws connected to one string? post your code.



Re: Textdraws changing, why? - Justsmile - 03.05.2010

ok, here are the codes
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]);



Re: Textdraws changing, why? - -Rebel Son- - 03.05.2010

Код:
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©,"%d:0%d", time[0], time[1]);
    TextDrawSetString(clock, c);
  }
  else
  {
  format(c, sizeof©,"%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);
}
btw is this a clock?


Re: Textdraws changing, why? - Justsmile - 03.05.2010

No, one PayDay text, clock text, and servername text,