This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Ban the worst player and map end


Post New Thread Reply   
 
Thread Tools Display Modes
lis_16
Senior Member
Join Date: Feb 2008
Old 07-25-2011 , 16:35   Re: Ban the worst player and map end
Reply With Quote #11

Don't work. Why in clinet_disconnect this code work (if player leave he's banned):

PHP Code:
get_user_authid(idauthid31)
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasauthid
But in plugin_end it don't work.
lis_16 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2011 , 16:39   Re: Ban the worst player and map end
Reply With Quote #12

Show your code.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-25-2011 , 17:35   Re: Ban the worst player and map end
Reply With Quote #13

Quotes around the SteamID.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 07-26-2011 , 06:42   Re: Ban the worst player and map end
Reply With Quote #14

I do some extra tests. No quotes needed.

PHP Code:
)
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasauthid
This ban code works good. But there is a big problem.

This is the code:

PHP Code:
public pe()
{
    
client_print(0print_chat"funkcja")
    new 
players[32], pnumplayerfrags[33]
    
get_players(playerspnum)
    
log_to_file("logggg.log""przed petla")
    for(new 
0pnumi++)
    {
        
player players[i]
        
        if(!
zaklad[player])
            
players[i--] = players[--pnum]
        else
            
frags[player] = get_user_frags(player)
    }
    
log_to_file("logggg.log""po petli")
    
    
//if(pnum < 2) return
    
    
SortCustom1D(playerspnum"SortWorstPlayers"fragssizeof(frags))
    
    new 
stop 0
    player 
players[0]
    while(++
stop pnum && frags[players[stop]] == frags[player]) { }
    
log_to_file("logggg.log""przed ifem")
    if(
stop == pnum) return
    
log_to_file("logggg.log""po ifie")
    for(new 
0stopi++)
    {
        
player players[i]
        new 
authid[33], ip[32]
        
get_user_ip(playerip191)
        
get_user_authid(playerauthid31)
        if (!
equal(authid"STEAM_0:"8)){
            
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasip)
            
log_to_file("logggg.log""Banned %s"ip
        }
        else{
            
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasauthid)
            
log_to_file("logggg.log""Banned %s"authid
        } 
    }

If I force it 20 or more second before map end (set_task with flag d) it works and ban players, but if I change this time fe. 5/10s don't work. Also if it was forced by plugin_end don't work too. Can someone explain that?
lis_16 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 07-26-2011 , 08:23   Re: Ban the worst player and map end
Reply With Quote #15

Quote:
Originally Posted by fysiks View Post
There is no reason to ban by IP since everybody should have a SteamID, BTW. Also, you probably need quotes around the SteamID.
If you have two steam userd and cs then it is a reason
.Dare Devil. is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 07-26-2011 , 15:17   Re: Ban the worst player and map end
Reply With Quote #16

Ok, but why it want ban in plugin_end event? Should it or not? It takes about 2s when function started to ban info in hud so in plugin_end there is time to do it. Any ideas?
lis_16 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-26-2011 , 15:57   Re: Ban the worst player and map end
Reply With Quote #17

Quote:
Originally Posted by .Dare Devil. View Post
If you have two steam userd and cs then it is a reason
Sill not a good reason. Just ban both accounts. Simple as that. It's easier and cheaper to get a new IP than it is to get a new Steam account and buy the game again.
__________________
fysiks is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 07-27-2011 , 18:24   Re: Ban the worst player and map end
Reply With Quote #18

Simple question. Can someone help with my problem or I must try and do it myself?
lis_16 is offline
[PUPPETS] Scooter
Member
Join Date: May 2009
Old 07-30-2011 , 05:18   Re: Ban the worst player and map end
Reply With Quote #19

Quote:
It takes about 2s when function started to ban info in hud so in plugin_end there is time to do it. Any ideas?
Amxbans also needs some seconds to ban a player (asking if already in database, ...) so there won't be enough time for it to ban a player at the end of map.
[PUPPETS] Scooter is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 07-30-2011 , 07:25   Re: Ban the worst player and map end
Reply With Quote #20

When I force function 20s before map end it takes 2s to serach for the worst player and ban it. But when I set 5s before map end it don't ban with enough time between forced function and map end.

Also I tried to save steam to a file and ban them in next map (set_task(1.0,.....)) and it didn't work too.
lis_16 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 15:15.


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