Tokio Posted May 23, 2018 Posted May 23, 2018 I want create a dxdraw rectangle and text on the map. But how to make this possible?
Tokio Posted May 23, 2018 Author Posted May 23, 2018 2 minutes ago, Dimos7 said: Here And how to create a text?
Z4Zy Posted May 24, 2018 Posted May 24, 2018 (edited) I want create a dxdraw rectangle and text on the map. But how to make this possible? @50cent Did you mean to create a text inside the MTA:SA world ?? If so, You can try below resource. https://community.multitheftauto.com/index.php?p=resources&s=details&id=3090 Edited May 24, 2018 by DeadthStrock 1
MrKAREEM Posted May 25, 2018 Posted May 25, 2018 As That ?? local x,y,z = -3327, -2937.8000488281, 5 addEventHandler("onClientRender",getRootElement(), function() local px,py,pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if distance <= 50 then local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 ) if not sx then return end local scale = 0.1/(0.1 * (distance / 50)) dxDrawText ( "Get Car", sx, sy - 5, sx, sy - 5, tocolor(255,255,255,255), math.min ( 0.4* (50/distance)*1.4,4), "default-bold", "center", "bottom", false, false, false ) end end )
Tokio Posted May 27, 2018 Author Posted May 27, 2018 But this ( https://wiki.multitheftauto.com/wiki/DxDrawRectangle3D ) does not working.. why?
Tokio Posted May 27, 2018 Author Posted May 27, 2018 41 minutes ago, Dimos7 said: You copy the code from wiki? Yeah
Z4Zy Posted May 28, 2018 Posted May 28, 2018 On 5/27/2018 at 17:22, 50cent said: But this ( https://wiki.multitheftauto.com/wiki/DxDrawRectangle3D ) does not working.. why? The code must be insert to client side. And try to insert below code into the script. local dot = dxCreateTexture(1,1) local white = tocolor(255,255,255,255) function dxDrawRectangle3D(x,y,z,w,h,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or white, ...) end
Ceeser Posted May 30, 2018 Posted May 30, 2018 dxDraw3DText That is used for use with onClientRender in your Script, no need for the resource
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