18.07.2012, 01:22
I'v never worked with textdraws, and used Zamaroht's editor to try and hide the HUD features.
They won't show.
I use this function to toggle them.
and I'm trying to show it on a 1 sec delay timer on OnPlayerConnect.
Server console prints
They also worked fine using the Textdraw editor.
They won't show.
pawn Code:
new
Text:MainMenu[2];
forward TextDrawsInit();
public TextDrawsInit()
{
/* Bottom Bar */
MainMenu[0] = TextDrawCreate(250.000000, 343.000000, "~n~~n~~n~~n~~n~BottomHalf");
TextDrawAlignment(MainMenu[0], 2);
TextDrawBackgroundColor(MainMenu[0], 255);
TextDrawFont(MainMenu[0], 1);
TextDrawLetterSize(MainMenu[0], 1.000000, 2.000000);
TextDrawColor(MainMenu[0], 255);
TextDrawSetOutline(MainMenu[0], 1);
TextDrawSetProportional(MainMenu[0], 1);
TextDrawUseBox(MainMenu[0], 1);
TextDrawBoxColor(MainMenu[0], 255);
TextDrawTextSize(MainMenu[0], 90.000000, 803.000000);
/* Top Bar */
MainMenu[1] = TextDrawCreate(250.000000, -8.000000, "~n~~n~~n~~n~~n~TopHalf");
TextDrawAlignment(MainMenu[1], 2);
TextDrawBackgroundColor(MainMenu[1], 255);
TextDrawFont(MainMenu[1], 1);
TextDrawLetterSize(MainMenu[1], 1.000000, 2.000000);
TextDrawColor(MainMenu[1], 255);
TextDrawSetOutline(MainMenu[1], 1);
TextDrawSetProportional(MainMenu[1], 1);
TextDrawUseBox(MainMenu[1], 1);
TextDrawBoxColor(MainMenu[1], 255);
TextDrawTextSize(MainMenu[1], 90.000000, 803.000000);
return 1;
}
pawn Code:
stock TogglePlayerMainMenu(playerid, toggle = 0)
{
if(toggle) {
TextDrawShowForPlayer(playerid, MainMenu[0]);
TextDrawShowForPlayer(playerid, MainMenu[1]);
}
else {
TextDrawHideForPlayer(playerid, MainMenu[0]);
TextDrawHideForPlayer(playerid, MainMenu[1]);
}
printf("MainMenu for player has been toggled: %d", toggle);
return 1;
}
pawn Code:
public OnPlayerConnect(playerid)
{
SetTimerEx("OnPlayerConnectEx", 1000, false, "d", playerid);
return 1;
}
forward OnPlayerConnectEx(playerid);
public OnPlayerConnectEx(playerid)
{
TogglePlayerMainMenu(playerid, 1);
return 1;
}
Code:
[17:49:11] MainMenu for player has been toggled: 1