• /me commands
    13 replies, posted
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
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerCanSeePlayersChat]GM/PlayerCanSeePlayersChat[/url]
k [editline]28th March 2016[/editline] [QUOTE=Neat-Nit;50016817][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerCanSeePlayersChat]GM/PlayerCanSeePlayersChat[/url][/QUOTE] This doesnt help, what do i do?
What do you mean it doesn't help?
[QUOTE=timz9;50020369]What do you mean it doesn't help?[/QUOTE] 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.
[QUOTE=The Commander;50020549]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.[/QUOTE] 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
[QUOTE=Eddy_;50020748]If anyone tell me where it says on how to do fix it on GM/PlayerCanSeePlayersChat Then i can do it from there[/QUOTE] 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.
[QUOTE=Tupac;50020788]Here's a hint: Check if text is /me. If it is, return false.[/QUOTE] 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. [url]https://wiki.garrysmod.com/page/Entity/GetPos[/url] [url]https://wiki.garrysmod.com/page/math/Distance[/url]
[QUOTE=WeeabooSlayer;50020812]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. [URL]https://wiki.garrysmod.com/page/Entity/GetPos[/URL] [URL]https://wiki.garrysmod.com/page/math/Distance[/URL][/QUOTE] [URL="http://wiki.garrysmod.com/page/GM/PlayerCanSeePlayersChat"] http://wiki.garrysmod.com/page/GM/PlayerCanSeePlayersChat[/URL] Is a server sided function, no LocalPlayer() --- Don't you mean Vector:Distance( Vector ) [URL]http://wiki.garrysmod.com/page/Vector/Distance[/URL] 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 [code] 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 ) [/code] 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.
Sorry, you need to Log In to post a reply to this thread.