-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 My scripting skills
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. Please do not PM me with scripting related question nor support, use the forums instead.
-Doc- Posted July 5, 2015 Author Posted July 5, 2015 Its a server side+ its not working My scripting skills
xeon17 Posted July 5, 2015 Posted July 5, 2015 Make a screenshot of the debug error. A unique GangWar gamemode waiting for you!Click here for more information.
joaosilva099 Posted July 5, 2015 Posted July 5, 2015 it will return that obviously since you are typing the command in the server console. http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
xeon17 Posted July 5, 2015 Posted July 5, 2015 Anyone? Please leave MTA. A unique GangWar gamemode waiting for you!Click here for more information.
-Doc- Posted July 5, 2015 Author Posted July 5, 2015 Omg. Im asking for help not for not for... My scripting skills
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? A unique GangWar gamemode waiting for you!Click here for more information.
-Doc- Posted July 5, 2015 Author Posted July 5, 2015 I tried and ingame and still same eroor My scripting skills
xeon17 Posted July 5, 2015 Posted July 5, 2015 I've tried it too and it works perfect. A unique GangWar gamemode waiting for you!Click here for more information.
-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. My scripting skills
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. If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
-.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 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.
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