Jump to content

[Help] Currently spectating


Bc#

Recommended Posts

I need to make it in this picture is in color and with another source.

currentlyspectating.png

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

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

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

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