SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/07/2012, 01:22 AM   #1
ReneG
High-roller
 
Join Date: Oct 2011
Location: Sublime Text 2
Posts: 1,906
Reputation: 337
Default TextDraws won't show

I'v never worked with textdraws, and used Zamaroht's editor to try and hide the HUD features.

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;
}

I use this function to toggle them.
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;
}

and I'm trying to show it on a 1 sec delay timer on OnPlayerConnect.
pawn Code:
public OnPlayerConnect(playerid)
{
    SetTimerEx("OnPlayerConnectEx", 1000, false, "d", playerid);
    return 1;
}

forward OnPlayerConnectEx(playerid);
public OnPlayerConnectEx(playerid)
{
    TogglePlayerMainMenu(playerid, 1);
    return 1;
}

Server console prints
Code:
[17:49:11] MainMenu for player has been toggled: 1
They also worked fine using the Textdraw editor.
ReneG is offline   Reply With Quote
Old 18/07/2012, 01:25 AM   #2
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: TextDraws won't show

Where TextDrawsInit is called?
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Old 18/07/2012, 01:31 AM   #3
ReneG
High-roller
 
Join Date: Oct 2011
Location: Sublime Text 2
Posts: 1,906
Reputation: 337
Default Re: TextDraws won't show



Forgot to call TextDrawsInit() when the gamemode loads. Thank you Viniborn.
ReneG is offline   Reply With Quote
Old 18/07/2012, 01:34 AM   #4
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: TextDraws won't show

This happens sometimes : D


Good luck
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Textdraws dont show in the game? Spooky Scripting Help 5 24/01/2012 12:16 PM
Help With TextDraws (Show one whene player Die) ServerScripter Scripting Help 4 09/10/2011 01:06 PM
Textdraws won't show IllidanS46 Help Archive 2 12/08/2011 11:41 PM
Textdraws wont show -_- willsuckformoney Help Archive 6 26/07/2010 04:19 AM
Max textdraws to show at once Dujma Help Archive 0 15/03/2009 11:08 AM


All times are GMT. The time now is 11:33 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.