Jump to content

Texto 3d nos Carros


Recommended Posts

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
);

 

  • Like 1
Link to comment
  • 1 month later...

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

---------------------------

  1. addEventHandler ( 'onClientRender',root,
  2. function ( )
  3. for _,aVehicle in next,getElementsByType ( [[vehicle]] ) do
  4. if aVehicle and getElementModel ( aVehicle ) == 429 then
  5. local aPx,aPy,aPz = getElementPosition ( localPlayer );
  6. local aVx,aVy,aVz = getElementPosition ( aVehicle );
  7. if ( getDistanceBetweenPoints3D ( aPx,aPy,aPz,aVx,aVy,aVz ) <= 10 ) then
  8. local aSx,aSy = getScreenFromWorldPosition ( aVx,aVy,aVz );
  9. if ( aSx and aSy ) then
  10. dxDrawText( tostring ( getVehiclePlateText ( aVehicle ) ),aSx,aSy,_,_,tocolor ( 255,0,0,255 ),2,'Arial','center','center' );
  11. end
  12. end
  13. end
  14. end
  15. end
  16. );
Edited by Alexandre Makina
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...