Hello I want to ask for your help cuz I have really big problems with my textdraws. Everytime I connect to game my first textdraw is bugging I tried to replace all my textdraws when player connect but its not working. I changed all my textdraws names too cuz I was thinking that it can be from same textdraws name but its not. Only my first textdraw disappear and its showing after I spawn.
Textdraw IDs start with 0. Newly created arrays and variables are also filled with 0.
Maybe you hide textdraw which is not created yet. You may try to fill all textdraw variables with some invalid value (65535) before you create any TD or simply search for part of code which hides textdraw #0
Textdraw0 = TopMenu this is the name of my first textdraw and everything was perfect it just bugged I don't know why when I change it with BotMenu it will disappear and TopMenu will work as its second. I know how to fix it but I want to know why this is bugging.
P.S If you have this problem just create empty textdraw and it will hide something that we don't use.
PHP код:
stock LoadLoginTextdraws()
{
Empty = TextDrawCreate(816.000000, -121.000000, " ");
TextDrawSetSelectable(Empty, 0);
TopBox = TextDrawCreate(816.000000, -121.000000, "_");
TextDrawBackgroundColor(TopBox, 255);
TextDrawFont(TopBox, 1);
TextDrawLetterSize(TopBox, 0.409999, 27.400001);
TextDrawColor(TopBox, -1);
TextDrawSetOutline(TopBox, 0);
TextDrawSetProportional(TopBox, 1);
TextDrawSetShadow(TopBox, 1);
TextDrawUseBox(TopBox, 1);
TextDrawBoxColor(TopBox, 255);
TextDrawTextSize(TopBox, -129.000000, 60.000000);
TextDrawSetSelectable(TopBox, 0);
BotBox = TextDrawCreate(816.000000, 350.000000, "_");
TextDrawBackgroundColor(BotBox, 255);
TextDrawFont(BotBox, 1);
TextDrawLetterSize(BotBox, 0.409999, 27.400001);
TextDrawColor(BotBox, 255);
TextDrawSetOutline(BotBox, 0);
TextDrawSetProportional(BotBox, 1);
TextDrawSetShadow(BotBox, 1);
TextDrawUseBox(BotBox, 1);
TextDrawBoxColor(BotBox, 255);
TextDrawTextSize(BotBox, -129.000000, 60.000000);
TextDrawSetSelectable(BotBox, 0);
TopLine = TextDrawCreate(730.000000, 130.000000, "_");
TextDrawBackgroundColor(TopLine, 255);
TextDrawFont(TopLine, 1);
TextDrawLetterSize(TopLine, 0.529999, 0.599999);
TextDrawColor(TopLine, -1);
TextDrawSetOutline(TopLine, 0);
TextDrawSetProportional(TopLine, 1);
TextDrawSetShadow(TopLine, 1);
TextDrawUseBox(TopLine, 1);
TextDrawBoxColor(TopLine, 226554568);
TextDrawTextSize(TopLine, -205.000000, 0.000000);
TextDrawSetSelectable(TopLine, 0);
BotLine = TextDrawCreate(730.000000, 340.000000, "_");
TextDrawBackgroundColor(BotLine, 255);
TextDrawFont(BotLine, 1);
TextDrawLetterSize(BotLine, 0.529999, 0.599999);
TextDrawColor(BotLine, -1);
TextDrawSetOutline(BotLine, 0);
TextDrawSetProportional(BotLine, 1);
TextDrawSetShadow(BotLine, 1);
TextDrawUseBox(BotLine, 1);
TextDrawBoxColor(BotLine, 226554568);
TextDrawTextSize(BotLine, -205.000000, 0.000000);
TextDrawSetSelectable(BotLine, 0);
ServerCreator = TextDrawCreate(225.000000, 102.000000, "OT: FeRRum[Scripter]");
TextDrawBackgroundColor(ServerCreator, 255);
TextDrawFont(ServerCreator, 1);
TextDrawLetterSize(ServerCreator, 0.500000, 1.000000);
TextDrawColor(ServerCreator, -16776961);
TextDrawSetOutline(ServerCreator, 0);
TextDrawSetProportional(ServerCreator, 1);
TextDrawSetShadow(ServerCreator, 1);
TextDrawSetSelectable(ServerCreator, 0);
ServerName = TextDrawCreate(97.000000, 35.000000, "BG] Black Bull Drift Gaming ]0.3.7");
TextDrawBackgroundColor(ServerName, 255);
TextDrawFont(ServerName, 2);
TextDrawLetterSize(ServerName, 0.600000, 4.000000);
TextDrawColor(ServerName, -1);
TextDrawSetOutline(ServerName, 1);
TextDrawSetProportional(ServerName, 1);
TextDrawSetSelectable(ServerName, 0);
ServerStars = TextDrawCreate(198.000000, 80.000000, "]]]]]]]]]]]]]]");
TextDrawBackgroundColor(ServerStars, 255);
TextDrawFont(ServerStars, 2);
TextDrawLetterSize(ServerStars, 0.500000, 1.000000);
TextDrawColor(ServerStars, 16711935);
TextDrawSetOutline(ServerStars, 0);
TextDrawSetProportional(ServerStars, 1);
TextDrawSetShadow(ServerStars, 1);
TextDrawSetSelectable(ServerStars, 0);
ServerWeb = TextDrawCreate(239.000000, 375.000000, "BB-GAMING.eu");
TextDrawBackgroundColor(ServerWeb, 255);
TextDrawFont(ServerWeb, 2);
TextDrawLetterSize(ServerWeb, 0.500000, 3.099998);
TextDrawColor(ServerWeb, 1009505736);
TextDrawSetOutline(ServerWeb, 1);
TextDrawSetProportional(ServerWeb, 1);
TextDrawSetSelectable(ServerWeb, 0);
return 1;
}
stock ShowLoginTextdraws(playerid)
{
TextDrawShowForPlayer(playerid, TopBox);
TextDrawShowForPlayer(playerid, BotBox);
TextDrawShowForPlayer(playerid, TopLine);
TextDrawShowForPlayer(playerid, BotLine);
TextDrawShowForPlayer(playerid, ServerCreator);
TextDrawShowForPlayer(playerid, ServerName);
TextDrawShowForPlayer(playerid, ServerStars);
TextDrawShowForPlayer(playerid, ServerWeb);
return 1;
}
stock HideLoginTextdraws(playerid)
{
TextDrawHideForPlayer(playerid, TopBox);
TextDrawHideForPlayer(playerid, BotBox);
TextDrawHideForPlayer(playerid, TopLine);
TextDrawHideForPlayer(playerid, BotLine);
TextDrawHideForPlayer(playerid, ServerCreator);
TextDrawHideForPlayer(playerid, ServerName);
TextDrawHideForPlayer(playerid, ServerStars);
TextDrawHideForPlayer(playerid, ServerWeb);
return 1;
}
stock DestroyLoginTextdraws()
{
TextDrawDestroy(TopBox);
TextDrawDestroy(BotBox);
TextDrawDestroy(TopLine);
TextDrawDestroy(BotLine);
TextDrawDestroy(ServerCreator);
TextDrawDestroy(ServerName);
TextDrawDestroy(ServerStars);
TextDrawDestroy(ServerWeb);
return 1;
}
This my code and I'm using name TopBox I'm not using another TopBox and its only bug my first textdraw. For that I created empty textdraw. I'm using this stocks under OnGameModeInit, OnGameModeExit, OnPlayerConnect