/me commands

Hello, I have a problem with my server. In our server we need to use /me for example /me “ties and gags the man”
But with our server when someone does /me it is global, everyone can see it but we want to have so the /me commands are local so the people can only see it.
If anyone can help please tell me. Thanks

GM/PlayerCanSeePlayersChat

k

[editline]28th March 2016[/editline]

This doesnt help, what do i do?

What do you mean it doesn’t help?

It doesnt show me anything on how to fix it

It’s called “learning”
No one is just going to “tell you” and give you the code to fix it.
They have linked you to the correct function you need to use, you just need to find out how to incorporate it into your code.

I have been trying to fix it, I just cant do it i really need help, Could you please tell where to find in

GM/PlayerCanSeePlayersChat

This probably won’t solve itself without some effort on your side.

You’ll either have to read yourself up on this, live on without it, or hope that some random person has enough time on his hands to help you.

If anyone tell me where it says on how to do fix it on GM/PlayerCanSeePlayersChat
Then i can do it from there

Make a function using PlayerCanSeePlayersChat
Nobody will do it for you, either learn it yourself or pay someone on script fodder

Here’s a hint:

Check if text is /me. If it is, return false.

Only if the person is far away enough, in which case you’d use LocalPlayer():GetPos(), loop through all the players and compare the distance with math.Distance.

http://wiki.garrysmod.com/page/GM/PlayerCanSeePlayersChat

Is a server sided function, no LocalPlayer()


Don’t you mean Vector:Distance( Vector )

For example:
LocalPlayer():GetPos():Distance( Vector )

math.Distance is meant for a 2D coordinate plane


Finally, all he needs to do is something like this:

Semi-pseudo



hook add bs ..., ..., function( Text, IsTeam, Listener, Speaker )

    if ( Text:sub( 1, 4 ) == "/me " and IsValid( Listener ) and IsValid( Speaker) ) then --IsValid check because I don't know if it returns a null entity when there is only 1 player, or doesn't call the function at all.

        return Listener:GetPos():Distance( Speaker:GetPos() ) < 256

    end

    return true

end )


Untested and I’ve never done anything like it, but in theory, it should work.

@OP

Basically spoon fed you 99% of the code.

disable ULX’ /me function, RPs shit works fine normally.