ZeyadGTX Posted June 18, 2014 Share Posted June 18, 2014 Is there a way To See ( SPY) The Players PM , like who sents pm to each others ? Link to comment
xXMADEXx Posted June 18, 2014 Share Posted June 18, 2014 Yes, you can use the onPlayerPrivateMessage and log it somewhere. Link to comment
ZeyadGTX Posted June 18, 2014 Author Share Posted June 18, 2014 do you have ready-made script ? Link to comment
cheez3d Posted June 19, 2014 Share Posted June 19, 2014 Are you competent enough to make it yourself? Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 i don't know what to use ? Link to comment
mommytellme Posted June 19, 2014 Share Posted June 19, 2014 Create the own PM system, and every message export to logs using outputDebugString Link to comment
Et-win Posted June 19, 2014 Share Posted June 19, 2014 Create the own PM system, and every message export to logs using outputDebugString outputServerLog You can use too. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 can you help me with script ? cause i tried it and onPlayerPrivateMessage Link to comment
Et-win Posted June 19, 2014 Share 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. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share 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) Link to comment
cheez3d Posted June 19, 2014 Share Posted June 19, 2014 https://wiki.multitheftauto.com/wiki/Sc ... troduction You're welcome. Link to comment
Et-win Posted June 19, 2014 Share 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. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 its not workig at all nvm some moderator close this topic Link to comment
Et-win Posted June 19, 2014 Share Posted June 19, 2014 It will be putted into the server log, not in the chatbox or debug and not sure about console. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 its client side right , oututchatBox is Server side Link to comment
cheez3d Posted June 19, 2014 Share Posted June 19, 2014 outputChatBox is a shared function. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share 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 Link to comment
Et-win Posted June 19, 2014 Share 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. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 e.e but my pm system is /w playername message Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 any way its not working in Serverside too Link to comment
Et-win Posted June 19, 2014 Share 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. Link to comment
ZeyadGTX Posted June 19, 2014 Author Share Posted June 19, 2014 function PM(theMessage, thePlayer) outputServerLog("From: "..getPlayerName(source).." to: "..getPlayerName(thePlayer)..": "..theMessage) end addEventHandler("onPlayerChat", getRootElement(), PM) Link to comment
-.Paradox.- Posted June 20, 2014 Share 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 Link to comment
ZeyadGTX Posted June 20, 2014 Author Share Posted June 20, 2014 (edited) Thanks Edited June 20, 2014 by Guest Link to comment
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