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:

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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:

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

Does it output any message at all? If it doesn't output any message, it's possible the message is too long.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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)

Previously known as MrTasty.

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) 

 DUyJ810.gif

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

Previously known as MrTasty.

Posted

He can't make a simple

outputChatBox 

but at more complicated scripts..Better unistall mta and leave this game

My scripting skills

 


76561198189590622.pngAddFriend.png

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.

Discord: its.tails

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

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