Raised This Month: $ Target: $400
 0% 

in 10 minutes get 150 Frags auto ban


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sb123
Senior Member
Join Date: Jan 2007
Old 04-10-2011 , 06:04   in 10 minutes get 150 Frags auto ban
Reply With Quote #1

hi guys

if the player in 10 minutes get 150 Frags

how can auto ban?

10 minutes get 150 Frags server auto ban

20 minutes get 250 Frags server auto ban

30 minutes get 350 Frags server auto ban

we need you help

buddy
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-10-2011 , 06:32   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #2

Quote:
Originally Posted by sb123 View Post
hi guys

if the player in 10 minutes get 150 Frags

how can auto ban?

10 minutes get 150 Frags server auto ban

20 minutes get 250 Frags server auto ban

30 minutes get 350 Frags server auto ban

we need you help

buddy
That doesn't make any sense. You wouldn't get 250 frags if you get 150 frags in 10 minutes and get banned.
matsi is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-10-2011 , 06:34   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #3

Quote:
Originally Posted by matsi View Post
That doesn't make any sense. You wouldn't get 250 frags if you get 150 frags in 10 minutes and get banned.
You can get 140 frags in 10 minutes and then another 110 (which makes 250 in total) in another 10 minutes.
__________________
hleV is offline
sb123
Senior Member
Join Date: Jan 2007
Old 04-10-2011 , 06:36   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #4

Quote:
Originally Posted by matsi View Post
That doesn't make any sense. You wouldn't get 250 frags if you get 150 frags in 10 minutes and get banned.
oh sorry my misstep

now only need get 150 frags in 10 minutes inside get banned

we need you help
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
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
sb123
Senior Member
Join Date: Jan 2007
Old 04-10-2011 , 06:47   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #6

thanks you ConnorMcLeod

any Cvar i can set?

amx_highscore_bantime 10 (baned 10 min)

but the Frags and user time?
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 06:48   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #7

Too late, you came with a request, i made the request, next time comme with a more detailled one ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sb123
Senior Member
Join Date: Jan 2007
Old 04-10-2011 , 06:51   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #8

hi ConnorMcLeod

i just have some code Don't understand

don't need you edit new plugins

PHP Code:
    new iFrags read_data(2) - 50
    
if( iFrags / (iTime 600) >= 10 
can you explain this ?
__________________

Last edited by sb123; 04-10-2011 at 06:54.
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 07:09   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #9

That's maths...

divide player time by 600 sec (10min)
lower the score by 50 so then you can match what you asked 150, 250, 350, 450 : becomes 100, 200, 300, 400

Then check if score is 10 time bigger than amount of 10 minutes the player has played.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sb123
Senior Member
Join Date: Jan 2007
Old 04-10-2011 , 07:15   Re: in 10 minutes get 150 Frags auto ban
Reply With Quote #10

i got it!

thanks you
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
Old 04-10-2011, 08:05
sb123
This message has been deleted by Arkshine. Reason: Don't bump until 15 days have passed.
Old 04-10-2011, 08:16
sb123
This message has been deleted by ConnorMcLeod. Reason: Don't bump until 15 days have passed.
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:11.


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