Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[REQ] edit plugin amx_banlist


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
hi, i recently encountered a problem on the server, more precisely, a problem with the banlist of the 'advanced bans' plugin.

i would like to change it, so that the admins can search for a ban in the banlist by the player's name.

after a few searches i found something here but only for banned.cfg
i edited a little and i faced a small problem, not all bans are displayed.
i want them to show me all the bans that contain what i was searching.

PHP Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("AMXX Ban List Viewer","0.1a","Drak");
    
    
register_concmd("amx_banlist","CmdBanList",ADMIN_BAN,"Views the users in the banned.cfg file");
}

public 
CmdBanList(id,level,cid)
{
    if(!
cmd_access(id,level,cid,1))
        return 
1
        
    
new Search[32];
    
read_args(Search31);
    
    new 
pFile fopen("addons/amxmodx/data/advanced_bans.txt","r");
    if(!
pFile)
        return 
client_print(id,print_console,"[AMXX BanList] Unable to open BanList File.");
    
    new 
Data[256],Arg1[101],Arg2[101],Arg3[101],Arg4[101],Arg5[101],Arg6[101];
    
    while(!
feof(pFile))
    {
        
fgets(pFile,Data,255);
        if(
contain(Data,Search) != -1)
        {
            
parse(DataArg1100Arg2100Arg3100Arg4100Arg5100Arg6100);
            
console_print(id"************************************");
            
console_print(id"Name: %s"Arg2);
            
console_print(id"IP/SteamID: %s"Arg1);
                
            if(
equal(Arg3"0") && !equal(Arg3"0"))
                
replace(Arg3,100,"0","Temporar"); 
            else 
replace(Arg3,100,"0","Permanent");
                
            
console_print(id"Ban Type: %s"Arg3);
            
console_print(id"Unban Time: %s"Arg4);
            
console_print(id"Reason: %s",Arg5);
            
console_print(id"Admin: %s"Arg6);
            
console_print(id"************************************");
            return 
1;
        }
    }
    
fclose(pFile);
    return 
1


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...