05.07.2016, 04:15
I have written a simple mask system, and It's have a 3dText above head when use command /mask, but when I retype that command, It's not delete 3DTextLabel. Some one help me please ^_^
My Script
My Script
Код:
new Text3D:masknamelabel[MAX_PLAYERS];
CMD:mask(playerid, params[])
{
new string[128];
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_LIGHTRED, "Lenh dang duoc hoan thien.");
if(IsPlayerConnected(playerid))
{
if(GetPVarInt(playerid, "dangdeomask") == 0)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
Dadeomatna[playerid] = 1;
masknamelabel[playerid] = Create3DTextLabel(" ",0x9ACD32AA,30.0,40.0,50.0,15.0,0);
format(string,sizeof(string),"Nguoi la mat #%d", GetPlayerSQLId(playerid));
Update3DTextLabelText(masknamelabel[playerid], 0x9ACD32AA, string);
Attach3DTextLabelToPlayer(masknamelabel[playerid], playerid, 0.0, 0.0, 0.4);
}
}
SetPVarInt(playerid, "dangdeomask", 1);
format(string, sizeof(string), "* %s lay ra mot chiec mat na va deo len tren mat.", GetPlayerNameEx(playerid));
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(GetPVarInt(playerid, "dangdeomask") == 1)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
Dadeomatna[playerid] = 0;
Delete3DTextLabel(masknamelabel[playerid]);
}
}
SetPVarInt(playerid, "dangdeomask", 0);
format(string, sizeof(string), "* Nguoi la mat #%d da thao chiec mat na xuong.", GetPlayerSQLId(playerid));
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}


but sometime it's hide the 3dtextlabel. If someone has another plan please tell me
.