[Tutorial] Creating a simple 3DText
#1

Function is:
pawn Code:
Create3DTextLabel (text [], color, Float: X, Float: Y, Float: Z, Float: DrawDistance, virtualworld, testLOS)
text [] - You type text that you want ...;
color - text color;
Float: X - X coordinate;
Float: Y - Y coordinate;
Float: Z - coordinate Z;
Float: DrawDistance - Distance from where you can see the 3D text;
virtualworld - virtual world that appear 3D text (-1 to appear in all virtual worlds);
testLOS - This tests the line of sight so as not to see through objects (use 0 or 1).

EXAMPLE
Create3DTextLabel ("Example", 0xFFFFFFFF, 372.6514, 2474.6919, 16.4844, 50, 0);

TIP 1: If you want to pick up this text to add a + Z coordinate followed by the desired height.
TIP 2: If you want to add a newline character this text use \ n.
Reply
#2

Very general, but

You do not need to add the function under the OnGameModeInit() callback
Reply
#3

Uh.. sry .. my mistake theen
Reply
#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
#5

I don't see this as a tutorial. You're just providing them one function and info how to use the parameters. To me atleast, tutorial would be longer and use more functions and give examples.
Reply
#6

Looks like copy / paste from SAMP Wiki(found it the same there), if you gonna copy, atleast copy and examples
Reply
#7

Quote:
Originally Posted by MarTaTa
View Post
Looks like copy / paste from SAMP Wiki(found it the same there), if you gonna copy, atleast copy and examples
No i didn't copy from sa-mp wiki .. maybe i dont know scripting too much , but not so dump to copy from wiki
Reply
#8

Quote:

maybe i dont know scripting too much

Typically people who make tutorials know more about scripting than the people reading them...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)