Jump to content

Teams texts with dxDrawText


SoiiNoob

Recommended Posts

Posted (edited)

like

fail example:

function createText () 
local taxi = getTeamName ("teamtaxi") 
dxDrawText (taxi, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
end 
function HandleTheRendering ( ) 
    addEventHandler ( "onClientRender", root, createText ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) 

Edited by Guest
Posted
local width,height = guiGetScreenSize() 
function createText(player) 
local player = localPlayer 
local playerTeam = getPlayerTeam(player) 
local team = getTeamName(playerTeam) 
    if ( team ) then 
        dxDrawText ("Team: "..team.."", width - 210, height - 41, width, height, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
    else 
        dxDrawText ("Team: None", width - 210, height - 41, width, height, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
    end 
end 
addEventHandler ( "onClientRender", root, createText ) 
addEventHandler( "onClientResourceStart", resourceRoot, createText ) 

https://wiki.multitheftauto.com/wiki/GuiGetScreenSize

https://wiki.multitheftauto.com/wiki/GetPlayerTeam

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
That won't work, onClientRender doesn't have a player argument.

worked for me. single poblem is debugscript flood when someone leaves the team.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Oh it will work, but it should be:

local width,height = guiGetScreenSize() 
function createText() 
local playerTeam = getPlayerTeam(localPlayer) 
if playerTeam then 
local team = getTeamName(playerTeam) 
        dxDrawText ("Team: "..team, width - 210, height - 41, width, height, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
else 
        dxDrawText ("Team: None", width - 210, height - 41, width, height, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) 
    end 
end 
addEventHandler ( "onClientRender", root, createText ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

You want to show on player screen the amount of players on his/her team?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You want to change the font of team name on scoreboard?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Scoreboard has a settings window, you can try changing it there?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you change it on your side, it'll be changed only for you.

But you can change the default settings when a player joins the game.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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