The code below gets some standard information about a player (i.e. their name, ID and score) then displays it above their head. Instead of showing a players health and armor, I show this. It looks 10x better (IMO) and it doesn't allow for meta-gaming. (seeing a players health)
pawn Код:
format(string, sizeof(string), "%s (%d)\n Score: %i", GetName(playerid), playerid, GetPlayerScore(playerid));
pNameTag[playerid] = Create3DTextLabel(string, COLOR_YELLOW, 30.0, 40.0, 50.0, 15.0, -1, 1);
Attach3DTextLabelToPlayer(pNameTag[playerid], playerid, 0.0, 0.0, 0.2);
Basically we're formating a string, making the label and of course, attaching the label to a players head. I used custom functions, so do not attempt using this code. It'll just be stupid!