Jump to content

[REL] 3D Text Label Like SA-MP


AriosJentu

Recommended Posts

Hi all.

3D Text Label System like SA-MP.

With this resource you can add to ypur server nice 3D Text Label system, whats appear like SA-MP 3D Text Labels.

What you can do with this?

- You can add 3D Text Label to world position, with changing Dimension and Distance of View

- You also can remove 3D Text Label

- You can update info about 3D Text Label

- You can attach/detach 3D Text Label to/from element

- Added serverside and serverside argument.

Updated:

- You can change font and font size (added argument to Create and Update)

- On Update functions if you not use argumen, thats not changing now

And availible colorcoded strings and color alpha

ClientSide and ServerSide

Functions:

ClientSide:

 

create3DTextLabel(string LabelText [, color LabelColor, float X, float Y, float Z, int DistanceOfView, int Dimension, string/dx-font Font, int FontSize]) 
 

Arguments:

- LabelText - 3D Label text (can formatting)

Optional:

- LabelColor - 3D Label main color (you can use tocolor() or 0xAARRGGBB [Default: White]

- X, Y, Z - World position of 3D Label (you can use "x" as all X, Y, Z to get Local Player positions) [Default: Local Player Position]

- DistanceOfView - Distance of view [Default: 150]

- Dimension - 3D Label World Dimension (you can use -1 to set visible label in all dimensions) [Default: -1]

- Font - DX Font (text fonts you can see here {if this argument is not font, check your debug to problems}) [Default: "default-bold"]

- FontSize - Font Size (do not you more than 10, text very large, and you cant see it on monitors, whats height < 600) [Default: 1]

Create 3D Text label in world

Returns: 3D Text Lable Identification {int}


delete3DTextLabel(int TextID) 
 

Arguments:

- TextID - 3D Text Lable Identification

Remove 3D Text Label in world


update3DTextLabel(int TextID, string LabelText [, color LabelColor, float X, float Y, float Z, int DistanceOfView, int Dimension, string/dx-font Font, int FontSize]) 
 

Arguments:

- TextID - 3D Text Lable Identification

- LabelText - 3D Label text (can formatting)

Optional:

- LabelColor - 3D Label main color (you can use tocolor() or 0xAARRGGBB [Default: Not Changed]

- X, Y, Z - World position of 3D Label (you can use "x" as all X, Y, Z to get Local Player positions) [Default: Not Changed]

- DistanceOfView - Distance of view [Default: Not Changed]

- Dimension - 3D Label World Dimension (you can use -1 to set visible label in all dimensions) [Default: Not Changed]

- Font - DX Font (text fonts you can see here {if this argument is not font, check your debug to problems}) [Default: Not Changed]

- FontSize - Font Size (do not you more than 10, text very large, and you cant see it on monitors, whats height < 600) [Default: Not Changed]

Update information about 3D Text Label in world


attach3DTextLabelToElement(int TextID, element AttachTo [, float AttachToElementX, float AttachToElementY, float AttachToElementZ, int AttachToElementDimension]) 
 

Arguments:

- TextID - 3D Text Lable Identification

- AttachTo - Element, what attached label

Optional:

- AttachToElementX, AttachToElementY, AttachToElementZ - Element Position attach ([0, 0, 0] sets over head, if element is player) [Default: 0, 0, 0]

- AttachToElementDimension - Dimension, where attach label to element (you can use -1 to set visible label in all dimensions) [Default: -1]

Attach 3D Text Label to element


detach3DTextLabel(int TextID) 
 

Arguments:

- TextID - 3D Text Lable Identification

Detach 3D Text Label from attached element

ServerSide:

 

create3DTextLabel(string LabelText [, color LabelColor, float X, float Y, float Z, int DistanceOfView, int Dimension, string/dx-font Font, int FontSize, element TriggerSended]) 
 

Arguments:

- LabelText - 3D Label text (can formatting)

Optional:

- LabelColor - 3D Label main color (you can use tocolor() or 0xAARRGGBB [Default: White]

- X, Y, Z - World position of 3D Label (you can use "x" as all X, Y, Z to get Local Player positions) [Default: 0, 0, 5]

- DistanceOfView - Distance of view [Default: 150]

- Dimension - 3D Label World Dimension (you can use -1 to set visible label in all dimensions) [Default: -1]

- Font - DX Font (text fonts you can see here {if this argument is not font, check your debug to problems}) [Default: "default-bold"]

- FontSize - Font Size (do not you more than 10, text very large, and you cant see it on monitors, whats height < 600) [Default: 1]

- TriggerSended - Element, who can see Label [Default: Root (For all elements)]

Create 3D Text label in world

Returns: 3D Text Lable Identification {int}


delete3DTextLabel(int TextID [, element TriggerSended]) 
 

Arguments:

- TextID - 3D Text Lable Identification

Optional:

- TriggerSended - Element, for what removing label [Default: Root (For all elements)]

Remove 3D Text Label in world


update3DTextLabel(int TextID, string LabelText [, color LabelColor, float X, float Y, float Z, int DistanceOfView, int Dimension, string/dx-font Font, int FontSize, element TriggerSended]) 
 

Arguments:

- TextID - 3D Text Lable Identification

- LabelText - 3D Label text (can formatting)

Optional:

- LabelColor - 3D Label main color (you can use tocolor() or 0xAARRGGBB [Default: Not Changed]

- X, Y, Z - World position of 3D Label (you can use "x" as all X, Y, Z to get Local Player positions) [Default: Not Changed]

- DistanceOfView - Distance of view [Default: Not Changed]

- Dimension - 3D Label World Dimension (you can use -1 to set visible label in all dimensions) [Default: Not Changed]

- Font - DX Font (text fonts you can see here {if this argument is not font, check your debug to problems}) [Default: Not Changed]

- FontSize - Font Size (do not you more than 10, text very large, and you cant see it on monitors, whats height < 600) [Default: Not Changed]

- TriggerSended - Element, who can see changes [Default: Root (For all elements)]

Update information about 3D Text Label in world


attach3DTextLabelToElement(int TextID, element AttachTo [, float AttachToElementX, float AttachToElementY, float AttachToElementZ, int AttachToElementDimension, element TriggerSended]]) 
 

Arguments:

- TextID - 3D Text Lable Identification

- AttachTo - Element, what attached label

Optional:

- AttachToElementX, AttachToElementY, AttachToElementZ - Element Position attach ([0, 0, 0] sets over head, if element is player) [Default: 0, 0, 0]

- AttachToElementDimension - Dimension, where attach label to element (you can use -1 to set visible label in all dimensions) [Default: -1]

- TriggerSended - Element, who can see changes [Default: Root (For all elements)]

Attach 3D Text Label to element


detach3DTextLabel(int TextID [, element TriggerSended]) 
 

Arguments:

- TextID - 3D Text Lable Identification

Optional:

- TriggerSended - Element, who can see changes [Default: Root (For all elements)]

Detach 3D Text Label from attached element

Download:

Link Lost.

From SA-MP 3D Text Label:

 

samp005fxv.png

This Image and Text (text used on screenes from SA-MP and MTA) is example, get it from google.

Screenes from MTA:

 

S98epEK.jpg

vaaifPH.jpg

ArxHfYk.jpg

NczWggn.jpg

updCJgs.png

sR4ROlj.png

EpzTIDR.jpg

Updates

 

5uvNOg6.png

Example:

 

addEventHandler("onClientResourceStart", root, 
    function() 
        label = create3DTextLabel("Lost", 0xFFFFFF00, 0, 0, 10, 700, 0) 
        labels = create3DTextLabel("test", 0xFFFFF000, 0, 0, 15, 700, 0) 
        labelz = create3DTextLabel("Fest", 0xFFFFF000, 0, 0, 20, 700, 0) 
        attach3DTextLabelToElement(label, localPlayer or getPedOccupiedVehicle(localPlayer)) 
        setTimer(function() 
            local vx, vy, vz = getElementPosition(localPlayer or getPedOccupiedVehicle(localPlayer)) 
            update3DTextLabel(label, "#FF0000X: #FFFFFF"..string.format("%.4f", vx).."\n#FF0000Y: #FFFFFF"..string.format("%.4f", vy).."\n#FF0000Z: #FFFFFF"..string.format("%.4f", vz)) 
        end, 50, 1000) 
        setTimer(function() 
            detach3DTextLabel(label) 
        end, 52*1000, 1) 
    end) 
  
 

Thanks All

Edited by AriosJentu
  • Like 1
Link to comment
  • 2 weeks later...
  • 2 years later...
  • 2 years later...
  • N3xT locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...