SA-MP Forums Archive
What's the problem with this? :| - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's the problem with this? :| (/showthread.php?tid=178599)



What's the problem with this? :| - The_Moddler - 22.09.2010

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.


Re: What's the problem with this? :| - ScottCFR - 22.09.2010

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



Respuesta: Re: What's the problem with this? :| - MrDeath537 - 22.09.2010

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


Re: What's the problem with this? :| - ScottCFR - 23.09.2010

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


Re: What's the problem with this? :| - Toni - 23.09.2010

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.


Re: What's the problem with this? :| - The_Moddler - 23.09.2010

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


Re: What's the problem with this? :| - The_Moddler - 23.09.2010

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


Re: What's the problem with this? :| - Mike_Peterson - 23.09.2010

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

and tBarra[playerid][5] for example


Re: What's the problem with this? :| - The_Moddler - 23.09.2010

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


Re: What's the problem with this? :| - The_Moddler - 24.09.2010

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