Textdraw not showing
#1

Code:

pawn Код:
else if(strcmp(x_nr,"heroin",true) == 0)
        {
            new Float:Health;
            GetPlayerHealth(playerid, Health);

            new Float:Armour;
            GetPlayerArmour(playerid, Armour);
           
            if(Pdrug[playerid][Needle] >= 1)
            {
                if(Pdrug[playerid][Heroin] >= 1)
                {
                    if(Pdrug[playerid][Addiction] >= 30)
                    {
                        Pdrug[playerid][Addiction] = 0;
                        Pdrug[playerid][AddictionLv] += 1;
                        SendClientMessage(playerid, -1, "{FFFFFF}Your addiction level has raised, write /addiction to read about drug addiciton levels.");
                    }
                    Pdrug[playerid][Heroin] -= 1;
                    Pdrug[playerid][Addiction] += 10;
                    SetPlayerDrunkLevel (playerid, 50000);
                    SetPlayerWeather(playerid, 9); // foggy - cold..
                    SendClientMessage(playerid, -1, "{FFFFFF}You've used 1 gram of heroin your health points decreased by -40 and armour points raised by +25.");
                    TextDrawShowForPlayer(playerid,Text:Textdraw0);
That textdraw:

TextDrawShowForPlayer(playerid,Text:Textdraw0);

Won't show up when I write the cmd
Reply
#2

Forgot to mention this is my textdraw I want to see on screen:

pawn Код:
Textdraw0 = TextDrawCreate(1.000000,1.000000,".");
    TextDrawUseBox(Textdraw0,1);
    TextDrawBoxColor(Textdraw0,0x00000099);
    TextDrawTextSize(Textdraw0,639.000000,-17.000000);
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x00000000);
    TextDrawFont(Textdraw0,3);
    TextDrawLetterSize(Textdraw0,1.000000,49.499919);
    TextDrawColor(Textdraw0,0x00000000);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
It's only "." and big black box to cover whole player's screen.. but text draw won't be shown, Why?
Reply
#3

define it at the top of your script
Reply
#4

Add
PHP код:
new Textdraw0
on top of the script.

Then add:
Код:
TextDrawShowForPlayer(playerid, Textdraw0);
Wherever u want to make the textdraw visible...
Reply
#5

if you wanted to use this line as textdraw
pawn Код:
"{FFFFFF}You've used 1 gram of heroin your health points decreased by -40 and armour points raised by +25."
then use this code blow

pawn Код:
else if(strcmp(x_nr,"heroin",true) == 0)
        {
            new Float:Health;
            GetPlayerHealth(playerid, Health);

            new Float:Armour;
            GetPlayerArmour(playerid, Armour);
           
            if(Pdrug[playerid][Needle] >= 1)
            {
                if(Pdrug[playerid][Heroin] >= 1)
                {
                    if(Pdrug[playerid][Addiction] >= 30)
                    {
                        Pdrug[playerid][Addiction] = 0;
                        Pdrug[playerid][AddictionLv] += 1;
                        SendClientMessage(playerid, -1, "{FFFFFF}Your addiction level has raised, write /addiction to read about drug addiciton levels.");
                    }
                    new str[128];
                    Pdrug[playerid][Heroin] -= 1;
                    Pdrug[playerid][Addiction] += 10;
                    SetPlayerDrunkLevel (playerid, 50000);
                    SetPlayerWeather(playerid, 9); // foggy - cold..
                    format(str, sizeof(str), "{FFFFFF}You've used 1 gram of heroin your health points decreased b -40 and armour points raised by +25.");
                    SendClientMessage(playerid, -1, str);
                    TextDrawShowSetString(Textdraw0,str);
                    TextDrawShowForPlayer(playerid,Textdraw0);
this should be at top of your script

pawn Код:
new Text:Textdraw0;
and
this should be under ongamemodeinit()
pawn Код:
Textdraw0 = TextDrawCreate(1.000000,1.000000,".");
    TextDrawUseBox(Textdraw0,1);
    TextDrawBoxColor(Textdraw0,0x00000099);
    TextDrawTextSize(Textdraw0,639.000000,-17.000000);
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x00000000);
    TextDrawFont(Textdraw0,3);
    TextDrawLetterSize(Textdraw0,1.000000,49.499919);
    TextDrawColor(Textdraw0,0x00000000);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
Reply
#6

Your textdraw0 is just a little "." and it's at 1,1 it'll be off the screen that's why.

Reply
#7

Okay I put textdraw in top left corner added background box to it and resize it until it covered whole my screen, how can be textdraw out of my screen if I see how I made it? What should I do then?
Reply
#8

I was trying and trying and can't fix this, text draw isn't shown, can someone make that textdraw for me? Simple textdraw that will cover whole screen with black black box but players would be still able to see things IG - not to much dark.
Reply
#9

Anyone please? I still can't fix this and I tried a lot of things and I still can't figure out why my textdraw isn't shown? Can someone help?
Reply
#10

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)