Raised This Month: $ Target: $400
 0% 

in 10 minutes get 150 Frags auto ban


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 06:38   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #5

Try this :

PHP Code:
#define LOGBANS

#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "HighScores AutoBan"

new g_pCvarBanTime

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
g_pCvarBanTime register_cvar("amx_highscore_bantime""0")

    
register_event("ScoreInfo""Event_ScoreInfo""a")
}

public 
Event_ScoreInfo()
{
    new 
id read_data(1)
    if( !
is_user_connected(id) )
    {
        return
    }
    new 
iTime get_user_time(id)
    if( 
iTime 600 )
    {
        return
    }
    new 
iFrags read_data(2) - 50
    
if( iFrags / (iTime 600) >= 10 )
    {
        new 
szSteamId[32]
        
get_user_authid(idszSteamIdcharsmax(szSteamId))
    
#if defined LOGBANS
        
new szName[32], szIp[22]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_ip(idszIpcharsmax(szIp))
        
LogToFile("%s<%s><%s> was banned for high score (Time %d, Frags %d)"szNameszSteamIdszIpiTimeiFrags)
    
#endif
        
server_cmd("kick #%d ^"HighScore^";wait;banid %d %s;wait;writeid"get_user_userid(id), get_pcvar_num(g_pCvarBanTime), szSteamId)
    }
}

#if defined LOGBANS
LogToFile(const fmt[], any:...)
{
    static 
szLogFile[64]
    static 
date[22]
    if( !
szLogFile[0] )
    {
        
get_localinfo("amxx_logs"szLogFilecharsmax(szLogFile))
        
format(szLogFilecharsmax(szLogFile), "%s/HighScoresBans_%s.log"szLogFiledate)
    }

    new 
szLog[256]
    
vformat(szLogcharsmax(szLog), fmt2)

    
get_time("%m/%d/%Y - %H:%M:%S"datecharsmax(date))

    new 
fp fopen(szLogFile"at")
    
fprintf(fp"L %s: %s^n"dateszLog)
    
fclose(fp)
}
#endif 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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:11.


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