Raised This Month: $ Target: $400
 0% 

Ban the worst player and map end


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
lis_16
Senior Member
Join Date: Feb 2008
Old 07-20-2011 , 06:54   Ban the worst player and map end
Reply With Quote #1

This is a bet system, if player type /zaklad-zaklad[index]=true for him. I want to ban the worst player who typed /zaklad or every player who has same frags count like the worst (fe. 4 players with frags: 30, 34, 20, 20. 2 players with frags 20 should be banned). Here is the code for banning but it won't work. What's wrong?


PHP Code:
new zaklad[33]
new 
czas
new odj_paka[33]
new 
bool:minely true
PHP Code:
public plugin_end(){
    new 
id_ban[32], pierwszy=falsecount=0ilosc=0
    
for(new id=0id<=32id++)
        if(
is_user_connected(id) && zaklad[id]) ilosc++
    if(
ilosc<2) return PLUGIN_CONTINUE
    
for(new id=0id<=32id++){
        if(
is_user_connected(id) && zaklad[id]){
            if(!
pierwszy){
                
pierwszy=true
                id_ban
[count]=id
                count
++
            }
            if(
id!=id_ban[count-1]){
                new 
fragi_obecnyfragi_nowy
                fragi_obecny
=get_user_frags(id_ban[count-1])-odj_paka[count-1// i subtract frags from plant/defuser a bomb.
                
fragi_nowy=get_user_frags(id)-odj_paka[id]
                if(
fragi_nowy==fragi_obecny){
                    
id_ban[count]=id
                    count
++
                }
                else if(
fragi_nowy<fragi_obecny){
                    
count=0
                    id_ban
[count]=id
                    count
++
                }
            }
        }
    }
    while(--
count>-1){
        
/*new ip[20]
        get_user_ip(id_ban[count], ip, 19, 1)
        server_cmd("addip %i %s", czas, ip)*/
        
new ip[20], authid[32], name[32]
        
get_user_name(countname31)
        
get_user_ip(id_ban[count], ip191)
        
get_user_authid(id_ban[count], authid31)
        if (!
equal(authid"STEAM_0:"8)){
            
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasip)
            
log_to_file("logs.log""Zbanowany na ip-%s"name)
        }
        else{
            
server_cmd("amx_ban %i %s ^"ReasonYou suck.^""czasauthid)
            
log_to_file("logs.log","Zbanowany na steam-%s"name)
        }
    }
    return 
PLUGIN_CONTINUE

lis_16 is offline
 


Thread Tools
Display Modes

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 00:48.


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