03.12.2018, 01:17
I give the command below (entering duty mode), and it creates the 3DLabel normally, and appears on top of the administrator name "Admin" in blue, but when I give the command again (to exit duty mode) the 3DLabel does not exit, 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:adminindicitor[MAX_PLAYERS];
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))
{
adminindicitor[playerid] = Create3DTextLabel("Admin", 0x33CCFFFF, 30.0, 40.0, 50.0, 10.0, 0);
TogglePlayerAdminDuty(playerid, true);
MsgAdminsF(1, NovoA, "[ > ] O(a) Administrador(a){FFFFFF} %s {00c0ff}saiu do modo jogador!", name);
Attach3DTextLabelToPlayer(adminindicitor[playerid], 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(adminindicitor[playerid]);
}
return 1;
}