Jump to content

[Problem] getplayercolorname


//_Dragon

Recommended Posts

Posted
And please dont try to copy again my tags in global chat.He wants this :P

Yours is not the only server to have such tags. You copied someone else's just as much as he's "copied yours". :roll:

Posted

Do you get any debug messages when using only getPlayerName? As far as I'm aware, getPlayerName should return the full name, including any hex colour. For example;

getPlayerName(thePlayer) 
-- #454545Dealman 

And since you've set colour-coded to true, it should work without having to use getPlayerNametagColor.

Edit:

Stop PM'ing me when you already have a thread made. Other people might benefit from the assistance given here, not from my PM inbox :lol:

Posted

Dude, the only time you try to use 'source' is in getPlayerName and getPlayerNametagColor. Is that a coincidence that the WARNING message occurs only on those lines? (The ERROR message occurs because getPlayerNametagColor fails)

Posted
Dude, the only time you try to use 'source' is in getPlayerName and getPlayerNametagColor. Is that a coincidence that the WARNING message occurs only on those lines? (The ERROR message occurs because getPlayerNametagColor fails)

What i can do ? i can change (source)maybe (name) ?

Posted

I want add here hex too but doesnt work :/ ?

function giveSomeoneMoney(player, cmd, target, amount) 
if target then 
if amount then 
local money = getPlayerMoney(player) 
local targetplayer = getPlayerFromName(target) 
local r, g, b = getPlayerNametagColor(player) 
local hex = string.format("#%.2X%.2X%.2X", r, g, b) 
amount = tonumber(amount) 
if targetplayer then 
if money >= amount and amount >= 250 then 
givePlayerMoney(targetplayer, amount) 
takePlayerMoney(player, amount) 
outputChatBox("..getPlayerName(player).." give "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 0, 165, 0, true) 
 

Posted

try this

outputChatBox(getPlayerName(player).." give "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 0, 165, 0, true) 

Posted
try this
outputChatBox(getPlayerName(player).." give "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 0, 165, 0, true) 

i've it dude but after adding hex wont work

function giveSomeoneMoney(player, cmd, target, amount) 
if target then 
if amount then 
local money = getPlayerMoney(player) 
local targetplayer = getPlayerFromName(target) 
local r, g, b = getPlayerNametagColor(player) 
local hex = string.format("#%.2X%.2X%.2X", r, g, b) 
amount = tonumber(amount) 
if targetplayer then 
if money >= amount and amount >= 250 then 
givePlayerMoney(targetplayer, amount) 
takePlayerMoney(player, amount) 
outputChatBox("..getPlayerName(player).." give "..amount.." to "..getPlayerName(targetplayer), getRootElement(), 0, 165, 0, true) 
 

Posted

Where did you add hex? Am I blind or what? I don't see it. However, I do see that you can't even script in Lua if you don't see string formatting/syntax mistakes in your code when they're syntax-highlighted (on this forum).

Posted

Droam|Oussez,

Don't come here asking questions and then remove all of your posts... don't post your friggin code in the first place if don't want anyone to use it or learn from it.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...