ShowStats problem
#6

So, you're setting the string of the textdraw before creating it? That's wrong.

I'd rather create all the textdraws when the server starts up (i.e. under OnGameModeInit), here's a method of doing so:

pawn Код:
// This code creates a textdraw for each player (Depends on the defination of MAX_PLAYERS).
// It's preferred to put this code either under OnGameModeInit or OnFilterScriptInit
for(new i = 0; i < MAX_PLAYERS; i ++)
{
    StatsTDLevo[i] = TextDrawCreate(148.000000, 142.000000, "Racun");
    TextDrawBackgroundColor(StatsTDLevo[i], 255);
    TextDrawFont(StatsTDLevo[i], 1);
    TextDrawLetterSize(StatsTDLevo[i], 0.500000, 1.000000);
    TextDrawColor(StatsTDLevo[i], 12582911);
    TextDrawSetOutline(StatsTDLevo[i], 0);
    TextDrawSetProportional(StatsTDLevo[i], 1);
    TextDrawSetShadow(StatsTDLevo[i], 1);
}
Also, we'll need to modfiy your ShowStatsDusan function a little - now we need this function to only show the textdraw to a player, so your function has to be just like this:

pawn Код:
stock ShowStatsDusan(playerid)
{
    TextDrawShowForPlayer(playerid, StatsTDLevo[playerid]);
    return 1;
}
And to hide the stats textdraw for a player use:

pawn Код:
TextDrawHideForPlayer(playerid, StatsTDLevo[playerid]);
Reply


Messages In This Thread
ShowStats problem - by Dusan01 - 07.11.2012, 18:24
Re: ShowStats problem - by cecko1235 - 07.11.2012, 18:47
Re: ShowStats problem - by Dusan01 - 07.11.2012, 19:10
Re: ShowStats problem - by [KHK]Khalid - 07.11.2012, 20:56
Re: ShowStats problem - by Dusan01 - 08.11.2012, 04:14
Re: ShowStats problem - by [KHK]Khalid - 08.11.2012, 20:12

Forum Jump:


Users browsing this thread: 2 Guest(s)