Textdraw only showing for ID: 0
#1

Hi, I have a speedo which I made but it only shows for ID: 0. The code below is used on OnPlayerConnect.
pawn Код:
Textdraw1[playerid] = TextDrawCreate(532.000000, 342.000000, " ");
        TextDrawBackgroundColor(Textdraw1[playerid], 255);
        TextDrawFont(Textdraw1[playerid], 2);
        TextDrawLetterSize(Textdraw1[playerid], 0.210000, 1.200000);
        TextDrawColor(Textdraw1[playerid], -1);
        TextDrawSetOutline(Textdraw1[playerid], 0);
        TextDrawSetProportional(Textdraw1[playerid], 1);
        TextDrawSetShadow(Textdraw1[playerid], 1);

        Textdraw0[playerid] = TextDrawCreate(531.000000, 331.000000, "__");
        TextDrawBackgroundColor(Textdraw0[playerid], 16777215);
        TextDrawFont(Textdraw0[playerid], 1);
        TextDrawLetterSize(Textdraw0[playerid], 0.300000, 10.000000);
        TextDrawColor(Textdraw0[playerid], 65535);
        TextDrawSetOutline(Textdraw0[playerid], 0);
        TextDrawSetProportional(Textdraw0[playerid], 1);
        TextDrawSetShadow(Textdraw0[playerid], 3);
        TextDrawUseBox(Textdraw0[playerid], 1);
        TextDrawBoxColor(Textdraw0[playerid], 85);
        TextDrawTextSize(Textdraw0[playerid], 630.000000, 0.000000);

        Textdraw2[playerid] = TextDrawCreate(532.000000, 351.000000, " ");
        TextDrawBackgroundColor(Textdraw2[playerid], 255);
        TextDrawFont(Textdraw2[playerid], 2);
        TextDrawLetterSize(Textdraw2[playerid], 0.190000, 1.200000);
        TextDrawColor(Textdraw2[playerid], -1);
        TextDrawSetOutline(Textdraw2[playerid], 0);
        TextDrawSetProportional(Textdraw2[playerid], 1);
        TextDrawSetShadow(Textdraw2[playerid], 1);

        Textdraw3[playerid] = TextDrawCreate(532.000000, 318.000000, "playeridnformation");
        TextDrawBackgroundColor(Textdraw3[playerid], 255);
        TextDrawFont(Textdraw3[playerid], 0);
        TextDrawLetterSize(Textdraw3[playerid], 0.600000, 2.000000);
        TextDrawColor(Textdraw3[playerid], -1);
        TextDrawSetOutline(Textdraw3[playerid], 0);
        TextDrawSetProportional(Textdraw3[playerid], 1);
        TextDrawSetShadow(Textdraw3[playerid], 1);

        Textdraw4[playerid] = TextDrawCreate(532.000000, 360.000000, " ");
        TextDrawBackgroundColor(Textdraw4[playerid], 255);
        TextDrawFont(Textdraw4[playerid], 2);
        TextDrawLetterSize(Textdraw4[playerid], 0.200000, 1.200000);
        TextDrawColor(Textdraw4[playerid], -1);
        TextDrawSetOutline(Textdraw4[playerid], 0);
        TextDrawSetProportional(Textdraw4[playerid], 1);
        TextDrawSetShadow(Textdraw4[playerid], 1);

        Textdraw5[playerid] = TextDrawCreate(532.000000, 369.000000, " ");
        TextDrawBackgroundColor(Textdraw5[playerid], 255);
        TextDrawFont(Textdraw5[playerid], 2);
        TextDrawLetterSize(Textdraw5[playerid], 0.159999, 1.200000);
        TextDrawColor(Textdraw5[playerid], -1);
        TextDrawSetOutline(Textdraw5[playerid], 0);
        TextDrawSetProportional(Textdraw5[playerid], 1);
        TextDrawSetShadow(Textdraw5[playerid], 1);

        Textdraw6[playerid] = TextDrawCreate(532.000000, 378.000000, "~r~Lights: ~w~Off");
        TextDrawBackgroundColor(Textdraw6[playerid], 255);
        TextDrawFont(Textdraw6[playerid], 2);
        TextDrawLetterSize(Textdraw6[playerid], 0.159998, 1.200000);
        TextDrawColor(Textdraw6[playerid], -1);
        TextDrawSetOutline(Textdraw6[playerid], 0);
        TextDrawSetProportional(Textdraw6[playerid], 1);
        TextDrawSetShadow(Textdraw6[playerid], 1);

        Textdraw7[playerid] = TextDrawCreate(532.000000, 387.000000, "~r~Engine: ~w~Off");
        TextDrawBackgroundColor(Textdraw7[playerid], 255);
        TextDrawFont(Textdraw7[playerid], 2);
        TextDrawLetterSize(Textdraw7[playerid], 0.159998, 1.200000);
        TextDrawColor(Textdraw7[playerid], -1);
        TextDrawSetOutline(Textdraw7[playerid], 0);
        TextDrawSetProportional(Textdraw7[playerid], 1);
        TextDrawSetShadow(Textdraw7[playerid], 1);

        Textdraw8[playerid] = TextDrawCreate(532.000000, 396.000000, "~r~Boot: ~w~Closed");
        TextDrawBackgroundColor(Textdraw8[playerid], 255);
        TextDrawFont(Textdraw8[playerid], 2);
        TextDrawLetterSize(Textdraw8[playerid], 0.159998, 1.200000);
        TextDrawColor(Textdraw8[playerid], -1);
        TextDrawSetOutline(Textdraw8[playerid], 0);
        TextDrawSetProportional(Textdraw8[playerid], 1);
        TextDrawSetShadow(Textdraw8[playerid], 1);

        Textdraw9[playerid] = TextDrawCreate(532.000000, 405.000000, "~r~Bonnet: ~w~Closed");
        TextDrawBackgroundColor(Textdraw9[playerid], 255);
        TextDrawFont(Textdraw9[playerid], 2);
        TextDrawLetterSize(Textdraw9[playerid], 0.159998, 1.200000);
        TextDrawColor(Textdraw9[playerid], -1);
        TextDrawSetOutline(Textdraw9[playerid], 0);
        TextDrawSetProportional(Textdraw9[playerid], 1);
        TextDrawSetShadow(Textdraw9[playerid], 1);
No idea why.
Reply
#2

Post the function where you show the textdraws.
Reply
#3

First, you should put it under OnPlayerEnterVehicle.. That way when they enter a vehicle, it shows up, not while they are and are not in a vehicle
Reply
#4

Quote:
Originally Posted by Joshb93
Посмотреть сообщение
First, you should put it under OnPlayerEnterVehicle.. That way when they enter a vehicle, it shows up, not while they are and are not in a vehicle
You have no idea how to script do you.

OnPlayerStateChange.

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
        new string[100];
        format(string, sizeof(string), "~r~Vehicle: ~w~%s", VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400]);
        TextDrawSetString(Textdraw2[playerid], string);
        TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw8[playerid]);
        TextDrawShowForPlayer(playerid, Textdraw9[playerid]);
    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw3[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw4[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw5[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw6[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw7[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw8[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw9[playerid]);
    }
Reply
#5

are you making a loop to create them?
Reply
#6

No, I have tried and still nothing.
Reply
#7

You can try this to check if the GM is not creating them.

pawn Код:
if(Textdraw0[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw0 = invalid");
if(Textdraw1[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw1 = invalid");
if(Textdraw2[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw2 = invalid");
if(Textdraw3[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw3 = invalid");
if(Textdraw4[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw4 = invalid");
if(Textdraw5[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw5 = invalid");
if(Textdraw6[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw6 = invalid");
if(Textdraw7[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw7 = invalid");
if(Textdraw8[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw8 = invalid");
if(Textdraw9[playerid] == 65535) SendClientMessage(playerid, -1, "Textdraw9 = invalid");
maybe you reach the text draw limit...
Reply
#8

Nope, I don't have any invalid textdraws or reached the limit.
Reply
#9

Quote:
Originally Posted by -Luis
Посмотреть сообщение
No, I have tried and still nothing.
You need to run the textdraw creating in a loop so it actually creates (9 * (MAX_PLAYERS)) textdraws!
Reply
#10

Well, I can't understand the [playerid]. You have the function ShowTextdraw for player, you do not need the [playerid]. Delete it, that might be the bug.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)