i import chat flood protect but idk why its dont accept config delay
i change to 10 min or 1 sec but it still same i do it in java and config but not effect
say2.java
import com.l2.gameserver.util.FloodProtectorConfig;
...................
..........
....
break;
case SHOUT:
if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") ||
(Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT))
{
activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds.");
return;
}
int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
{
if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
player.sendPacket(cs);
}
}
else if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("global"))
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT))
{
activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds.");
return;
}
if (activeChar.getPvpKills()< Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)
{
activeChar.sendMessage("You need "+ Integer.toString(Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)+ " pvp points to use Global chat.");
return;
}
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
{
player.sendPacket(cs);
}
}
break;
case TRADE:
if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") ||
(Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.isGM()))
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT))
{
activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds.");
return;
}
if (activeChar.getPvpKills()< Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)
{
activeChar.sendMessage("You need "+ Integer.toString(Config.L2JMOD_MIN_PVP_POINTS_TO_TALK)+ " pvp points to use Global chat.");
return;
}
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
{
player.sendPacket(cs);
}
} else if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("limited"))
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT))
{
activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds.");
return;
}
int region = MapRegionTable.getInstance().getMapRegion(activeChar.getX(), activeChar.getY());
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
{
if (region == MapRegionTable.getInstance().getMapRegion(player.getX(),player.getY()))
player.sendPacket(cs);
}
}
break;
case ALL:
if (_text.startsWith("."))
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_GLOBALCHAT))
{
activeChar.sendMessage("Action failed. Players are only able to use channel once every 20 seconds.");
return;
}
case HERO_VOICE:
if (activeChar.isGM())
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE))
{
//Nothing here xD
}
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
if (!BlockList.isBlocked(player, activeChar))
player.sendPacket(cs);
}
else if (activeChar.isHero())
{
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_HEROVOICE))
{
activeChar.sendMessage("Action failed. Heroes are only able to speak in the global channel once every 10 seconds.");
return;
}
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
if (!BlockList.isBlocked(player, activeChar))
player.sendPacket(cs);
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
L2jMobius has a variety of servers, that all are actively developed.
https://gitlab.com/MobiusDevelopment/L2J_Mobius
Better version if you donate 200 euros to the project? Yes.
https://l2jmobius.org
A tutorial is provided.
https://l2jmobius.org/forum/index.php?topic=3231.0
Please do not come if you cannot compile and test on your own.
MidnightSell team WTB/WTS GOLD TWW EU/US all servers
Cataclysm all servers
Payment Visa/Master/Btc/Eth/Trc-20/Erc-20 (all payments within 10 min)
For all question pls dm
Discord https://discord.gg/h8AN57qJjK
Or Telegram @MidnightSell
Looking for gracia final or gracia epilogue java server. The seller must include full source files
test server is a must,please dont come with shared files. PM ME
Question
Bobi
i import chat flood protect but idk why its dont accept config delay
i change to 10 min or 1 sec but it still same i do it in java and config but not effect
say2.java
config.java
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.