ZeyadGTX Posted June 18, 2014 Posted June 18, 2014 Is there a way To See ( SPY) The Players PM , like who sents pm to each others ?
xXMADEXx Posted June 18, 2014 Posted June 18, 2014 Yes, you can use the onPlayerPrivateMessage and log it somewhere.
mommytellme Posted June 19, 2014 Posted June 19, 2014 Create the own PM system, and every message export to logs using outputDebugString
Et-win Posted June 19, 2014 Posted June 19, 2014 Create the own PM system, and every message export to logs using outputDebugString outputServerLog You can use too.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 can you help me with script ? cause i tried it and onPlayerPrivateMessage
Et-win Posted June 19, 2014 Posted June 19, 2014 function randomname(theMessage --[[Message]], thePlayer --[[The player where the message is send to]]) --You can do the rest. (source = the player who send the message end addEventHandler("onPlayerPrivateMessage", getRootElement(), randomname) Good luck, you should try to make it by yourself.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 you mean like this ? , i don't understand function PM(theMessage, thePlayer) --You can do the rest. (source = the player who send the message end addEventHandler("onPlayerPrivateMessage", getRootElement(), randomname)
cheez3d Posted June 19, 2014 Posted June 19, 2014 https://wiki.multitheftauto.com/wiki/Sc ... troduction You're welcome.
Et-win Posted June 19, 2014 Posted June 19, 2014 function PM(theMessage, thePlayer) outputServerLog("From: "..getPlayerName(source).." to: "..getPlayerName(thePlayer)..": "..theMessage) end addEventHandler("onPlayerPrivateMessage", getRootElement(), PM) Next script not helping. Go read and learn the link he posted above my post.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 its not workig at all nvm some moderator close this topic
Et-win Posted June 19, 2014 Posted June 19, 2014 It will be putted into the server log, not in the chatbox or debug and not sure about console.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 its client side right , oututchatBox is Server side
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 i tried this script server side and client not working , i have and this is my Pm system but ican't read others Pms function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if (getPlayerFromParticalName (sendToName)) then local toPlayer = (getPlayerFromParticalName (sendToName)) local toPlayerTeam = getPlayerTeam(toPlayer) if toPlayerTeam then local toRed, toGreen, toBlue = getTeamColor(toPlayerTeam) toColor = string.format("#%02X%02X%02X", toRed, toGreen, toBlue) else toColor = '#ffffff' end local fromPlayerTeam = getPlayerTeam(thePlayer) if fromPlayerTeam then local fromRed, fromGreen, fromBlue = getTeamColor(fromPlayerTeam) fromColor = string.format("#%02X%02X%02X", fromRed, fromGreen, fromBlue) else fromColor = '#ffffff' end if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#FF4646(WHISPER) To ".. toColor .. getPlayerName(toPlayer) .. ":#FFFFFF " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF4646(WHISPER) From " .. fromColor .. getPlayerName(thePlayer) .. ":#FFFFFF " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#FF4646(WHISPER)#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [player name] [message]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF You cannot Whisper yourself#FFFFFF!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF Player not found! #FFFF00(#FFFFFF"..sendToName.."#FFFF00)", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [partical player name] [message]", thePlayer, 255, 255, 255, true) return false end end addCommandHandler("pm", privateMessage) addCommandHandler("w", privateMessage) 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
Et-win Posted June 19, 2014 Posted June 19, 2014 No, that script I posted have to be serverside, because onPlayerPrivateMessage is serverside only. e.e So that would be why it's not working.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 e.e but my pm system is /w playername message
Et-win Posted June 19, 2014 Posted June 19, 2014 any way its not working in Serverside too Checked the server log files? Anyway I just used the code one of the people posted here. If there is nothing in the server log files, then change onPlayerPrivateMessage to onPlayerChat , then it should work.
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 function PM(theMessage, thePlayer) outputServerLog("From: "..getPlayerName(source).." to: "..getPlayerName(thePlayer)..": "..theMessage) end addEventHandler("onPlayerChat", getRootElement(), PM)
-.Paradox.- Posted June 20, 2014 Posted June 20, 2014 function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if (getPlayerFromParticalName (sendToName)) then local toPlayer = (getPlayerFromParticalName (sendToName)) local toPlayerTeam = getPlayerTeam(toPlayer) if toPlayerTeam then local toRed, toGreen, toBlue = getTeamColor(toPlayerTeam) toColor = string.format("#%02X%02X%02X", toRed, toGreen, toBlue) else toColor = '#ffffff' end local fromPlayerTeam = getPlayerTeam(thePlayer) if fromPlayerTeam then local fromRed, fromGreen, fromBlue = getTeamColor(fromPlayerTeam) fromColor = string.format("#%02X%02X%02X", fromRed, fromGreen, fromBlue) else fromColor = '#ffffff' end if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#FF4646(WHISPER) To ".. toColor .. getPlayerName(toPlayer) .. ":#FFFFFF " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF4646(WHISPER) From " .. fromColor .. getPlayerName(thePlayer) .. ":#FFFFFF " .. pmMessage, toPlayer, 255, 255, 255, true) outputServerLog("(WHISPER) From "..getPlayerName(thePlayer).." To ".. getPlayerName(toPlayer)..": " .. pmMessage) else outputChatBox("#FF4646(WHISPER)#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [player name] [message]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF You cannot Whisper yourself#FFFFFF!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF(WHISPER)#FFFFFF Player not found! #FFFF00(#FFFFFF"..sendToName.."#FFFF00)", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [partical player name] [message]", thePlayer, 255, 255, 255, true) return false end end addCommandHandler("pm", privateMessage) addCommandHandler("w", privateMessage) 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
ZeyadGTX Posted June 20, 2014 Author Posted June 20, 2014 (edited) Thanks Edited June 20, 2014 by Guest
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