Bc# Posted November 15, 2012 Share Posted November 15, 2012 I need to make it in this picture is in color and with another source. Try the function: dxDrawColorText But it did not work. I'm not sure which is published in the race_client specifically within this function: function Spectate.setTarget( player ) if Spectate.hasDroppedCamera() then return end Spectate.active = true Spectate.target = player if Spectate.target then if Spectate.getCameraTargetPlayer() ~= Spectate.target then setCameraTarget(Spectate.target) end guiSetText(g_GUI.speclabel, 'Currently spectating:\n' .. getPlayerName(Spectate.target)) else local x,y,z = getElementPosition(g_Me) x = x - ( x % 32 ) y = y - ( y % 32 ) z = getGroundPosition ( x, y, 5000 ) or 40 setCameraTarget( g_Me ) setCameraMatrix( x,y,z+10,x,y+50,z+60) guiSetText(g_GUI.speclabel, 'Currently spectating:\n No one to spectate') end if Spectate.active and Spectate.savePos then guiSetText(g_GUI.speclabel, guiGetText(g_GUI.speclabel) .. "\n\nPress 'B' to join") end end Any help or idea how to do it? PD: Sorry for my English. Link to comment
myonlake Posted November 15, 2012 Share Posted November 15, 2012 dxDrawText function allows color codes nowadays. You can use that without any problems, do not use dxDrawColorText, which the Wiki also sets as deprecated. Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 dxDrawText function allows color codes nowadays. You can use that without any problems, do not use dxDrawColorText, which the Wiki also sets as deprecated. I also used dxDrawText and does not work Link to comment
TAPL Posted November 15, 2012 Share Posted November 15, 2012 i don't see dxDrawText or dxDrawColorText in your code. Post your code where you have tried with dxDrawText. Link to comment
myonlake Posted November 15, 2012 Share Posted November 15, 2012 It works perfectly if you use it correctly. Remember to use the hex color code. Otherwise it won't work of course. Link to comment
Kenix Posted November 15, 2012 Share Posted November 15, 2012 dxDrawText function allows color codes nowadays. You can use that without any problems, do not use dxDrawColorText, which the Wiki also sets as deprecated. I also used dxDrawText and does not work colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set. Set colorCoded argument to true. Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 dxDrawText ( 'Currently spectating:\n' .. getPlayerName(Spectate.target), 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) Try this, but did not work. Link to comment
Anderl Posted November 15, 2012 Share Posted November 15, 2012 dxDrawText function allows color codes nowadays. You can use that without any problems, do not use dxDrawColorText, which the Wiki also sets as deprecated. I also used dxDrawText and does not work colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set. Set colorCoded argument to true. Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 ._.? Is it right what I did? If I could give an example please. Link to comment
Anderl Posted November 15, 2012 Share Posted November 15, 2012 Read what Kenix said first. Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 dxDrawText ( '#333333C#ffffffurrently #333333S#ffffffpectating:\n' .. getPlayerName(Spectate.target), 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown", colorCoded=true ) Is this what you were talking about? Link to comment
Anderl Posted November 15, 2012 Share Posted November 15, 2012 No, that makes completely no sense. Read Lua functions syntax and dxDrawText's syntax, you should fill all parameters till the one you need and you just write the value of the argument, there's no such thing like "colorCoded=true". Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 No, that makes completely no sense. Read Lua functions syntax and dxDrawText's syntax, you should fill all parameters till the one you need and you just write the value of the argument, there's no such thing like "colorCoded=true". dxDrawText ( '#333333C#ffffffurrently #333333S#ffffffpectating:\n' .. getPlayerName(Spectate.target), 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown", true ) Is that it? Link to comment
TAPL Posted November 15, 2012 Share Posted November 15, 2012 No. You must supplied all previous arguments before the argument you wanted to use. https://wiki.multitheftauto.com/wiki/Optional_arguments Link to comment
Bc# Posted November 15, 2012 Author Share Posted November 15, 2012 I do not understand the wiki could give me an example please. Link to comment
Anderl Posted November 15, 2012 Share Posted November 15, 2012 Mother of god. function test( arg1, arg2, arg3, arg4, arg5 ) --some code here end --Now I want to pass arg5 so I MUST PASS PREVIOUS ARGUMENTS: test( value, value, value, value, newValue ) -- 'newValue' is arg5's value Link to comment
Bc# Posted November 16, 2012 Author Share Posted November 16, 2012 Mother of god. function test( arg1, arg2, arg3, arg4, arg5 ) --some code here end --Now I want to pass arg5 so I MUST PASS PREVIOUS ARGUMENTS: test( value, value, value, value, newValue ) -- 'newValue' is arg5's value I tried using it but it does not work. I therefore call examples, I already have tried everything and it does not work. My other option would be to delete the text and create a resource that can show the player in that position I'm seeing. Is not it could be done? Link to comment
myonlake Posted November 16, 2012 Share Posted November 16, 2012 How hard can it be. Client-side dxDrawText("#333333C#ffffffurrently #333333S#ffffffpectating:\n" .. getPlayerName(Spectate.target), 44, screenHeight - 43, screenWidth, screenHeight, tocolor(255, 255, 255, 255), 1, "pricedown", "left", "top", false, false, true, true, true) Link to comment
Anderl Posted November 16, 2012 Share Posted November 16, 2012 Mother of god. function test( arg1, arg2, arg3, arg4, arg5 ) --some code here end --Now I want to pass arg5 so I MUST PASS PREVIOUS ARGUMENTS: test( value, value, value, value, newValue ) -- 'newValue' is arg5's value I tried using it but it does not work. I therefore call examples, I already have tried everything and it does not work. My other option would be to delete the text and create a resource that can show the player in that position I'm seeing. Is not it could be done? That must be a joke.. Don't you just get it that it was an example code to show you how argument passing works and not a magic code for you? Link to comment
Bc# Posted November 16, 2012 Author Share Posted November 16, 2012 It bug, not shown and not shown DxDrawText the person you are spectating. Link to comment
myonlake Posted November 16, 2012 Share Posted November 16, 2012 It bug, not shown and not shown DxDrawText the person you are spectating. Don't start scripting if you don't know the basics of anything. https://wiki.multitheftauto.com/wiki/Scr ... troduction Link to comment
Bc# Posted November 17, 2012 Author Share Posted November 17, 2012 one thing to know to make custom scripts and other scripts that is to understand other people, I and I have the most basic knowledge about aveses script but that's not enough. Just remember when you started making script if I was different. I know the DxDrawTex is fine, but to replace it we take a fundamental part of the function. So will erase what you write and are in another lua script that does not interfere with the function. Link to comment
Anderl Posted November 17, 2012 Share Posted November 17, 2012 I didn't really get you now. 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