AriosJentu Posted August 27, 2014 Share Posted August 27, 2014 (edited) 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: This Image and Text (text used on screenes from SA-MP and MTA) is example, get it from google. Screenes from MTA: Updates 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 October 28, 2018 by AriosJentu 1 Link to comment
xXMADEXx Posted August 27, 2014 Share Posted August 27, 2014 It's cool, but it would be better if you could synchronize it so you could have the functions on the server side too. Link to comment
AriosJentu Posted August 28, 2014 Author Share Posted August 28, 2014 Updates: Added serverside Link to comment
Anubhav Posted August 29, 2014 Share Posted August 29, 2014 Suggestion: You should add function 'set3DTextFont'. To set fonts Link to comment
AriosJentu Posted August 29, 2014 Author Share Posted August 29, 2014 Updates: - 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 Screen: Link to comment
AriosJentu Posted September 3, 2014 Author Share Posted September 3, 2014 Ok, up this now Link to comment
Et-win Posted September 3, 2014 Share Posted September 3, 2014 You shouldn't "up" your topics constantly Link to comment
xeon17 Posted September 13, 2014 Share Posted September 13, 2014 Is there some way to fix this lag? when i'm near the 3DText my fps is 5-20 impossible to play. Link to comment
AriosJentu Posted September 14, 2014 Author Share Posted September 14, 2014 I havent lags Link to comment
xeon17 Posted September 14, 2014 Share Posted September 14, 2014 I havent lags The problem was i created the 3D Text on event ''onClientRender'' Awesome script , continue man! Link to comment
AriosJentu Posted September 14, 2014 Author Share Posted September 14, 2014 I havent lags The problem was i created the 3D Text on event ''onClientRender'' In example you can see that label was creating at start server (onClientResourceStart) Link to comment
Alexs Posted September 17, 2014 Share Posted September 17, 2014 Awesome, i did something like that: But i love the SA-MP Style of your resource. Link to comment
Mathias Lui Posted October 10, 2016 Share Posted October 10, 2016 (edited) On 17.9.2014 at 10:47 PM, Alexs said: Awesome, i did something like that: But i love the SA-MP Style of your resource. Lol how did you do that? I'm only an advanced beginner.. I don't do guis yet. This looks awesome! Edited October 10, 2016 by Mathias Lui Added smth Link to comment
Recommended Posts