Disappearing textdraws :)
#1

Hello. I have one small problem. After some time of server work my texdraws disappear or shows there, where they should not appear.
Some info:
Textdraws created at player connect(Texdraws for certain player).
Textdraws destroyed at player disconnect(Texdraws for certain player).

Is anyone have some similar problem? Can someone give me any suggestions?
Reply
#2

Give me texdraw code
Reply
#3

pawn Код:
pInfo[playerid][SpecText] = TextDrawCreate(5.000000,309.000000,"Spectating: ~r~------------------------");
    TextDrawAlignment(pInfo[playerid][SpecText],1);
    TextDrawBackgroundColor(pInfo[playerid][SpecText],0x000000ff);
    TextDrawFont(pInfo[playerid][SpecText],2);
    TextDrawLetterSize(pInfo[playerid][SpecText],0.199999,1.300000);
    TextDrawColor(pInfo[playerid][SpecText],0xffffffff);
    TextDrawSetOutline(pInfo[playerid][SpecText],1);
    TextDrawSetProportional(pInfo[playerid][SpecText],1);
    TextDrawSetShadow(pInfo[playerid][SpecText],1);
    //==================================================//
    pInfo[playerid][PocketStatus] = TextDrawCreate(608.000000,104.000000,"Package: 100");
    TextDrawAlignment(pInfo[playerid][PocketStatus],3);
    TextDrawBackgroundColor(pInfo[playerid][PocketStatus],0x000000ff);
    TextDrawLetterSize(pInfo[playerid][PocketStatus],0.499999,1.200000);
    TextDrawFont(pInfo[playerid][PocketStatus],1);
    TextDrawColor(pInfo[playerid][PocketStatus],0x00ff00cc);
    TextDrawSetOutline(pInfo[playerid][PocketStatus],1);
    TextDrawSetProportional(pInfo[playerid][PocketStatus],1);
    TextDrawSetShadow(pInfo[playerid][PocketStatus],1);
   
    pInfo[playerid][PocketTime] = TextDrawCreate(608.000000,119.000000,"Time: 00:00");
    TextDrawAlignment(pInfo[playerid][PocketTime],3);
    TextDrawBackgroundColor(pInfo[playerid][PocketTime],0x000000ff);
    TextDrawFont(pInfo[playerid][PocketTime],2);
    TextDrawLetterSize(pInfo[playerid][PocketTime],0.399999,1.700000);
    TextDrawColor(pInfo[playerid][PocketTime],0xffff00cc);
    TextDrawSetOutline(pInfo[playerid][PocketTime],1);
    TextDrawSetProportional(pInfo[playerid][PocketTime],1);
    TextDrawSetShadow(pInfo[playerid][PocketTime],1);
   
    pInfo[playerid][PocketPayment] = TextDrawCreate(605.000000,141.000000,"0$");
    TextDrawAlignment(pInfo[playerid][PocketPayment],3);
    TextDrawBackgroundColor(pInfo[playerid][PocketPayment],0x000000ff);
    TextDrawFont(pInfo[playerid][PocketPayment],3);
    TextDrawLetterSize(pInfo[playerid][PocketPayment],0.399999,1.400000);
    TextDrawColor(pInfo[playerid][PocketPayment],0x00ffffcc);
    TextDrawSetOutline(pInfo[playerid][PocketPayment],1);
    TextDrawSetProportional(pInfo[playerid][PocketPayment],1);
    TextDrawSetShadow(pInfo[playerid][PocketPayment],1);
Here are some textdraws NOT ALL!
I have 8 textdraws for every player, and 7 global textdraws for all players.
Reply
#4

Maybe you will create a timer in order to disappear texdraw after time

after
OnGameModeExit()

Quote:

TextDrawHideForAll(your texdraw name);
TextDrawDestroy(your texdraw name);

Reply
#5

Text draw functions must be under each other like this:

TextDrawAlignment(pInfo[playerid][PocketStatus],3);
TextDrawAlignment(pInfo[playerid][PocketTime],3);

atc.
Reply
#6

Quote:
Originally Posted by AivaMan
Text draw functions must be under each other like this:

TextDrawAlignment(pInfo[playerid][PocketStatus],3);
TextDrawAlignment(pInfo[playerid][PocketTime],3);

atc.
....


no they don't...


...


This is a known bug, you should probably have explained it better. under OnGameModeInit add:
pawn Код:
public OnGameModeInit()
{
  new Text:null = TextDrawCreate(0.0,0.0,"");
  //Your code
}
What's happening is that on a GMX(game mode restart) for one reason or another the first text draw isn't being created or is destroyed. Not sure why.
Reply
#7

My "gmx" is not simple "gmx" it shut downs server and after ~1 minute server is online again(Linux VPS, server restarter). I do "exit" because of bugged mysql memory usage, so after shutdown RAM frees.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)