xXGhostXx Posted September 15, 2018 Share Posted September 15, 2018 Hi guys ! This code for shout on player chat ! function faryad (thePlayer, cmd, ...) local MetrazhDadZadan = 20 local msg = table.concat({...}, " ") local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do outputChatBox(nick.." Shout : "..msg,v,255,255,255,true) end end addCommandHandler("s", faryad) Please fix problem code ! Thanks ! Link to comment
ZoNe Posted September 15, 2018 Share Posted September 15, 2018 function faryad (thePlayer, cmd, ...) local MetrazhDadZadan = 20 -- what is this? local msg = table.concat({...}, " ") local nick = getPlayerName(thePlayer) outputChatBox(nick.." Shout : "..msg,root,255,255,255,true) end addCommandHandler("s", faryad) Link to comment
Dimos7 Posted September 15, 2018 Share Posted September 15, 2018 (edited) function faryad (thePlayer, cmd, ...) local MetrazhDadZadan = 20 local msg = table.concat({...}, " ") local nick=getPlayerName(thePlayer) local x, y, z = getElementPosition(thePlayer) for _,v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(v) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) <= MetrazhDadZadan then outputChatBox(nick.." Shout : "..msg,v,255,255,255,true) end end end addCommandHandler("s", faryad) Edited September 15, 2018 by Dimos7 1 Link to comment
xXGhostXx Posted September 15, 2018 Author Share Posted September 15, 2018 7 hours ago, Dimos7 said: function faryad (thePlayer, cmd, ...) local MetrazhDadZadan = 20 local msg = table.concat({...}, " ") local nick=getPlayerName(thePlayer) local x, y, z = getElementPosition(thePlayer) for _,v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(v) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) <= MetrazhDadZadan then outputChatBox(nick.." Shout : "..msg,v,255,255,255,true) end end end addCommandHandler("s", faryad) I want players use empty command ChatBox : Syntax: /s <Text> Please fix script Link to comment
Dimos7 Posted September 15, 2018 Share Posted September 15, 2018 function faryad (thePlayer, cmd, ...) local MetrazhDadZadan = 20 local msg = table.concat({...}, " ") local nick=getPlayerName(thePlayer) local x, y, z = getElementPosition(thePlayer) for _,v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(v) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) <= MetrazhDadZadan then if msg ~="" then outputChatBox(nick.." Shout : "..msg,v,255,255,255,true) else return outputChatBox("Syntax:/"..cmd.." [text]", thePlayer, 255, 0, 0) end end end end addCommandHandler("s", faryad) 1 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