SA-MP Forums Archive
textdraws - 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: textdraws (/showthread.php?tid=502111)



textdraws - aboa - 22.03.2014

I have a problem in my script with textdraws so I can't see any textdraw so what's the problem?


Re: textdraws - Hanuman - 22.03.2014

lol, give us some codes, like wher u create ur textdraw, codes of textdraw, coordinates of texdraw.


Re: textdraws - Equuuuin0X - 22.03.2014

Give us your textdraw codes.

Also, are you sure that your coordinates is at the right place ?

I'll give you example

pawn Код:
public OnGameModeInit()
{                                                                                                                                  
   This is your textdraw's name > ForumURL = TextDrawCreate(550.000000, 440.000000, "<< COD TDM >>"); //COD TDM is the text of the textdraw
    TextDrawBackgroundColor(ForumURL, 255);
    TextDrawFont(ForumURL, 2);
    TextDrawLetterSize(ForumURL, 0.280000, 1.399999);
    TextDrawColor(ForumURL, 3394815);
    TextDrawSetOutline(ForumURL, 1);
    TextDrawSetProportional(ForumURL, 1);

    CODTDM = TextDrawCreate(550.000000, 313.000000, "/stats /cmds /ghelp");
    TextDrawBackgroundColor(CODTDM, 255);
    TextDrawFont(CODTDM, 2);
    TextDrawLetterSize(CODTDM, 0.280000, 1.399999);
    TextDrawColor(CODTDM, 3394815);
    TextDrawSetOutline(CODTDM, 1);
    TextDrawSetProportional(CODTDM, 1);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, ForumURL); < To show the textdraw
    TextDrawShowForPlayer(playerid, CODTDM); < same
}
https://sampwiki.blast.hk/wroot/images2/...xtdraw_map.png

the X coordinates must be set below 640. the Y coordinates must be set below 480.


Re: textdraws - aboa - 22.03.2014

pawn Код:
public OnGameModeInit()
{
        TimeTD = TextDrawCreate(630.000000,428.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TimeTD);
}



Re: textdraws - Equuuuin0X - 22.03.2014

pawn Код:
public OnGameModeInit()
{
    TimeTD = TextDrawCreate(630.000000,428.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TimeTD);
    TimeTD = TextDrawCreate(630.000000,428.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}
Try it, it'll work.


Re: textdraws - Hanuman - 22.03.2014

No, It won't work. And why u have created 2 textdraw? Try this! Your coordinates is the problem try to less them. I have done it for u.

Код:
public OnGameModeInit()
{
        TimeTD = TextDrawCreate(500.000000,415.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TimeTD);
}



Re: textdraws - Equuuuin0X - 22.03.2014

Double textdraw creation is to make sure the textdraw will be created.

your post doesnt make sense, tbh.


Re: textdraws - aboa - 22.03.2014

not working for me ;(


Re: textdraws - Equuuuin0X - 22.03.2014

Oh, I know the problem.

pawn Код:
public OnGameModeInit()
{
    TimeTD = TextDrawCreate(630.000000,428.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, TimeTD);
    TimeTD = TextDrawCreate(630.000000,428.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}
This will work, change the OnPlayerConnect to OnPlayerSpawn.


Re: textdraws - Avi Raj - 22.03.2014

Why would you create 2 times text draws?
And can you show how you defined TimeTD.


Re: textdraws - Hanuman - 22.03.2014

Код:
new Text:TimeTD;
public OnGameModeInit()
{
        TimeTD = TextDrawCreate(500.000000,415.000000,"Time");
    TextDrawFont(TimeTD,3);
    TextDrawSetShadow(TimeTD,0);
    TextDrawSetOutline(TimeTD,1);
    TextDrawAlignment(TimeTD,3);
    TextDrawLetterSize(TimeTD,0.399999,1.500000);
    TextDrawColor(TimeTD,COLOR_RED);
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TimeTD);
}
Define the Textdraw like that and paste these codes!


Re: textdraws - Equuuuin0X - 22.03.2014

pawn Код:
new Text:TimeTD;
Set the textdraw on OnPlayerSpawn, so that it'll be created when player spawns, not when player connects.


Re: textdraws - Avi Raj - 22.03.2014

If you are using more than one textdraw then post here.


Re: textdraws - Equuuuin0X - 22.03.2014

also, dont forget, you cannot mix 2 textdraws in ONE coordinates.


Re: textdraws - vassilis - 22.03.2014

Quote:
Originally Posted by Equuuuin0X
Посмотреть сообщение
Double textdraw creation is to make sure the textdraw will be created.

your post doesnt make sense, tbh.
Seriously making 2 textdraws just to confirm that it is created... *facepalm*