roddydennvor Posted February 13, 2015 Posted February 13, 2015 (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 February 13, 2015 by Guest
Castillo Posted February 13, 2015 Posted February 13, 2015 "< 13" what? how do you define if someone is "new"? do you want to use his online time to define it?
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 yes , i want to use his spend time on my server... if his online time under 13 hours then his nametag color on score board turn yellow
Castillo Posted February 13, 2015 Posted February 13, 2015 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?
Castillo Posted February 13, 2015 Posted February 13, 2015 Then, you have to change "targetPlayer" to "thePlayer".
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 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
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 im so confused .. I just want to make that script from zero.. Can you help me to make this script ?
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 function updateNametagColor(thePlayer) if getElementData(thePlayer, "hoursplayed") < 13 then setPlayerNametagColor(thePlayer, 255, 255, 0) end end
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 haha i can make this script ! yeah,,, so simple but make me confused thanks for your help Solidsnake14 ,, Please Lock this thread
Castillo Posted February 13, 2015 Posted February 13, 2015 I'm glad you figured it out, what was the problem? someone else might have a similar problem, and this could help.
..:D&G:.. Posted February 13, 2015 Posted February 13, 2015 This script sounds valhalla to me "the export"
roddydennvor Posted February 13, 2015 Author Posted February 13, 2015 i forget to add "function updateNametagColor(thePlayer)"
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now