Jump to content

Please help


Recommended Posts

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
Link to comment
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)

 

Link to comment
        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)

 

Link to comment
  • Moderators
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.

Link to comment
  • Moderators
2 minutes ago, Snakegold said:

i want when i do the command or someone do it , everyone can see it , how?

Learn first what a element, table and a loop is.

 

After that I will provide you with examples, because else you will not understand the code.

https://wiki.multitheftauto.com/wiki/Element

https://www.lua.org/pil/2.5.html

https://www.lua.org/pil/4.3.5.html

 

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