Jump to content

getPlayerNametagColor


Recommended Posts

Posted

Hello, can somebody help me i want use getPlayerNametagColor for those scripts

function giveSomeoneMoney(player, cmd, target, amount) 
    if target then 
        if amount then 
            local money = getPlayerMoney(player) 
            local targetplayer = getPlayerFromParticalName(target) 
            amount = tonumber(amount) 
            if targetplayer then 
                if money >= amount then 
                    givePlayerMoney(targetplayer, amount) 
                    takePlayerMoney(player, amount) 
                    outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, true) 
                else 
                    outputChatBox("You don't have enought money!", player, 255, 0, 0) 
                end 
            else 
                outputChatBox("Error: Player not found", player, 255, 0, 0) 
            end 
        else 
            outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) 
        end 
    else  
        outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) 
    end 
end 
addCommandHandler("givemoney", giveSomeoneMoney) 
  
  
function getPlayerFromParticalName(thePlayerName) 
    local thePlayer = getPlayerFromName(thePlayerName) 
    if thePlayer then 
        return thePlayer 
    end 
    for _,thePlayer in ipairs(getElementsByType("player")) do 
        if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then 
            return thePlayer 
        end 
    end 
return false 
end 
  
  

And this

addEventHandler("onPlayerChat", root, 
function(msg, msgType) 
    if msgType == 1 then 
        cancelEvent() 
        outputChatBox("* #FFFFFF"..getPlayerName(source).."#0064FF "..msg, root, 255, 0, 0, true) 
    end 
end) 

Thanks for helping.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
getPlayerNametagColor 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Bump...

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
addEventHandler ( "onPlayerChat", root, 
    function ( msg, msgType ) 
        if ( msgType == 1 ) then 
            cancelEvent ( ) 
            local r, g, b = getPlayerNametagColor ( source ) 
            outputChatBox ( "* #FFFFFF".. getPlayerName ( source ) .."#0064FF ".. msg, root, r, g, b, true ) 
        end 
    end 
) 

Is this what you need?

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

Yes, and for this too

function giveSomeoneMoney(player, cmd, target, amount) 
    if target then 
        if amount then 
            local money = getPlayerMoney(player) 
            local targetplayer = getPlayerFromParticalName(target) 
            amount = tonumber(amount) 
            if targetplayer then 
                if money >= amount then 
                    givePlayerMoney(targetplayer, amount) 
                    takePlayerMoney(player, amount) 
                    outputChatBox("#FF0000"..getPlayerName(player).."#0096FF gaved #00FF00$"..amount.."#0096FF to #FF9600"..getPlayerName(targetplayer), getRootElement(), 0, 81, 255, true) 
                else 
                    outputChatBox("You don't have enought money!", player, 255, 0, 0) 
                end 
            else 
                outputChatBox("Error: Player not found", player, 255, 0, 0) 
            end 
        else 
            outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) 
        end 
    else 
        outputChatBox("Error: /givemoney [player name] [amount]", player, 255, 0, 0) 
    end 
end 
addCommandHandler("givemoney", giveSomeoneMoney) 
  
  
function getPlayerFromParticalName(thePlayerName) 
    local thePlayer = getPlayerFromName(thePlayerName) 
    if thePlayer then 
        return thePlayer 
    end 
    for _,thePlayer in ipairs(getElementsByType("player")) do 
        if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then 
            return thePlayer 
        end 
    end 
return false 
end 
  
  

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Well, what stops you from doing what I did with the other one?

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

Im connected just from phone, and i copied the code from the top of the topic.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

I'm not going to do it all for you, is not what this section is about.

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

I tried to make it yesterday but i crashed it, it write instead of player name nil and r,g,b

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Post what you tried.

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

I'm at phone ._. when i come back i will post.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Bump

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Why are you bumping the topic if you can't even do what I said?

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

can you make it i did what u said but the script keep crashing...

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

i tried local rgb part from wiki...

local r, g, b = getPlayerNametagColor ( thePlayer ) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

I deleted the file because its useless, anyway can you make it?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

...Then why csmit helped me on another one without posting the code?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
I deleted the file because its useless, anyway can you make it?

We don't accept requests here.

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