textdraws
#1

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

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

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.
Reply
#4

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);
}
Reply
#5

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.
Reply
#6

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);
}
Reply
#7

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

your post doesnt make sense, tbh.
Reply
#8

not working for me ;(
Reply
#9

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.
Reply
#10

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

Код:
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!
Reply
#12

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

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

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

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*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)