Textdraw Updating Failure.
#1

When a player joins, it shows the Join message for the first connection, however after that
No message is displayed. Only if Connections = 0.

Top of Script:
pawn Код:
new Text:JoinMsg[4];
new Connections;
GameModeInit
pawn Код:
Connections = 0;
OnPlayerConnect
pawn Код:
new joinstr[70];
    format(joinstr, sizeof joinstr, "~w~(~r~%i~w~)~r~%s ~w~has ~g~joined ~w~the server.", playerid, pName(playerid));
    Display_JoinMsg(joinstr);
OnPlayerSpawn
pawn Код:
TextDrawShowForPlayer(playerid, JoinMsg[0]);
    TextDrawShowForPlayer(playerid, JoinMsg[1]);
    TextDrawShowForPlayer(playerid, JoinMsg[2]);
    TextDrawShowForPlayer(playerid, JoinMsg[3]);
Textdraws
pawn Код:
JoinMsg[0] = TextDrawCreate(456.500000, 350.933349, "");
    TextDrawLetterSize(JoinMsg[0], 0.165388, 1.556442);
    TextDrawAlignment(JoinMsg[0], 1);
    TextDrawColor(JoinMsg[0], -1);
    TextDrawSetShadow(JoinMsg[0], 0);
    TextDrawSetOutline(JoinMsg[0], 1);
    TextDrawBackgroundColor(JoinMsg[0], 51);
    TextDrawFont(JoinMsg[0], 1);
    TextDrawSetProportional(JoinMsg[0], 1);

    JoinMsg[1] = TextDrawCreate(456.500000, 336.622222, "");
    TextDrawLetterSize(JoinMsg[1], 0.165388, 1.556442);
    TextDrawAlignment(JoinMsg[1], 1);
    TextDrawColor(JoinMsg[1], -1);
    TextDrawSetShadow(JoinMsg[1], 0);
    TextDrawSetOutline(JoinMsg[1], 1);
    TextDrawBackgroundColor(JoinMsg[1], 51);
    TextDrawFont(JoinMsg[1], 1);
    TextDrawSetProportional(JoinMsg[1], 1);

    JoinMsg[2] = TextDrawCreate(456.500000, 322.311126, "");
    TextDrawLetterSize(JoinMsg[2], 0.165388, 1.556442);
    TextDrawAlignment(JoinMsg[2], 1);
    TextDrawColor(JoinMsg[2], -1);
    TextDrawSetShadow(JoinMsg[2], 0);
    TextDrawSetOutline(JoinMsg[2], 1);
    TextDrawBackgroundColor(JoinMsg[2], 51);
    TextDrawFont(JoinMsg[2], 1);
    TextDrawSetProportional(JoinMsg[2], 1);

    JoinMsg[3] = TextDrawCreate(456.000000, 308.000000, "");
    TextDrawLetterSize(JoinMsg[3], 0.165388, 1.556442);
    TextDrawAlignment(JoinMsg[3], 1);
    TextDrawColor(JoinMsg[3], -1);
    TextDrawSetShadow(JoinMsg[3], 0);
    TextDrawSetOutline(JoinMsg[3], 1);
    TextDrawBackgroundColor(JoinMsg[3], 51);
    TextDrawFont(JoinMsg[3], 1);
    TextDrawSetProportional(JoinMsg[3], 1);
Bottom of Script:
pawn Код:
stock Display_JoinMsg(string[])
{
    switch(Connections) {
        case 0: TextDrawSetString(JoinMsg[3], string);
        case 1: TextDrawSetString(JoinMsg[2], string);
        case 2: TextDrawSetString(JoinMsg[1], string);
        case 3: TextDrawSetString(JoinMsg[0], string);
    }
    return 1;
}
Reply
#2

I think you're setting them before making/showing them, Make sure you're making them first, then showing them, then setting their new string,

Also try to show them anywhere to make sure they're already shown and in the correct position, their coordination might be incorrect too.
Reply
#3

Still only the first Player Joinning textdraw is updated.
Reply
#4

First of all i think you should TextDrawShowForAll because the textdraw will be shown only to id 0??
Reply
#5

I fixed it, I'm not sure what was wrong.
The way I fixed it was re-writting all the code and re-creating the textdraws.
So somewhere I had a massive error, Also it wasn't even showing for ID 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)