-Doc- Posted July 5, 2015 Posted July 5, 2015 Hi. I edited this code and its showing bad argument @ getPlayerNametagColor function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) local red, green, blue = getPlayerNametagColor ( thePlayer ) local hex = RGBToHex ( red, green, blue ) if sendToName then if (getPlayerFromParticalName (sendToName)) then toPlayer = (getPlayerFromParticalName (sendToName)) if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#FFFFFF[PM] Message to "..hex.."" .. getPlayerName(toPlayer) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FFFFFF[PM] Message from "..hex.."" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#FFFFFF[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#FFFFFF[PM]#00ccff You cannot PM yourself #ff9900!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#FFFFFF[PM]#00ccff Player not found! #FFFF00[#ff9900"..sendToName.."#FFFF00]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#FFFFFF[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) return false end end addCommandHandler("pm", privateMessage) function RGBToHex(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return nil end return string.format("#%.2X%.2X%.2X", red, green, blue) end 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
DNL291 Posted July 5, 2015 Posted July 5, 2015 I see no error in getPlayerNametagColor function. It will only get errors if the script is set as client-side. Try to debug that code by using outputChatBox/outputDebugString.
joaosilva099 Posted July 5, 2015 Posted July 5, 2015 it will return that obviously since you are typing the command in the server console.
xeon17 Posted July 5, 2015 Posted July 5, 2015 Omg. Im asking for help not for not for... it will return that obviously since you are typing the command in the server console. You're too stupid to be helped and it's not the first time. He gave you the anwer which you need what do you want more?
-Doc- Posted July 5, 2015 Author Posted July 5, 2015 Yes working but nametag color uhh...It doesnt show player nametag color when i send it its showing mine.
John Smith Posted July 5, 2015 Posted July 5, 2015 Only thing you use this forum for is to get all your resources fixed You don't even bother to learn anything about scripting.
-.Paradox.- Posted July 6, 2015 Posted July 6, 2015 Only thing you use this forum for is to get all your resources fixedYou don't even bother to learn anything about scripting. Agreed
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