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 ? My nick in MTA is Spider
xXMADEXx Posted June 18, 2014 Posted June 18, 2014 Yes, you can use the onPlayerPrivateMessage and log it somewhere. The Ultimate Lua Tutorial! | MTA PHP SDK
ZeyadGTX Posted June 18, 2014 Author Posted June 18, 2014 do you have ready-made script ? My nick in MTA is Spider
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 i don't know what to use ? My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 can you help me with script ? cause i tried it and onPlayerPrivateMessage My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
JR10 Posted June 19, 2014 Posted June 19, 2014 Moved to Scripting. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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) My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 its not workig at all nvm some moderator close this topic My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 its client side right , oututchatBox is Server side My nick in MTA is Spider
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 My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 e.e but my pm system is /w playername message My nick in MTA is Spider
ZeyadGTX Posted June 19, 2014 Author Posted June 19, 2014 any way its not working in Serverside too My nick in MTA is Spider
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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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) My nick in MTA is Spider
-.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 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.
ZeyadGTX Posted June 20, 2014 Author Posted June 20, 2014 (edited) Thanks Edited June 20, 2014 by Guest My nick in MTA is Spider
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