Jump to content

[HELP] Nametag Color for Newbie


roddydennvor

Recommended Posts

Posted (edited)

Hello there ,,

I want to make script when the player play on my server under 13 hours , then the name color on scoreboard is yellow...

Server-side

  
local hoursplayed = getElementData(thePlayer, "hoursplayed") 
  
if hoursplayed < 13 then 
     exports.global:setPlayerNametagColor(targetPlayer , 255, 255, 0)  
end 
  
  

This Script not work..

Can you help me please ?

Thanks

Edited by Guest
Posted

"< 13" what? how do you define if someone is "new"? do you want to use his online time to define it?

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

In the script you posted, you are using two different player variables, one "thePlayer", and the other "targetPlayer", which one is the real one? can you post the complete code?

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

Then, you have to change "targetPlayer" to "thePlayer".

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

Post your entire script.

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

s_nametag

local hoursplayed = getElementData(thePlayer, "hoursplayed") 
  
if hoursplayed < 13 then 
exports.global:updateNametagColor(source) 
end 

nametag

function updateNametagColor(thePlayer) 
    if  getElementData(thePlayer, "hoursplayed") < 13 then  
        setPlayerNametagColor(thePlayer, 255, 255, 0) 
    end 
end 
  
for key, value in ipairs( getElementsByType( "player" ) ) do 
    updateNametagColor( value ) 
end  

Posted

That's your entire code...?

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 glad you figured it out, what was the problem? someone else might have a similar problem, and this could help.

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