Jump to content

Please help


Recommended Posts

Posted (edited)

Hey guys how to add palyerColor and playerName to dxDrawText ? i tried this codes but not working

function text (player, cmd)
        local name = getPlayerName(player)
        local r,g,b = getPlayerNametagColor (player)
  etc...
  ....

and here is the dxDrawText

        dxDrawText(""..name.." text", r, g, b, screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false)

also i removed the " playerColor r, g, b, "

i got this msg:

ERROR: attempt to concatenate local 'name' (a boolean value)

Edited by Snakegold
Posted
local gPName = getPlayerName(getLocalPlayer())
dxDrawText(gPName.." text", screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(255, 255, 255, 255), 1.50, "bankgothic", "left", "top", false, false, false, true, false)

 

Posted
        local name = getPlayerName(localPlayer) 
local r, g, b = getPlayerNametagColor(localPlayer) 
dxDrawText(""..name.." text", screenW * 0.2291, screenH * 0.1966, screenW * 0.7716, screenH * 0.2552, tocolor(r , g , b , 255), 1.50, "bankgothic", "left", "top", false, false, false, false, false)

 

  • Moderators
Posted
Just now, Snakegold said:

Bro why dxDrawtext appears only to me not everyone????

Because each computer is processing the same code. And localPlayer/getLocalPlayer() is used to get the player that is being controlled.

  • Moderators
Posted

If you say so, then ok here you are:

 

local players = getElementsByType ("player", root, true)

for i=1, #players do
	local player = players[i]
	-- do your thing
end

 

 

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