Jump to content

Problem with 3DText


xeon17

Recommended Posts

I'm trying to add 3DText on a ped , but there is a problem with the export function.

My code:

--Ped 
  
  
PedPolice = createPed (280,1555.34094, -1675.74585, 16.19531) 
PedPolice2 = createPed (284,1543.82703, -1631.83557, 13.38281) 
setElementFrozen(PedPolice,true) 
setPedAnimation( PedPolice, "PED", "IDLE_CHAT") 
setElementRotation(PedPolice,0,0,450)  
setElementRotation(PedPolice2,0,0,450)  
addEventHandler ( "onClientPedDamage",PedPolice, 
function  ( ) 
    cancelEvent () 
end) 
  
addEventHandler ( "onClientPedDamage",PedPolice2, 
function  ( ) 
    cancelEvent () 
end) 
  
  
 -- Draw of Ped Text 
  
 addEventHandler( "onClientRender",root, 
   function( ) 
      local px, py, pz, tx, ty, tz, dist 
      px, py, pz = getCameraMatrix( ) 
         tx, ty, tz = getElementPosition( PedPolice ) 
         dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) 
         if dist < 30.0 then 
               local sx, sy, sz = getPedBonePosition( PedPolice, 5 ) 
               local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.5 ) 
               if x then -- getScreenFromWorldPosition returns false if the point isn't on screen 
               exports["(GW)3DText"]:create3DTextLabel("LEI",0xAARRGGBB,x-100,y,x,y,15,0,default-bold,1) 
               end 
         end 
      end 
) 
  

Error line:

               exports["(GW)3DText"]:create3DTextLabel("LEI",0xAARRGGBB,x-100,y,x,y,15,0,default-bold,1) 

Error:

Loading of script failed (GW)LEI/client.lua:40 malfored number near 0xAARRGGBB 

The resource i'm using the export function : viewtopic.php?f=108&t=79794

The code worked good with dxDrawText

dxDrawText( "LEI", x-100, y, x, y, tocolor(0, 0, 255), 0.85 + ( 15 - dist ) * 0.02, "bankgothic" ) 

Hope someone can help me.

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...