[Ajuda] 3DTextLabel
#1

Bem estou com o seguinte problema, criei uma callback para setar os text3d nos players que tem suas profissхes.. mais
quando outro player escolhe outra profissгo o text3d some do meu boneco, ou vice-versa.
Alguem poderia me ajudar?
pawn Код:
CB:TLP(playerid) {
    new prof[60], Text3D:LabelPlayer[MAX_PLAYERS];
    format(prof, sizeof(prof), PASTA_CONTAS, GetName(playerid));
    if (DOF2_GetInt(prof, "Profissao") == 0) {
        Create3DTextLabel("Desempregado", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 1) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Taxista", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 2) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Assaltante", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 3) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Seguranзa", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 4) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Carteiro", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 5) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Caminhoneiro", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 6) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Mйdico", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 7) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Mecвnico", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 8) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Advogado", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 9) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Aposentado", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 10) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Policial Militar", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 11) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Policial Civil", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 12) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Membro da Interpol", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 13) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Policial Federal", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 14) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Membro da F.B.I", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 15) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Membro da S.W.A.T", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 16) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Policial Rodoviбrio", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 17) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Sequestrador", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 18) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Motorista Particular", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 19) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Mendingo", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (DOF2_GetInt(prof, "Profissao") == 20) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("Jornalista", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (IsAdmin[playerid] == 1) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("- Adminstrador -", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else if (IsVip[playerid] == 1) {
        Delete3DTextLabel(LabelPlayer[playerid]);
        Create3DTextLabel("- Vip -", -1, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(LabelPlayer[playerid], playerid, 0.0, 0.0, 0.7);
    }
    return 1;
}

http://sphotos-b.ak.fbcdn.net/hphoto...41281821_o.jpg
Reply
#2

Serб que o prу nгo й nessas
pawn Код:
Delete3DTextLabel(LabelPlayer[playerid]);
?

Tenta inutilizar pra ver se continua:
pawn Код:
//Delete3DTextLabel(LabelPlayer[playerid]);
Reply
#3

Dessa forma ele nгo vai criar varios 3dtext?
Reply
#4

Usa SetTimer para fazerum update nas text!
#edit https://sampwiki.blast.hk/wiki/Update3DTextLabelText
Reply
#5

Ok Vou testar /\

#Mas apareceu outro bug aqui.. quando eu morro o player nгo spawna .. entгo e eu tenho q usar spawn player no onplayerdeath.. sendo assim quando morre ele faz um flood no chatkill..
Reply
#6

Quote:
Originally Posted by dPlaYer_
Посмотреть сообщение
Ok Vou testar /\

#Mas apareceu outro bug aqui.. quando eu morro o player nгo spawna .. entгo e eu tenho q usar spawn player no onplayerdeath.. sendo assim quando morre ele faz um flood no chatkill..
Ta usando return 0

Reply
#7

Sim ,na onplayer death request class / spawn
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    return 0;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    AtualizarCores(playerid);
    SpawnPlayer(playerid);
    if(IsPlayerInPSkate(playerid))
    {
        Dominando[playerid] = 0;
        ProvocouSkate[playerid] = 0;
    }
    return 0;
}
#O 3DText Continua sem botar pra outros players.. sу pega em 1
Reply
#8

Quote:
Originally Posted by dPlaYer_
Посмотреть сообщение
Sim ,na onplayer death request class / spawn
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    return 0;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    AtualizarCores(playerid);
    SpawnPlayer(playerid);
    if(IsPlayerInPSkate(playerid))
    {
        Dominando[playerid] = 0;
        ProvocouSkate[playerid] = 0;
    }
    return 0;
}
#O 3DText Continua sem botar pra outros players.. sу pega em 1
Ele nao para de continuar com return 0

o SetTimer para fazer update nao iria criar voce deve fazer criar ao spawn a primeira vez!
Reply
#9

Fiz um pra criar e outro pra atualizar , vou testar e dou edit.
mas o do onplayerdeath ainda tб bug..
Reply
#10

Nгo precisar usar settimer para atualizar,

tem a native Update3DTextLabel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)