Raised This Month: $51 Target: $400
 12% 

How to stop spam chat message in this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Meelo
Member
Join Date: Aug 2010
Old 08-11-2019 , 19:25   How to stop spam chat message in this plugin
Reply With Quote #1

Can someone edit this:
Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <colorchat>


static const PLUGIN_NAME[]     = "Ownage";
static const PLUGIN_AUTHOR[]     = "lkz";
static const PLUGIN_VERSION[]    = "1.2";

new const TAG[] = "UNITABLE";

#pragma semicolon 1
#define TIME 30.0

new Float: Block[33];


new const Sounds[3][] = {


    "misc/ownage.wav","misc/ownage2.wav",
    "misc/ownage3.wav"

};


public plugin_precache() {
    
   
        precache_sound("sound/misc/ownage.wav");
        precache_sound("sound/misc/ownage2.wav");
        precache_sound("sound/misc/ownage3.wav");
        
   
        
}

public plugin_init() {
    
        register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
    
        register_forward(FM_Touch, "fwd_Owning");
    
       
    
}

public client_connect(id) {
    
    Block[id] = get_gametime();

}

public fwd_Owning(owned, owner) {
    
    static OwnedClassname[32],OwnerClassname[32];
    pev(owned,pev_classname,OwnedClassname, 31);
    pev(owner, pev_classname, OwnerClassname, 31);
    
    if(!equal(OwnedClassname, "player") || !equal(OwnerClassname, "player")) return FMRES_IGNORED;
    
    if(!is_user_ok(owned) || !is_user_ok(owner) ) return FMRES_IGNORED;
    
    if(cs_get_user_team(owner)  == CS_TEAM_CT || cs_get_user_team(owner) ==      cs_get_user_team(owned)) return FMRES_IGNORED;
    

    static Float:OwnedOrigin[3],Float:OwnerOrigin[3];
    pev(owned, pev_origin, OwnedOrigin);
    pev(owner, pev_origin, OwnerOrigin);
        
    new Float:OwnDistance = OwnerOrigin[2] - OwnedOrigin[2];
        
    
    if( OwnDistance >= 35 ) {

        if((get_gametime() - Block[owner] > 3.0)) {

            new name[32],name2[32];
            get_user_name(owner,name,31);
            get_user_name(owned,name2,31);
           
            ColorChat(0,RED,"^x04[%s]^x03 %s^x01 OWNED^x03 %s^x01  !",TAG,name,name2);
            
            client_cmd(0,"spk %s",Sounds[random_num(0,10)]);
            
            ShakeScreen(owned);
            FadeScreen(owned);
            Block[owner] = get_gametime();

            return FMRES_IGNORED;
        }
    }

    return FMRES_IGNORED;
}
stock is_user_ok(id) {
    
    if(is_user_alive(id) && is_user_connected(id) && !is_user_bot(id))
        return 1;
        
    return 0;
}
ShakeScreen(id) {
    
    message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},id);
    write_short(floatround(4096.0 * 3.0, floatround_round));
    write_short(floatround(4096.0 * 3.0, floatround_round));
    write_short(1<<13);
    message_end();
    
}

FadeScreen(id) {  
                
    message_begin(MSG_ONE, get_user_msgid("ScreenFade"), _, id);
    write_short(floatround(4096.0 * 3.0, floatround_round));
    write_short(floatround(4096.0 * 3.0, floatround_round));
    write_short(0x0000);
    write_byte(255);
    write_byte(0);
    write_byte(0);
    write_byte(110);
    message_end();

}
to stop sending 2-3x chat messages in one second? if a guy jump on another guy's head i want only one message in chat;s
Meelo is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 08-11-2019 , 23:22   Re: How to stop spam chat message in this plugin
Reply With Quote #2

Use a better plugin.

https://forums.alliedmods.net/showthread.php?t=316888
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Meelo
Member
Join Date: Aug 2010
Old 08-12-2019 , 05:24   Re: How to stop spam chat message in this plugin
Reply With Quote #3

but with this plugin player 1 have to take dmg from player 2, i dont want to damage any player, just a simple message when one jump on another one's head
Meelo is offline
Old 08-12-2019, 05:40
Natsheh
This message has been deleted by Natsheh. Reason: Nvm not gonna even bother
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-12-2019 , 06:38   Re: How to stop spam chat message in this plugin
Reply With Quote #4

Quote:
Originally Posted by Meelo View Post
but with this plugin player 1 have to take dmg from player 2, i dont want to damage any player, just a simple message when one jump on another one's head
Hey , done !
How it works ? : when a player from CT jump on a T head a message will be printed or when a T jump on CT head a message will be printed. ( if you want more features , like sound or etc just let me know )


PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define Red print_team_red
#define Blue print_team_blue
#define Grey print_team_grey
#define DontChange print_team_default
#endif

#define PLUGIN_VERSION "1.4"


#define MINIMUM_FALL_SPEED 230

new Float:falling_speed[33];

public 
plugin_init()
{
    
register_plugin("Head Splash"PLUGIN_VERSION"potatis_invalido");
    
register_forward(FM_Touch"forward_touch");
    
register_forward(FM_PlayerPreThink"forward_PlayerPreThink");
}

public 
forward_touch(touchertouched)
{
    if(!
is_user_alive(toucher) || !is_user_alive(touched))
        return;
    
    if(
falling_speed[touched])
        return;
    
    if(
get_user_team(toucher) == get_user_team(touched))
        return;
    
    new 
touched_origin[3], toucher_origin[3];
    
get_user_origin(touchedtouched_origin);
    
get_user_origin(touchertoucher_origin);
    
    new 
Float:toucher_minsize[3], Float:touched_minsize[3];
    
pev(toucher,pev_mins,toucher_minsize);
    
pev(touched,pev_mins,touched_minsize);
    
    if(
touched_minsize[2] != -18.0)
    {
        if(!(
toucher_origin[2] == touched_origin[2]+72 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+54 && toucher_minsize[2] == -18.0))
        {
            return;
        }
    }
    else
    {
        if(!(
toucher_origin[2] == touched_origin[2]+68 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+50 && toucher_minsize[2] == -18.0))
        {
            return;
        }
    }
    
    if(
falling_speed[toucher] >= MINIMUM_FALL_SPEED)
    {
         new 
szName[32] , szName2[32]
                 
get_user_name(toucherszNamecharsmax(szName)) 
             
get_user_name(touchedszName2charsmax(szName2))
                 
client_print_color(0print_chat"^4%s^1 jumped on ^4%s ^1Heads!"szName,szName2)
    }
}

public 
forward_PlayerPreThink(id)
{
    
pev(idpev_flFallVelocityfalling_speed[id])

LearninG is offline
thEsp
BANNED
Join Date: Aug 2017
Old 08-12-2019 , 06:45   Re: How to stop spam chat message in this plugin
Reply With Quote #5

Quote:
Originally Posted by LearninG View Post
Hey , done !
How it works ? : when a player from CT jump on a T head a message will be printed or when a T jump on CT head a message will be printed. ( if you want more features , like sound or etc just let me know )
Pf, nonsense.
@OP: There's something like that, plus it's fully customizable. Please visit the link iceeedr referred you to.
Quote:
Originally Posted by iceeedr View Post
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-12-2019 , 07:10   Re: How to stop spam chat message in this plugin
Reply With Quote #6

Quote:
Originally Posted by Meelo View Post
but with this plugin player 1 have to take dmg from player 2, i dont want to damage any player, just a simple message when one jump on another one's head
Nobody has to take damage. The plugin is fully customizable. You can easily disable the damage from the configuration file and you will get the same effect, plus you may find more things that you like inside it.
__________________

Last edited by OciXCrom; 08-12-2019 at 07:10.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Meelo
Member
Join Date: Aug 2010
Old 08-12-2019 , 07:55   Re: How to stop spam chat message in this plugin
Reply With Quote #7

Ok but still in your plugin - damage is disabled but the message is displayed if i jump from the correct height, not if i just touch player's head
Meelo is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-12-2019 , 08:30   Re: How to stop spam chat message in this plugin
Reply With Quote #8

Quote:
Originally Posted by Meelo View Post
Ok but still in your plugin - damage is disabled but the message is displayed if i jump from the correct height, not if i just touch player's head
The code I sent you does exactly what you need...but if you want more features just list them all and I will try to include them in plugin...
LearninG is offline
Meelo
Member
Join Date: Aug 2010
Old 08-12-2019 , 09:07   Re: How to stop spam chat message in this plugin
Reply With Quote #9

Quote:
Originally Posted by LearninG View Post
The code I sent you does exactly what you need...but if you want more features just list them all and I will try to include them in plugin...


I know but if there is better way to do it.. so why not
Meelo is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-12-2019 , 09:20   Re: How to stop spam chat message in this plugin
Reply With Quote #10

Quote:
Originally Posted by Meelo View Post
I know but if there is better way to do it.. so why not
the code I sent you works perfectly , there is no better for that unless you want more features , so I'm asking again what extra features do you need or like to have ?
LearninG is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode