Kamx1993 Posted August 18, 2012 Posted August 18, 2012 How to create description 3D on character, like this Command /destription [text]
H5N1 Posted August 18, 2012 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.
Kamx1993 Posted August 18, 2012 Author Posted August 18, 2012 Please write the code if you can, because I'm new and still do not know how well the function.
Castillo Posted August 18, 2012 Posted August 18, 2012 You could try this resource: https://community.multitheftauto.com/ind ... ls&id=3090 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
sockz Posted August 20, 2012 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
ASM Posted August 20, 2012 Posted August 20, 2012 I also prefer to implementation a fraction of distance from a camera. Then it look mutch better.
Kamx1993 Posted September 5, 2012 Author 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
Castillo Posted September 6, 2012 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kamx1993 Posted September 6, 2012 Author 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)
Castillo Posted September 6, 2012 Posted September 6, 2012 No, you must store texts on a table, then draw them. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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