Kamx1993 Posted August 18, 2012 Share Posted August 18, 2012 How to create description 3D on character, like this Command /destription [text] Link to comment
H5N1 Posted August 18, 2012 Share Posted August 18, 2012 dxDrawText with onClientRender for nearest players. The easiest way to do this is using setElementData on server and getElementData on client. Link to comment
Kamx1993 Posted August 18, 2012 Author Share Posted August 18, 2012 Please write the code if you can, because I'm new and still do not know how well the function. Link to comment
Castillo Posted August 18, 2012 Share Posted August 18, 2012 You could try this resource: https://community.multitheftauto.com/ind ... ls&id=3090 Link to comment
sockz Posted August 20, 2012 Share Posted August 20, 2012 You could try this resource: https://community.multitheftauto.com/ind ... ls&id=3090 That resource is fairly bad IMO. It's clunky and a lot bigger than it has to be. There's a resource called 'text'. Search for it, it does the same thing but it cuts the coding in half and has a lot more simplicity to it Link to comment
ASM Posted August 20, 2012 Share Posted August 20, 2012 I also prefer to implementation a fraction of distance from a camera. Then it look mutch better. Link to comment
Kamx1993 Posted September 5, 2012 Author Share Posted September 5, 2012 Help me please, this is my Code write. This text is not shows players when write to command /opis [text] distance = 40 addCommandHandler("opis", opispokaz) function opispokaz(source, message) local player = getElementsByType("player") message = string.gsub(message, "#%x%x%x%x%x%x", "") for k,gracz in pairs(player) do if isElementOnScreen(gracz) then local x,y,z=getElementPosition(gracz) local X,Y=getScreenFromWorldPosition(x,y,z) local px,py,pz=getElementPosition(getLocalPlayer()) local dystans=getDistanceBetweenPoints3D(x,y,z,px,py,pz) if dystans < distance then dxDrawText(" ".. message .." ")",X,Y) end end end end end Link to comment
Castillo Posted September 6, 2012 Share Posted September 6, 2012 In order to use the DirectX ( DX ) functions, you must use onClientRender to draw it, also it would only draw to the client only, since is a client side script. Link to comment
Kamx1993 Posted September 6, 2012 Author Share Posted September 6, 2012 That's how it is supposed to look? distance = 40 addCommandHandler("opis", opispokaz) function opispokaz(source, message) local player = getElementsByType("player") message = string.gsub(message, "#%x%x%x%x%x%x", "") for k,gracz in pairs(player) do if isElementOnScreen(gracz) then local x,y,z=getElementPosition(gracz) local X,Y=getScreenFromWorldPosition(x,y,z) local px,py,pz=getElementPosition(getLocalPlayer()) local dystans=getDistanceBetweenPoints3D(x,y,z,px,py,pz) if dystans < distance then dxDrawText(" ".. message .." ")",X,Y) end end end end end addEventHandler ( "onClientRender", getRootElement (), opispokaz) Link to comment
Castillo Posted September 6, 2012 Share Posted September 6, 2012 No, you must store texts on a table, then draw them. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now