Jump to content

Making a /me command


BigBrother

Recommended Posts

only example

  
function meCom (Mens,typ) 
 if typ == 1 then 
local PlayersP = getElementsByType("player")) 
for _,Pl in ipairs(PlayersP) do 
local x,y,z = getElementPosition(Pl) 
local x2,y2,z2 = getElementPosition(source) -- source of the event "onPlayerChat" 
local Distance = getDistanceBetweenPoints2D ( x,y, x2,y2 ) -- you can use getDistanceBetweenPoints3D if want 
 if (Distance <= 10) then 
 outputChatBox(Mens,Pl) 
 --else 
 --cancelEvent() 
 end 
  end 
    end 
end 
addEventHandler("onPlayerChat",getRootElement(),meCom) 

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...