12.07.2012, 07:06
You can also create the textdraws in a loop ( in ongamemodeinit) like:
So you only have to call:
In onplayerconnect
pawn Code:
new i = 0;
while (i < (sizeof (SPEEDOS) + 1) && (sizeof (HEALTH) +1))
{
SPEEDOS[i] = TextDrawCreate(208.000000, 434.000000, " "), TextDrawBackgroundColor(SPEEDOS[i], 255), TextDrawFont(SPEEDOS[i], 1), TextDrawLetterSize(SPEEDOS[i], 0.500000, 1.000000), TextDrawColor(SPEEDOS[i], -1), TextDrawSetOutline(SPEEDOS[i], 0), TextDrawSetProportional(SPEEDOS[i], 1), TextDrawSetShadow(SPEEDOS[i], 1);
HEALTH[i] = TextDrawCreate(347.000000, 434.000000, " "), TextDrawBackgroundColor(HEALTH[i], 255), TextDrawFont(HEALTH[i], 1), TextDrawLetterSize(HEALTH[i], 0.500000, 1.000000), TextDrawColor(HEALTH[i], -1), TextDrawSetOutline(HEALTH[i], 0), TextDrawSetProportional(HEALTH[i], 1), TextDrawSetShadow(HEALTH[i], 1);
i++;
if(i == sizeof (SPEEDOS) && sizeof (HEALTH)) {
printf("[SERVER] [CONSOLE]: Created: %d Speedo/Health meters.", i);
}
}
pawn Code:
TextDrawShowForPlayer(playerid,HEALTH[playerid]);
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);