Jump to content
  • 0

BF4 !


B7ackhawk

Question

Hello guys i need help

i blocked explosive from locker + metro .  but i have problem , spam in chat 

can some one edit this warring privateMessage only for player , now its globalMessage 

CODE

if (Regex.Match(kill.Weapon, @"(_:SMK|FLASH|Shield)", RegexOptions.IgnoreCase).Success) return false;

// show warnings at procon chattab
// yes = true | no = false
bool bShowToProcon = true;

String kCounter = killer.Name + "_NoExplosives_Count";
TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1

int warnings = 0;

if (limit.Activations(killer.Name, time) > 1) return false;

if (plugin.RoundData.issetInt(kCounter)) warnings = plugin.RoundData.getInt(kCounter);

if (warnings >= 0 && warnings <= 4) {
    String globalMessage = killer.FullName + " WARNING for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
    return false;
} else if (warnings == 5) {
    String globalMessage = killer.FullName + " WARNING for explosive kill on " + plugin.FriendlyMapName(server.MapFileName) + "!";
    plugin.SendGlobalMessage(globalMessage);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Say > " + globalMessage);
    String privateMessage = "FINAL WARNING (" + (warnings+1) + "/6)! Explosives are not allowed on " + plugin.FriendlyMapName(server.MapFileName) + "! Read our rules!";
    plugin.SendPlayerYell(killer.Name, privateMessage, 10);
    if (bShowToProcon) plugin.PRoConChat("NoExplosives > Yell[10] > " + killer.Name + " > " + privateMessage);
    plugin.RoundData.setInt(kCounter, warnings+1);
} else if (warnings >= 6) {
    plugin.KickPlayerWithMessage(player.Name, plugin.R("Kicked for ignoring warnings and killing with explosives!"));
}
plugin.RoundData.setInt(kCounter, warnings+1);
return false;

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Where do you see a global msg?

   plugin.SendPlayerYell(killer.Name, privateMessage, 10);

i only see playeryells.... There is not a public yell?

Need new plugin features? I can change: Adkats, AdKatsLRT, LanguageEnforcer, InsaneLimits, xVotemap for you. Also working on new plugins. Have an idea? Share it and I might include it in my repos. Github.com/hedius

 

Check out E4GLAdKats for an advancded and maintained AdKats version.

Link to comment
Share on other sites

On 3/4/2020 at 12:25 AM, Hedius said:

Where do you see a global msg?


   plugin.SendPlayerYell(killer.Name, privateMessage, 10);

i only see playeryells.... There is not a public yell?

 WARNING for explosive kill on " + plugin.FriendlyMapName(server.MapFileName)

 

that what u mean chat bee spam they cant read rules or .......

Link to comment
Share on other sites

1 hour ago, B7ackhawk said:

 WARNING for explosive kill on " + plugin.FriendlyMapName(server.MapFileName)

 

that what u mean chat bee spam they cant read rules or .......

plugin.SendGlobalMessage(globalMessage);

change this to

// plugin.SendGlobalMessage(globalMessage);

then it will no longer appear public...

Or use 

    bool SendPlayerMessage(String name, String message, int delay)

to send the global message just to a player....

Is it that hard to read the manual?

plugin.SendPlayerMessage(killer.Name, globalMessage, 0)

Need new plugin features? I can change: Adkats, AdKatsLRT, LanguageEnforcer, InsaneLimits, xVotemap for you. Also working on new plugins. Have an idea? Share it and I might include it in my repos. Github.com/hedius

 

Check out E4GLAdKats for an advancded and maintained AdKats version.

Link to comment
Share on other sites

22 hours ago, Hedius said:

plugin.SendGlobalMessage(globalMessage);

change this to

// plugin.SendGlobalMessage(globalMessage);

then it will no longer appear public...

Or use 


    bool SendPlayerMessage(String name, String message, int delay)

to send the global message just to a player....

Is it that hard to read the manual?

plugin.SendPlayerMessage(killer.Name, globalMessage, 0)

thank you so much it worked 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.