Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created by Smokahontas.
- function dxDrawTextOnVehicles()
- for i,vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do
- local x,y,z = getElementPosition ( vehicle )
- local _,_,rz = getElementRotation ( vehicle )
- local px,py,pz,protx,proty,protz = getCameraMatrix()
- local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
- if ( distance < 1000 ) then
- local sx,sy = getScreenFromWorldPosition ( x,y,z+1 )
- local vehname = getVehicleName ( vehicle )
- local r,g,b = getVehicleColor ( vehicle,true )
- if ( sx and sy ) then
- dxDrawText ( vehname,sx,sy,sx,sy,tocolor ( 247,255,0 ),0.5,"default-bold","center","center" )
- end
- end
- end
- end
- addEventHandler ("onClientRender",root,dxDrawTextOnVehicles)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement