08.11.2012, 20:12
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:
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:
And to hide the stats textdraw for a player use:
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);
}
pawn Код:
stock ShowStatsDusan(playerid)
{
TextDrawShowForPlayer(playerid, StatsTDLevo[playerid]);
return 1;
}
pawn Код:
TextDrawHideForPlayer(playerid, StatsTDLevo[playerid]);