26.11.2018, 20:47
When i'm in duty, the text label show, but when i put the command again, to back to the player mode, the Text Label dont delete, someone know why?
PHP код:
ACMD:admin[1](playerid, params[])
{
if(GetPlayerAdminLevel(playerid) < 2)
return Msg(playerid, RED, "[ > ] Vocк nгo tem permissгo para usar este comando.");
new name[MAX_PLAYER_NAME];
new Text3D:label = Create3DTextLabel("Admin", 0x33CCFFFF, 30.0, 40.0, 50.0, 10.0, 0);
GetPlayerName(playerid, name, sizeof(name));
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
Msg(playerid, RED, "[ > ] Vocк nгo pode fazer isso enquanto estб espiando!");
return 1;
}
if(!IsPlayerOnAdminDuty(playerid))
{
TogglePlayerAdminDuty(playerid, true);
MsgAdminsF(1, NovoA, "[ > ] O(a) Administrador(a){FFFFFF} %s {00c0ff}saiu do modo jogador!", name);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.2);
}
else
{
TogglePlayerAdminDuty(playerid, false);
MsgAdminsF(1, NovoA, "[ > ] O(a) Administrador(a){FFFFFF} %s {00c0ff}entrou no modo jogador!", name);
Delete3DTextLabel(label);
}
return 1;
}