Raised This Month: $32 Target: $400
 8% 

Slay with max 3 warns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
broly123
New Member
Join Date: Apr 2022
Old 08-03-2022 , 21:19   Slay with max 3 warns
Reply With Quote #1

Hello guys! I'm new here, and I wanted to make a mini request about amx_slay, the plugin format I'm asking for, is that when you give the command AMX_SLAY NAME, in the chat it looks something like this:

ADMIN name SLAY name Reason tb/camp Warn: 1/3, then 2/3 and then 3/3, when it exceeds this number, it kicks automatically
broly123 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 08-03-2022 , 21:46   Re: Slay with max 3 warns
Reply With Quote #2

try this one

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MAX_WARNS 3
#define REASON "You have been kicked due too many warns"

new g_iWarns[MAX_PLAYERS 1];

#if !defined MAX_PLAYERS 
    #define MAX_PLAYERS 32
#endif

#if !defined MAX_NAME_LENGTH
    #define MAX_NAME_LENGTH 32
#endif

public plugin_init()
{
    
register_plugin("Camp Slay""0.1""AMXX Community")

    
register_clcmd("amx_slay""slayHandle");
}

public 
client_connect(idg_iWarns[id] = 0;

public 
slayHandle(id)
{
    if(!
is_user_admin(id))
        return 
PLUGIN_HANDLED_MAIN;

    new 
szName[MAX_NAME_LENGTH];
    
read_args(szNamecharsmax(szName));

    new 
iPlayer find_player("b"szName);

    if(
iPlayer && is_user_alive(iPlayer) && !is_user_bot(id) && !is_user_hltv(id))
    {
        
g_iWarns[iPlayer]++
        new 
szUserName[MAX_NAME_LENGTH];
        
get_user_name(iPlayerszUserNamecharsmax(szUserName));

        if(
g_iWarns[iPlayer] == MAX_WARNS)
        {
            
server_cmd("kick #%i ^"%s^""get_user_userid(iPlayer), REASON);
            
server_exec()
            
client_print_color(0print_team_default"^4[TAG]^1 Player^3 %s^1 has been kicked due^4 too many warns^1. [^4%i/%i^1]"szUserNameg_iWarns[iPlayer], MAX_WARNS);
        } else 
client_print_color(0print_team_default"^4[TAG]^1 Warns for^3 %s^1:^4 %i"szUserNameg_iWarns[iPlayer]);
    }

    return 
PLUGIN_HANDLED_MAIN;


Last edited by lexzor; 08-03-2022 at 21:49.
lexzor is offline
broly123
New Member
Join Date: Apr 2022
Old 08-04-2022 , 20:51   Re: Slay with max 3 warns
Reply With Quote #3

It didn't work, I thought it would work, is there any other way to help?
broly123 is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-04-2022 , 20:58   Re: Slay with max 3 warns
Reply With Quote #4

Put the plugin higher than the amxx stuff in plugins.ini and try again.
__________________
deprale is offline
broly123
New Member
Join Date: Apr 2022
Old 08-04-2022 , 22:00   Re: Slay with max 3 warns
Reply With Quote #5

It is not compiling, gives error
broly123 is offline
counterstrike1.6
Member
Join Date: Oct 2020
Old 08-04-2022 , 22:52   Re: Slay with max 3 warns
Reply With Quote #6

I think it should slay user instead of kick or what if after again joining he again camping he should remain slayed for 1 2 or 3 round !!!

Last edited by counterstrike1.6; 08-04-2022 at 23:07.
counterstrike1.6 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 08-05-2022 , 07:23   Re: Slay with max 3 warns
Reply With Quote #7

update your compiler, it s working
Attached Files
File Type: amxx s.amxx (1.7 KB, 28 views)

Last edited by lexzor; 08-05-2022 at 07:23.
lexzor is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-05-2022 , 08:57   Re: Slay with max 3 warns
Reply With Quote #8

Quote:
Originally Posted by broly123 View Post
It is not compiling, gives error
What's your AMXX version?
I'm compiling on 1.10 and it works, but using the web compiler doesn't even recognise it as valid.

I guess there must have been some funny change, someone who's been around for more could tell you exactly which part of the code is causing it to not compile.
__________________
deprale is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 08-05-2022 , 10:58   Re: Slay with max 3 warns
Reply With Quote #9

Its client_print_color
ZaX is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-05-2022 , 13:55   Re: Slay with max 3 warns
Reply With Quote #10

So the issue is probably using a compiler which does not have the colorchat included by default.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 10:26.


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