23.06.2012, 23:48
I've got a problem with my displaying of 3D Text Labels not showing when I ask them to be.
Here is what I have:
Above is the command to get them to be attatched to the player.
Here is OnPlayerConnect:
Here is OnPlayerUpdate:
Here is the /unmask command:
The problem is, once again; That the players 3d label doesn't appear on the player's head.
Thanks!
Here is what I have:
pawn Код:
command(mask, playerid, params[])
{
if(Player[playerid][Level] >= 5)
{
if(Player[playerid][Mask] == 1)
{
if(MaskOn[playerid] == 0)
{
new string[256];
MaskOn[playerid] = 1;
new rand = 1000 + random(8999);
MaskNumber[playerid] = rand;
format(string, sizeof(string), "* %s takes out a mask and places it over their head. *", MaskOnOff(playerid));
CloseMessage(playerid, ACTION, string);
format(string, sizeof(string), "Stranger_%d", MaskNumber[playerid]);
Update3DTextLabelText(masklabel[playerid], GREY, string);
Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
}
else return SendClientMessage(playerid, WHITE, "You already have your mask on.");
}
else return SendClientMessage(playerid, WHITE, "You don't have a Mask.");
}
else return SendClientMessage(playerid, WHITE, "You must be level 5 and above to use a mask.");
return 1;
}
Here is OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
masklabel[playerid] = Create3DTextLabel(" ", GREY, -1.0, -1.0, -1.0, -1.0, 0);
Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}
pawn Код:
public OnPlayerUpdate(playerid)
{
if(MaskOn[playerid] == 1)
{
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
}
format(string, sizeof(string), "Stranger_%d", MaskNumber[playerid]);
Update3DTextLabelText(masklabel[playerid], GREY, string);
Attach3DTextLabelToPlayer(masklabel[playerid], playerid, 0.0, 0.0, 0.7);
}
return 1;
}
pawn Код:
command(unmask, playerid, params[])
{
if(Player[playerid][Mask] == 1)
{
if(MaskOn[playerid] == 1)
{
new string[256];
MaskOn[playerid] = 0;
format(string, sizeof(string), "* %s takes off their mask. *", MaskOnOff(playerid));
CloseMessage(playerid, ACTION, string);
MaskNumber[playerid] = -1;
Update3DTextLabelText(masklabel[playerid], GREY, string);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
}
else return SendClientMessage(playerid, WHITE, "You don't have your mask on.");
}
else return SendClientMessage(playerid, WHITE, "You don't have a Mask.");
return 1;
}
Thanks!