xeon17 Posted September 9, 2014 Posted September 9, 2014 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. A unique GangWar gamemode waiting for you!Click here for more information.
bandi94 Posted September 9, 2014 Posted September 9, 2014 "0xAARRGGBB" is not a color , it's a default form of hex color's. AA = alpha , RR = red , GG = green , BB = blue. So if you want white color you use : 0xFFFFFFFF , or tocolor(255,255,255,255) For more hex color codes check this out : http://www.color-hex.com/ Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
darhal Posted September 9, 2014 Posted September 9, 2014 why u dont use 3d labels script it very simple #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
xeon17 Posted September 9, 2014 Author Posted September 9, 2014 "0xAARRGGBB" is not a color , it's a default form of hex color's. AA = alpha , RR = red , GG = green , BB = blue. So if you want white color you use : 0xFFFFFFFF , or tocolor(255,255,255,255) For more hex color codes check this out : http://www.color-hex.com/ Thank you man , the error is fixed now but the problem is nothing happen now there isn't text on the ped.. A unique GangWar gamemode waiting for you!Click here for more information.
xeon17 Posted September 9, 2014 Author Posted September 9, 2014 Forgot to write , there is a error in debugscript3 exports["(GW)3DText"]:create3DTextLabel("LEI",0x0000FF,x-100,y,x,y,15,0,default-bold,1) debugscript3 : http://imgur.com/Wwna94Q.png without the argument ''defualt-bold'' there isn't a error in debugscript 3 , but there isn't text on the ped too. A unique GangWar gamemode waiting for you!Click here for more information.
xeon17 Posted September 9, 2014 Author Posted September 9, 2014 Solved. A unique GangWar gamemode waiting for you!Click here for more information.
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