27.06.2011, 09:53
Why not use one variable for all of the labels? Just do this
This means that you will only ever have one variable getting rid of the chance of doubleups.
pawn Код:
new PlayerText3D:label[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
label[playerid] = Create3DTextLabel("Loading...",COLOR_WHITE,X, Y, Z+2.0,20.0,1);
return 1;
}
if(GetPlayerSkin(playerid) == 111 || GetPlayerSkin(playerid) == 124 || GetPlayerSkin(playerid) == 70 || GetPlayerSkin(playerid) == 112 ) //assault
{
new Float:X, Float:Y, Float:Z; // GetPlayerPos floats
GetPlayerPos(playerid, X, Y, Z); // Geting player pos
Update3DTextLabelText(label[playerid], COLOR_WHITE, "Assault Soldier");
Attach3DTextLabelToPlayer(label[playerid],playerid,0,0,0.5);
}
if(GetPlayerSkin(playerid) == 287 || GetPlayerSkin(playerid) == 120 || GetPlayerSkin(playerid) == 68 || GetPlayerSkin(playerid) == 113) //anti-tank
{
new Float:X, Float:Y, Float:Z; // GetPlayerPos floats
GetPlayerPos(playerid, X, Y, Z); // Geting player pos
Update3DTextLabelText(label[playerid], COLOR_GREEN, "Anti-Tank");
Attach3DTextLabelToPlayer(label[playerid],playerid,0,0,0.5);
}
if(GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 294 || GetPlayerSkin(playerid) == 59 || GetPlayerSkin(playerid) == 114) //Support Squad
{
new Float:X, Float:Y, Float:Z; // GetPlayerPos floats
GetPlayerPos(playerid, X, Y, Z); // Geting player pos
Update3DTextLabelText(label[playerid], COLOR_RED, "Support Squad");
Attach3DTextLabelToPlayer(label[playerid],playerid,0,0,0.5);
}