Raised This Month: $ Target: $400
 0% 

[Question] 3 Times Retry - Ban


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-24-2014 , 17:44   Re: [Question] 3 Times Retry - Ban
Reply With Quote #1

Quote:
Originally Posted by YamiKaitou View Post
Then set the amx_bantime cvar to your desired time
but if i remove Ban perm, how i set ban 15 min?

here?
Code:
"amx_ban #%d %d ^"
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-24-2014 , 17:56   Re: [Question] 3 Times Retry - Ban
Reply With Quote #2

amx_bantime 900
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-24-2014 , 18:21   Re: [Question] 3 Times Retry - Ban
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
amx_bantime 900
uhm >
Code:
#include <amxmodx>

new Trie:g_tSteam;

new g_pBan;
new g_pTimes;

public plugin_init()
{
    register_plugin("Test","0.0.1","Test");
    
    g_pBan      = register_cvar("amx_bantime","15");     // -1 disabe Bans only kick, 0 Permanent ban!, > 0 Ban time
    g_pTimes     = register_cvar("amx_maxretrys","4");     // Max Retry Times per map
    
    g_tSteam = TrieCreate();
}

public plugin_end() TrieDestroy(g_tSteam);

public client_authorized(id)
{
    new sSteam[35];
    get_user_authid(id,sSteam,charsmax(sSteam));

    new iCount;
    
    if(TrieGetCell(g_tSteam,sSteam,iCount))
    {
        new iTimes = get_pcvar_num(g_pTimes);
        
        if((iCount >= iTimes) && (iTimes > 0))
        {
            new iBanTime = get_pcvar_num(g_pBan);
            
            if(iBanTime == -1)
            {
                server_cmd
                (
                    "amx_ban #%d %d ^"Blabla^"",
                    get_user_userid(id),
                    iBanTime,
                    iTimes,
                    (iTimes > 1) ? "times" : "time"
                );
            }
        }
        else TrieSetCell(g_tSteam,sSteam,++iCount);
    }
    else TrieSetCell(g_tSteam,sSteam,0);
}
how can i add logs to show me who did it?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-24-2014 , 18:51   Re: [Question] 3 Times Retry - Ban
Reply With Quote #4

You put plugin cvars in amxx.cfg, you don't need to edit the plugin.
__________________

Last edited by fysiks; 01-24-2014 at 18:52.
fysiks is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-24-2014 , 18:55   Re: [Question] 3 Times Retry - Ban
Reply With Quote #5

this?
Code:
// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60
PHP Code:
#include <amxmodx>

new Trie:g_tSteam;

new 
g_pBan;
new 
g_pTimes;

public 
plugin_init()
{
    
register_plugin("Test","0.0.1","Test");
    
    
g_pBan      register_cvar("amx_bantime","-1");     // -1 disabe Bans only kick, 0 Permanent ban!, > 0 Ban time
    
g_pTimes     register_cvar("amx_maxretrys","4");     // Max Retry Times per map
    
    
g_tSteam TrieCreate();
}

public 
plugin_end() TrieDestroy(g_tSteam);

public 
client_authorized(id)
{
    new 
sSteam[35];
    
get_user_authid(id,sSteam,charsmax(sSteam));

    new 
iCount;
    
    if(
TrieGetCell(g_tSteam,sSteam,iCount))
    {
        new 
iTimes get_pcvar_num(g_pTimes);
        
        if((
iCount >= iTimes) && (iTimes 0))
        {
            new 
iBanTime get_pcvar_num(g_pBan);
            
            if(
iBanTime == -1)
            {
                
server_cmd
                
(
                    
"amx_ban #%d %d ^"You cannot retry more than %%s in the same map^"",
                    
get_user_userid(id),
                    
iBanTime,
                    
iTimes,
                    (
iTimes 1) ? "times" "time"
                
);
            }
        }
        else 
TrieSetCell(g_tSteam,sSteam,++iCount);
    }
    else 
TrieSetCell(g_tSteam,sSteam,0);

uhm so how can i know, if that really give for 15min?

-15?

Last edited by Fuck For Fun; 01-24-2014 at 18:58.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2014 , 00:51   Re: [Question] 3 Times Retry - Ban
Reply With Quote #6

Quote:
Originally Posted by Fuck For Fun View Post
this?
Code:
// Ban times for the main ban menu (amx_banmenu)
// Use 0 for permanent ban
// Default values: 0 5 10 15 30 45 60
amx_plmenu_bantimes 0 5 10 15 30 45 60
No, that is for an existing feature. You have to add new cvars to that file. So, in the case of the plugin that was posted for you, it has a cvar called "amx_bantime". You put that at the bottom of amxx.cfg with your specified ban time:

Code:
// a bunch of default stuff here

amx_bantime 15
__________________
fysiks is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-25-2014 , 06:01   Re: [Question] 3 Times Retry - Ban
Reply With Quote #7

i have Tested it, And it does nothing, even KICK does not get ..

Last edited by Fuck For Fun; 01-25-2014 at 07:23.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 01-24-2014 , 19:07   Re: [Question] 3 Times Retry - Ban
Reply With Quote #8

-1 makes it only a kick
0 makes it perm
anything else bans for whatever number you put in (probably in seconds)

TEST IT!

Ban yourself, and if your ban is lifted in 15 mins, you know it works...
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-24-2014 , 20:28   Re: [Question] 3 Times Retry - Ban
Reply With Quote #9

Quote:
Originally Posted by joshknifer View Post
-1 makes it only a kick
0 makes it perm
anything else bans for whatever number you put in (probably in seconds)

TEST IT!

Ban yourself, and if your ban is lifted in 15 mins, you know it works...
that i know dude, hes just said me something about amxx.cfg

lol let me check
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-24-2014 , 22:06   Re: [Question] 3 Times Retry - Ban
Reply With Quote #10

OMG:::

amx_bantime:

-1 to remove bans, only Kick
0 to permanent ban
above 0 to ban in minutes (Used same as amx_ban command)

Is not too hard LOL
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 20:34.


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