[Tutorial] Creating a simple 3DText
#4

I made this real quick for example purposes.

pawn Code:
new Text3D: TextID[MAX_PLAYERS];
   
public OnPlayerConnect(playerid) {
    new Float: X,
        Float: Y,
        Float: Z;
       
    GetPlayerPos(playerid, X, Y, Z);
    TextID[playerid] = Create3DTextLabel("X: 0000.000000\nY: 0000.000000\nZ: 0000.000000\nA: 0000.000000", 0x008080FF, X, Y, Z);
    return true;
}
   
public OnPlayerDisconnect(playerid, reason) {
    Delete3DTextLabel(TextID[playerid]);
    return true;
}
   
public OnPlayerUpdate(playerid) {
    new Float: X,
        Float: Y,
        Float: Z,
        Float: A,
        String[100];
       
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    format(String, 100, "X: %f\nY: %f\nZ: %f\nA: %f", X, Y, Z, A);
    Update3DTextLabelText(TextID[playerid], 0x008080FF, String);
    Attach3DTextLabelToPlayer(TextID[playerid], playerid, 0.0, 0.0, 1.0);
    return true;
}
It simply follows the player around, wherever the player goes, and other players can see their position.
Reply


Messages In This Thread
Creating a simple 3DText - by yLuSsSIoN - 14.09.2012, 10:14
Re: Creating a simple 3DText - by Sniper Kitty - 14.09.2012, 10:16
Re: Creating a simple 3DText - by yLuSsSIoN - 14.09.2012, 10:17
Re: Creating a simple 3DText - by Sniper Kitty - 14.09.2012, 10:27
Re: Creating a simple 3DText - by Max_Coldheart - 14.09.2012, 11:00
Re: Creating a simple 3DText - by MarTaTa - 14.09.2012, 12:42
Re: Creating a simple 3DText - by yLuSsSIoN - 14.09.2012, 13:08
Re: Creating a simple 3DText - by kaisersouse - 14.09.2012, 13:10

Forum Jump:


Users browsing this thread: 2 Guest(s)