SA-MP Forums Archive
Textdraw not showing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw not showing (/showthread.php?tid=508326)



Textdraw not showing - Lajko1 - 21.04.2014

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


Re: Textdraw not showing - Lajko1 - 21.04.2014

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?


Re: Textdraw not showing - ChuckyBabe - 22.04.2014

define it at the top of your script


Re: Textdraw not showing - UnknownOwner - 22.04.2014

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

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


Re: Textdraw not showing - JeaSon - 22.04.2014

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



Re: Textdraw not showing - Flake. - 22.04.2014

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




Re: Textdraw not showing - Lajko1 - 22.04.2014

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?


Re: Textdraw not showing - Lajko1 - 22.04.2014

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.


Re: Textdraw not showing - Lajko1 - 23.04.2014

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?


Re: Textdraw not showing - Lajko1 - 24.04.2014

Bump