• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Not allow player to send private messages

Sleet

Member
Joined
Sep 3, 2016
Messages
107
Solutions
2
Reaction score
7
How do I disallow a player to send private messages to others?
Can it be done by any script?

Thanks in advance.

Edit:

I only want some players to be blocked from private chat
 
Last edited:
Geez, I completely forgot about that. Sorry, that rarely happens.
I'm using TFS 0.4 rev 3777.
Really sorry.
 
But then, I believe, private channels would cease to exist, am I right?

Edit:
Maybe it is possible to code a 'check' to see if the player is allowed to send messages. It would check the databse and if that specific collumn is 0 or NULL, he is allowed to do so, if it is 1, he isn't.

I just don't know how to make that happen.
 
https://otland.net/threads/updated-block-ips-0-3-6.93613
and some sort of;

if isPlayer(cid) and (check if channel parameter is private) and getPlayerStorageValue(cid,BLOCKKEY) == 1 then
return true
end

could work i guess. But that would block people using spells aswell if typing it in private channel

I already tried IP blocking the guy, but he keeps changing his IP so it makes no difference. I guess blocking his private channel communications would solve it.
 
I already tried IP blocking the guy, but he keeps changing his IP so it makes no difference. I guess blocking his private channel communications would solve it.
Nono this is a way of blocking certain people from typing in Private meddage as i said, implement this source edit and ill fix the lua script for you later today
 
Nono this is a way of blocking certain people from typing in Private meddage as i said, implement this source edit and ill fix the lua script for you later today

I don't know what do add/replace in the .cpp file(s). I'm not a programmer, sorry.
 
I don't know what do add/replace in the .cpp file(s). I'm not a programmer, sorry.
you might already have this function included in tfs 0.4, not sure, try it out;


XML:
    <talkaction words="illegalWords" default="1" script="blocktalk.lua"/>

blocktalk.lua
Lua:
function onSay(cid, words, param, channel)
 local block_private_msg = 68696  

if isPlayer(cid) and getPlayerStorageValue(cid,block_private_msg) > 0 and channel == CHANNEL_PRIVATE then 
    return true
end
     return false
end

and set storage of player 68696 to above 0 in order for it to block him talking in private chat
 
you might already have this function included in tfs 0.4, not sure, try it out;


XML:
    <talkaction words="illegalWords" default="1" script="blocktalk.lua"/>

blocktalk.lua
Lua:
function onSay(cid, words, param, channel)
 local block_private_msg = 68696 

if isPlayer(cid) and getPlayerStorageValue(cid,block_private_msg) > 0 and channel == CHANNEL_PRIVATE then
    return true
end
     return false
end

and set storage of player 68696 to above 0 in order for it to block him talking in private chat

Is it a talkaction? Because nothing happens.
Do I have to manually go to the database and set the storage to a value?
Or is it a globalevent?
 
it is indeed a talkactions, you have to manually set storage of player to 1 in order for it to block that player from talking into private channel (thought that's how you wanted it?)

if it still doesnt work you most likely have to add this source edit i linked you
 
Now I fully understood what the code you gave me does.
Problem is that he (the botter who announces in my server) does not use any illegal words. In fact, he announces his IP in numbers. So, I wanted to make a talkaction that blocks a specific player to send private messages.
Then the scripting idea came, I would create a talkaction that changes a specific player storage to 1 so that the player can't send any messages. That, I can do.
But then, I would have to source edit so as to check if the storage is 1 or 0 before the player sends his messages, either allowing or disallowing that to happen. That, I can't do. I don't even know if it is possible to do something like that in source editing.

TL;DR: I need to source edit my server to check if a player storage is 1 or not so as to allow the player to send messages or not.
 
I still don't think you understand what the script does. It has nothing to do with "illegal words", it is just called so, cause that's how it is defined in sources. The lua script doesn't check for certain words, it returns "true" if you have a certain storage -> which means that in the sources, the message will get canceled and not sent.

This single script works for all words said by any player, at any time. You do not have to make a check of storage in sources, it is already done in the lua script.

Either way, what is this way of combatting advertisers? A better solution would be to just simply ban them? Or I don't understand why you would like to manually "mute" them.
 
As I have already said: "I already tried IP blocking the guy, but he keeps changing his IP so it makes no difference. I guess blocking his private channel communications would solve it."

Alright, I will try the script. But what if the player storage doesn't appear?
 
As I have already said: "I already tried IP blocking the guy, but he keeps changing his IP so it makes no difference. I guess blocking his private channel communications would solve it."

Alright, I will try the script. But what if the player storage doesn't appear?
He will just create a new char and the limitations will be gone yet again. You can't prevent this other than disallowing people from posting his ip adress / domain name.

But even so, he will find smart ways to prevent this, like d_oMain_NaMe.com etc.

Make some rookgaard where it takes X time to get to mainland, then disallow people in rook from posting in private/help/trade or whatever. Then he has to waste his time to get to main land in order to be able to advertise. This is not efficent for him in the long run, because if you ban him once you see him advertise in main, he'll have to create a new account.
 
Back
Top