Jump to content
GIGN Forum

Plugins End!


Recommended Posts

Shis ir ja 5 reizes uzspied end nobano uz stundu to protams var mainīt... GL

#include <amxmodx>
#include <amxmisc>

#define MAX_WARNINGS 5

new g_iEndUses[33]

new enabled, pallow

public plugin_init()
{
    register_plugin("No END button","1.0","Throstur")
    
    enabled = register_cvar("amx_no-end","1")
    pallow = register_cvar("amx_no-end_lowaccess","1")    // give admins with access "q" immunity to this plugin
    
//    register_clcmd("bind ^"end^"","fnNobind")
//    register_clcmd("bind end","fnNobind")
//    register_clcmd("unbind ^"end^"","fnNobind")
//    register_clcmd("unbind end","fnNobind")
    register_clcmd("nocheaters","fnEND")
}

public client_putinserver(id)
{
    if(get_pcvar_num(enabled) != 1)
        return PLUGIN_HANDLED
    if(access(id,ADMIN_IMMUNITY))
        return PLUGIN_HANDLED
    if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))
        return PLUGIN_HANDLED
    client_cmd(id, "writecfg endbutton")
    client_cmd(id, "bind ^"END^" ^"nocheaters^"")
    return PLUGIN_HANDLED
}

public client_disconnect(id)
{
    client_cmd(id, "exec endbutton.cfg")
    g_iEndUses[id] = 0
}
/*
public fnNobind(id)
{
    if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))
        return PLUGIN_CONTINUE
    else if(get_pcvar_num(enabled) == 1)
        client_cmd(id,"say I'M A FILTHY CHEATER! I TRIED TO CHANGE MY END KEY!!")
    return PLUGIN_HANDLED
}
*/
public fnEND(id)
{
    if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))
        return PLUGIN_CONTINUE
    else if(get_pcvar_num(enabled) == 1)
        set_task(0.1,"fnWarnings",id)
    return PLUGIN_HANDLED
}


public fnWarnings(id)
{
    new name[32]
    get_user_name(id,name,31)
    if(++g_iEndUses[id] > MAX_WARNINGS)
    {
        server_cmd("amx_banip 60.0 #%d ^"End-Key^"",get_user_userid(id))
        client_print(0,print_chat,"[AMXX] Player %s has been banned for cheating.",name)
    }
    client_print(id,print_chat,"[AMXX] Please do not cheat, you have %d warnings left.",MAX_WARNINGS - g_iEndUses[id])
}

Link to comment
Share on other sites

#include <amxmodx>

#include <amxmisc>

new g_iEndUses[33]

new enabled, pallow

new bantime, max_warnings

public plugin_init()

{

register_plugin("No END button","1.0","Throstur")

enabled = register_cvar("amx_no-end","1")

pallow = register_cvar("amx_no-end_lowaccess","1") // give admins with access "q" immunity to this plugin

bantime = register_cvar("amx_end_bantime","60")

max_warnings = register_cvar("amx_end_max","7")

// register_clcmd("bind ^"end^"","fnNobind")

// register_clcmd("bind end","fnNobind")

// register_clcmd("unbind ^"end^"","fnNobind")

// register_clcmd("unbind end","fnNobind")

register_clcmd("nocheaters","fnEND")

}

public client_putinserver(id)

{

if(get_pcvar_num(enabled) != 1)

return PLUGIN_HANDLED

if(access(id,ADMIN_IMMUNITY))

return PLUGIN_HANDLED

if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))

return PLUGIN_HANDLED

client_cmd(id, "writecfg endbutton")

client_cmd(id, "bind ^"END^" ^"nocheaters^"")

return PLUGIN_HANDLED

}

public client_disconnect(id)

{

client_cmd(id, "exec endbutton.cfg")

g_iEndUses[id] = 0

}

/*

public fnNobind(id)

{

if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))

return PLUGIN_CONTINUE

else if(get_pcvar_num(enabled) == 1)

client_cmd(id,"say I'M A FILTHY CHEATER! I TRIED TO CHANGE MY END KEY!!")

return PLUGIN_HANDLED

}

*/

public fnEND(id)

{

if((get_pcvar_num(pallow) == 1) && (access(id,ADMIN_LEVEL_D)))

return PLUGIN_CONTINUE

else if(get_pcvar_num(enabled) == 1)

set_task(0.1,"fnWarnings",id)

return PLUGIN_HANDLED

}

public fnWarnings(id)

{

new name[32]

get_user_name(id,name,31)

if(++g_iEndUses[id] > get_pcvar_num(max_warnings))

{

server_cmd("amx_banip #%d %d ^"End-Key^"",get_user_userid(id), get_pcvar_num(bantime))

client_print(0,print_chat,"[AMXX] Player %s has been banned for cheating.",name)

}

client_print(id,print_chat,"[AMXX] Please do not cheat, you have %d warnings left.",get_pcvar_num(max_warnings) - g_iEndUses[id])

}

kr4 es bi6ku paarveidoju lai butu vieglak izmantot sho pluginu

ar:

amx_end_bantime ##

var maniit bana ilgumu

ar:

amx_end_max #

var mainiit briidinaajumu skaitu

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...