xXGhostXx Posted September 7, 2018 Share Posted September 7, 2018 Hi guys . What is problem in my script ? function adminpm ( thePlayer, command, taraf, message ) if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) How to fix text can not be sent more than one word. Please answer me. Link to comment
Dimos7 Posted September 7, 2018 Share Posted September 7, 2018 function adminpm ( thePlayer, command, taraf,... ) local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) try that Link to comment
xXGhostXx Posted September 8, 2018 Author Share Posted September 8, 2018 10 hours ago, Dimos7 said: function adminpm ( thePlayer, command, taraf,... ) local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) try that When i use /pm <PartOfName> An empty message will be sent. please fix my script Link to comment
iMr.WiFi..! Posted September 8, 2018 Share Posted September 8, 2018 Then: function adminpm ( thePlayer, command, taraf,... ) local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end if( message == nil or message == "" ) then outputChatBox("#ff0000[Error]: #ffffffWrite a message!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) Link to comment
xXGhostXx Posted September 8, 2018 Author Share Posted September 8, 2018 6 minutes ago, iMr.WiFi..! said: Then: function adminpm ( thePlayer, command, taraf,... ) local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end if( message == nil or message == "" ) then outputChatBox("#ff0000[Error]: #ffffffWrite a message!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) Not work ! Link to comment
iMr.WiFi..! Posted September 8, 2018 Share Posted September 8, 2018 (edited) Try this: function adminpm ( thePlayer, command, taraf,... ) if( #{...} == 0 ) then outputChatBox("#ff0000[Error]: #ffffffWrite a message!", thePlayer, 255, 255, 255, true) return false end local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) Edited September 8, 2018 by iMr.WiFi..! 1 Link to comment
xXGhostXx Posted September 8, 2018 Author Share Posted September 8, 2018 4 minutes ago, iMr.WiFi..! said: Try this: function adminpm ( thePlayer, command, taraf,... ) if( #{...} == 0 ) then outputChatBox("#ff0000[Error]: #ffffffWrite a message!", thePlayer, 255, 255, 255, true) return false end local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) Not work Debug error: server.lua:3: unexpected symbol near ' Link to comment
iMr.WiFi..! Posted September 8, 2018 Share Posted September 8, 2018 1 minute ago, xXGhostXx said: Not work Debug error: server.lua:3: unexpected symbol near ' Hmmm :/Show me the line. Link to comment
xXGhostXx Posted September 8, 2018 Author Share Posted September 8, 2018 2 minutes ago, iMr.WiFi..! said: Hmmm Show me the line. local nameadmin = getPlayerName( thePlayer ) 19 minutes ago, iMr.WiFi..! said: Hmmm Show me the line. Please answer me Link to comment
xXGhostXx Posted September 8, 2018 Author Share Posted September 8, 2018 1 hour ago, iMr.WiFi..! said: Try this: function adminpm ( thePlayer, command, taraf,... ) if( #{...} == 0 ) then outputChatBox("#ff0000[Error]: #ffffffWrite a message!", thePlayer, 255, 255, 255, true) return false end local message = table.concat ({...}, " ") if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000[Error]: #ffffffShoma Dastresi Be In Dastoor Nadarid!", thePlayer, 255, 255, 255, true) return false end if taraf == nil then outputChatBox("#00ff00Bezan: /pm <PartOfName> <Matn>", thePlayer, 255, 255, 255, true) return false end if not findPlayer(taraf) then outputChatBox("#ff0000[Error]: #ffffffPlayer Peyda Nashod!", thePlayer, 255, 255, 255, true) return false end local playerpm = findPlayer(taraf) local nameadmin = getPlayerName( thePlayer ) outputChatBox("#F39C12<< Be " ..taraf.. ": " ..message.. " >>", thePlayer, 255, 255, 255, true) outputChatBox("#F39C12<< [Admin PM] " ..nameadmin.. ": " ..message.. " >>", playerpm, 255, 255, 255, true) end addCommandHandler("pm", adminpm) Thanks . Fixed Link to comment
iMr.WiFi..! Posted September 8, 2018 Share Posted September 8, 2018 36 minutes ago, xXGhostXx said: Thanks . Fixed Your welcome ; ) 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