Attach3DTextLabelToPlayer
#1

I'm trying to show player's ID above their head, but something is terribly wrong. Nothing is appearing so I guess the problem is within those coordinates?

pawn Код:
public OnPlayerConnect(playerid)
{
    new
        string[32],
        name[MAX_PLAYER_NAME],
        Text3D:label = Create3DTextLabel(string, White, 30.0, 40.0, 50.0, 40.0, 0);
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "ID: %i", GetPlayerID(name));
    Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
    return 1;
}
pawn Код:
stock GetPlayerID(const name[])
{
    new pName[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        GetPlayerName(i, pName, MAX_PLAYER_NAME);
        if(!strcmp(pName, name))
            return i;
    }
    return INVALID_PLAYER_ID;
}
Reply


Messages In This Thread
Attach3DTextLabelToPlayer - by rhds - 29.03.2013, 21:49
Re: Attach3DTextLabelToPlayer - by Pottus - 29.03.2013, 22:47
Re: Attach3DTextLabelToPlayer - by SuperViper - 29.03.2013, 23:08
Re: Attach3DTextLabelToPlayer - by rhds - 30.03.2013, 07:46
Re: Attach3DTextLabelToPlayer - by Pottus - 30.03.2013, 08:26
Re: Attach3DTextLabelToPlayer - by rhds - 30.03.2013, 08:43
Re: Attach3DTextLabelToPlayer - by rhds - 30.03.2013, 09:15
Re: Attach3DTextLabelToPlayer - by Apenmeeuw - 30.03.2013, 09:31
Re: Attach3DTextLabelToPlayer - by rhds - 30.03.2013, 11:05

Forum Jump:


Users browsing this thread: 5 Guest(s)