Jump to content

Shout script


xXGhostXx

Recommended Posts

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
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
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 by Dimos7
  • Like 1
Link to comment
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
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)

 

  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...