Alexandre Makina Posted October 30, 2016 Share Posted October 30, 2016 Would have a script / resource for mta and can place text beside the car as in the example below? Link to comment
iPrestege Posted October 31, 2016 Share Posted October 31, 2016 @Alexandre Makina You can see this on : https://community.multitheftauto.com/index.php?p=resources&s=details&id=7613 Wiki resource page : https://wiki.multitheftauto.com/wiki/Resource:DxDraw3DText Link to comment
Alexandre Makina Posted October 31, 2016 Author Share Posted October 31, 2016 4 hours ago, FaHaD said: Thanks, but o'que I really need it is one that is fixed in the vehicle, even on the move. Act as identification of cars. Link to comment
iPrestege Posted October 31, 2016 Share Posted October 31, 2016 1 hour ago, Alexandre Makina said: Ok then you can try this example it will write the vehicle name if it was banshee so spawn a car with 429 id and see the results and you can make what ever you want to edit the code so try this on client side : addEventHandler ( 'onClientRender',root, function ( ) for _,aVehicle in next,getElementsByType ( [[vehicle]] ) do if aVehicle and getElementModel ( aVehicle ) == 429 then local aPx,aPy,aPz = getElementPosition ( localPlayer ); local aVx,aVy,aVz = getElementPosition ( aVehicle ); if ( getDistanceBetweenPoints3D ( aPx,aPy,aPz,aVx,aVy,aVz ) <= 10 ) then local aSx,aSy = getScreenFromWorldPosition ( aVx,aVy,aVz ); if ( aSx and aSy ) then dxDrawText( tostring ( getVehicleName ( aVehicle ) ),aSx,aSy,_,_,tocolor ( 255,0,0,255 ),2,'Arial','center','center' ); end end end end end ); 1 Link to comment
aka Blue Posted November 2, 2016 Share Posted November 2, 2016 You can use getVehicleComponentPosition to set the text near plate or numberplate. 1 Link to comment
Alexandre Makina Posted January 2, 2017 Author Share Posted January 2, 2017 (edited) I'm having a problem with this resource. Even altering the distance, it is possible to see the text of any place of the map. How to solve?I would like the text to be seen only by being close --------------------------- addEventHandler ( 'onClientRender',root, function ( ) for _,aVehicle in next,getElementsByType ( [[vehicle]] ) do if aVehicle and getElementModel ( aVehicle ) == 429 then local aPx,aPy,aPz = getElementPosition ( localPlayer ); local aVx,aVy,aVz = getElementPosition ( aVehicle ); if ( getDistanceBetweenPoints3D ( aPx,aPy,aPz,aVx,aVy,aVz ) <= 10 ) then local aSx,aSy = getScreenFromWorldPosition ( aVx,aVy,aVz ); if ( aSx and aSy ) then dxDrawText( tostring ( getVehiclePlateText ( aVehicle ) ),aSx,aSy,_,_,tocolor ( 255,0,0,255 ),2,'Arial','center','center' ); end end end end end ); Edited January 2, 2017 by Alexandre Makina Link to comment
iPrestege Posted January 4, 2017 Share Posted January 4, 2017 (edited) change the distance from 10 to something lower. Edited January 4, 2017 by iPrestege Link to comment
Alexandre Makina Posted January 4, 2017 Author Share Posted January 4, 2017 Thank you. But I realized that, I had added an irregular command line, so the error. 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