[Ajuda] Label Nгo carrega
#5

Quote:
Originally Posted by Murilo_sousa
Посмотреть сообщение
Tente

pawn Код:
FC:CheckLabels()
{
    for (new p = 0; p < MAX_PLAYERS; p++)
    {
        if(pInfo[p][dAfk] == false)
        {
            switch(pInfo[p][dLAdmin])
            {
                case 0:
                {
                    format(sGlobal, sizeof(sGlobal), "%s", gProfName(p));
                    CreateDynamic3DTextLabel(sGlobal, COR_LARANJA2, 0.0, 0.0, 0.5, 50.0, pInfo[p][LabelAdmin], INVALID_VEHICLE_ID);
                }
                case 1:
                {
                    CreateDynamic3DTextLabel("*Moderador*", COR_LARANJA2, 0.0, 0.0, 0.5, 50.0, pInfo[p][LabelAdmin], INVALID_VEHICLE_ID);
                }
                case 2:
                {
                    CreateDynamic3DTextLabel("*Moderador*", COR_LARANJA2, 0.0, 0.0, 0.5, 50.0, pInfo[p][LabelAdmin], INVALID_VEHICLE_ID);
                }
            }
        }
        if(pInfo[p][dAfk] == true)
        {
            CreateDynamic3DTextLabel("*AFK*", COR_LARANJA2, 0.0, 0.0, 0.5, 50.0, pInfo[p][LabelAdmin], INVALID_VEHICLE_ID);
        }
    }
    return 1;
}
ou use: Attach3DTextLabelToPlayer
Criar um Text3D a cada 1 segundo lol

O modo em que vocк utilizou CreateDynamic3DTextLabel tб errado



Observaзгo "pInfo[playerid][LabelAdmin]" deve estar definido como Text3D, utilizar a include streamer e manter o timer

Exemplo:
pawn Код:
new Text3D:label;
Adicione onde o jogador loga / registra:

pawn Код:
pInfo[playerid][LabelAdmin] = CreateDynamic3DTextLabel("NaN", -1, 0.0, 0.0, 0.0, 50.0, playerid, INVALID_VEHICLE_ID, 0, -1, -1, -1, 50.0);
Destrua o Text3D quando o jogador se desconecta:

pawn Код:
public OnPlayerDisconnect(playerid) {
    if(IsValidDynamic3DTextLabel(pInfo[playerid][LabelAdmin])) DestroyDynamic3DTextLabel(pInfo[playerid][LabelAdmin]);
    return 1;
}
Altere a Callback para:

pawn Код:
CheckLabels(); public CheckLabels() {
    for(new p = 0; p < GetMaxPlayers(); p++) {
        if((IsPlayerConnected(p)) && ([p][dAfk] == false)) {
            switch(pInfo[p][dLAdmin]) {
                case 0: {
                    format(sGlobal, sizeof(sGlobal), "%s", gProfName(p));
                }
                case 1: {
                    format(sGlobal, sizeof(sGlobal), "* Moderador *");
                }
                case 2: {
                    format(sGlobal, sizeof(sGlobal), "* Adminstrador *");
                }
            }
        }
        if(pInfo[p][dAfk] == true) {
            format(sGlobal, sizeof(sGlobal), "* Jogador AFK *");
        }
    }
    if(IsValidDynamic3DTextLabel(pInfo[p][LabelAdmin])) UpdateDynamic3DTextLabelText(pInfo[p][LabelAdmin], COR_LARANJA2, sGlobal);
    return 1;
}
Sirva tudo com a calda de chocolate por cima

* Nгo testei o cуdigo se houver pequenos erros podem ser facilmente contornados
Reply


Messages In This Thread
Label Nгo carrega - by dPlaYer_ - 24.03.2013, 02:26
Re: Label Nгo carrega - by Maklister - 24.03.2013, 02:34
Re: Label Nгo carrega - by Crueliz0n - 24.03.2013, 03:11
Re: Label Nгo carrega - by Maklister - 24.03.2013, 04:43
Re: Label Nгo carrega - by Dwayne-Pheonix - 24.03.2013, 12:20
Re: Label Nгo carrega - by dPlaYer_ - 24.03.2013, 22:48
Re: Label Nгo carrega - by Crueliz0n - 24.03.2013, 23:06
Re: Label Nгo carrega - by dPlaYer_ - 25.03.2013, 00:27

Forum Jump:


Users browsing this thread: 1 Guest(s)