What's the problem with this? :|
#1

I made a textdraws, that shows your stats, and stuff.. but it only seems to work with ID 0..

On top:
pawn Код:
new Text:tBarra[6][MAX_PLAYERS];
OnGameModeExit:
pawn Код:
for(new x = 0; x < 6; x++)
{
    foreach(Player, i)
    {
        TextDrawDestroy(tBarra[x][i]);
    }
}
OnPlayerConnect:
pawn Код:
//Barra abajo
tBarra[0][playerid] = TextDrawCreate(149.000000, 427.000000, "Clase:");
tBarra[1][playerid] = TextDrawCreate(539.000000, 427.000000, "Score:");
tBarra[2][playerid] = TextDrawCreate(262.000000, 427.000000, "Rango:");
tBarra[3][playerid] = TextDrawCreate(447.000000, 427.000000, "Muertes:");
tBarra[4][playerid] = TextDrawCreate(345.000000, 427.000000, "Matados:");
tBarra[5][playerid] = TextDrawCreate(3.000000, 427.000000, "Equipo:");
for(new x = 0; x < 6; x++)
{
    TextDrawFont(tBarra[x][playerid], 1);
    TextDrawLetterSize(tBarra[x][playerid], 0.350000, 1.400000);
    TextDrawColor(tBarra[x][playerid], COLOR_WHITE);
    TextDrawSetOutline(tBarra[x][playerid], 1);
}
for(new x = 0; x < 6; x++) TextDrawShowForPlayer(playerid, tBarra[x][playerid]);
OnPlayerDisconnect:
pawn Код:
for(new x = 0; x < 6; x++) TextDrawDestroy(tBarra[x][playerid]);
Thats it.. I don't see anything wrong...
Thanks.
Reply
#2

playerid needs to be infront of the var.
Код:
tBarra[playerid][5]
Reply
#3

Quote:
Originally Posted by ScottCFR
Посмотреть сообщение
playerid needs to be infront of the var.
Код:
tBarra[playerid][5]
I didn't know about it, so, why?
Reply
#4

Because, it needs to identify before it reads any other vars I think. Someone correct me if I'm wrong.
Reply
#5

You don't need most of those loops. There is a function called TextDrawHideForAll. Of course, they don't have the same functions, but I believe there is no reason to destroy OnGameModeExit.
Reply
#6

Quote:
Originally Posted by The Toni
Посмотреть сообщение
You don't need most of those loops. There is a function called TextDrawHideForAll. Of course, they don't have the same functions, but I believe there is no reason to destroy OnGameModeExit.
I don't need to hide it to anyone :P

Secondly, maybe OnGameModeExit is there for nothing.. :P

Thanks to others, I will try like ScottCFR
Reply
#7

Mhh.. nope, still not working, I changed the var to tBarra[MAX_PLAYERS][6] and still the same, only showing to ID 0 :S
Reply
#8

hmm, so u did
new tBarra[MAX_PLAYERS][6]

and tBarra[playerid][5] for example
Reply
#9

I change the variable to new tBarra[MAX_PLAYERS][6]...
Reply
#10

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
hmm, so u did
new tBarra[MAX_PLAYERS][6]

and tBarra[playerid][5] for example
There are 6 textdraws, and 0 counts like 1... thats not the problem..

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)