Raised This Month: $32 Target: $400
 8% 

CS 1.6 Ban Name Plugin Modification


Post New Thread Reply   
 
Thread Tools Display Modes
hasanalizxc
Senior Member
Join Date: May 2018
Old 05-19-2018 , 12:22   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #11

Quote:
Originally Posted by Natsheh View Post
Just remove trim from the script
sorry but i couldnt understand "remove trim from the subject". can you show me how?
hasanalizxc is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 05-19-2018 , 12:45   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #12

Change
PHP Code:
public load_names() {
    
get_configsdir(g_cfgcharsmax(g_cfg));
    
formatex(g_cfgcharsmax(g_cfg), "%s/%s"g_cfgFILE);

    if(
a_ban_namesArrayDestroy(a_ban_names);
    
a_ban_names ArrayCreate(4816);

    new 
File fopen(g_cfg"rt");

    if(
File) {
        new 
Name[48];
        while(!
feof(File)) {
            
fgets(FileNamecharsmax(Name));

            
trim(Name);

            if(!
Name[0])
                continue;

            
ArrayPushString(a_ban_namesName);
        }

        
array_size ArraySize(a_ban_names);

        
fclose(File);
        
look_file 1;
    }
    else {
        
look_file 2;
        
log_amx("Brak '%s' na serwerze"g_cfg);
    }

To
PHP Code:
public load_names() {
    
get_configsdir(g_cfgcharsmax(g_cfg));
    
formatex(g_cfgcharsmax(g_cfg), "%s/%s"g_cfgFILE);

    if(
a_ban_namesArrayDestroy(a_ban_names);
    
a_ban_names ArrayCreate(4816);

    new 
File fopen(g_cfg"rt");

    if(
File) {
        new 
Name[48];
        while(!
feof(File)) {
            
fgets(FileNamecharsmax(Name);

            if(!
Name[0])
                continue;

            
ArrayPushString(a_ban_namesName);
        }

        
array_size ArraySize(a_ban_names);

        
fclose(File);
        
look_file 1;
    }
    else {
        
look_file 2;
        
log_amx("Brak '%s' na serwerze"g_cfg);
    }

__________________
CrAzY MaN is offline
hasanalizxc
Senior Member
Join Date: May 2018
Old 05-19-2018 , 13:46   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #13

Quote:
Originally Posted by CrAzY MaN View Post
Change
PHP Code:
public load_names() {
    
get_configsdir(g_cfgcharsmax(g_cfg));
    
formatex(g_cfgcharsmax(g_cfg), "%s/%s"g_cfgFILE);

    if(
a_ban_namesArrayDestroy(a_ban_names);
    
a_ban_names ArrayCreate(4816);

    new 
File fopen(g_cfg"rt");

    if(
File) {
        new 
Name[48];
        while(!
feof(File)) {
            
fgets(FileNamecharsmax(Name));

            
trim(Name);

            if(!
Name[0])
                continue;

            
ArrayPushString(a_ban_namesName);
        }

        
array_size ArraySize(a_ban_names);

        
fclose(File);
        
look_file 1;
    }
    else {
        
look_file 2;
        
log_amx("Brak '%s' na serwerze"g_cfg);
    }

To
PHP Code:
public load_names() {
    
get_configsdir(g_cfgcharsmax(g_cfg));
    
formatex(g_cfgcharsmax(g_cfg), "%s/%s"g_cfgFILE);

    if(
a_ban_namesArrayDestroy(a_ban_names);
    
a_ban_names ArrayCreate(4816);

    new 
File fopen(g_cfg"rt");

    if(
File) {
        new 
Name[48];
        while(!
feof(File)) {
            
fgets(FileNamecharsmax(Name);

            if(!
Name[0])
                continue;

            
ArrayPushString(a_ban_namesName);
        }

        
array_size ArraySize(a_ban_names);

        
fclose(File);
        
look_file 1;
    }
    else {
        
look_file 2;
        
log_amx("Brak '%s' na serwerze"g_cfg);
    }



I removed trim(Name);. But this time plugin is not working at all. It was working before removing the trim line.
hasanalizxc is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-19-2018 , 14:43   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #14

Quote:
Originally Posted by Natsheh View Post
Just remove trim from the script
And what exactly are you expecting to happen by doing this? It certainly won't do anything to satisfy the OP's original request.
__________________
fysiks is offline
hasanalizxc
Senior Member
Join Date: May 2018
Old 05-19-2018 , 15:16   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #15

Quote:
Originally Posted by fysiks View Post
And what exactly are you expecting to happen by doing this? It certainly won't do anything to satisfy the OP's original request.
Thanks for your interest. Maybe you can tell me how can we modify this for detecting spaces in nick.
hasanalizxc is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-19-2018 , 15:36   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #16

Quote:
Originally Posted by hasanalizxc View Post
Thanks for your interest. Maybe you can tell me how can we modify this for detecting spaces in nick.
You should be using the Restrict Names plugin and I posted in that thread.
__________________
fysiks is offline
hasanalizxc
Senior Member
Join Date: May 2018
Old 05-19-2018 , 15:40   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #17

Quote:
Originally Posted by fysiks View Post
You should be using the Restrict Names plugin and I posted in that thread.
i know it but it is too sophisticated and i dont know regex logic. i couldn solve it. this plugin is too simple and works like a charm. The only problem is cannot detect spaces in nicks.
hasanalizxc is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-19-2018 , 15:48   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #18

Quote:
Originally Posted by hasanalizxc View Post
The only problem is cannot detect spaces in nicks.
The only realistic way to do this is to use RegEx. I gave you examples in the Restrict Names thread.
__________________
fysiks is offline
hasanalizxc
Senior Member
Join Date: May 2018
Old 05-19-2018 , 17:32   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #19

Quote:
Originally Posted by fysiks View Post
The only realistic way to do this is to use RegEx. I gave you examples in the Restrict Names thread.
I read the examples but i couldnt solve the regex logic.
hasanalizxc is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-19-2018 , 18:44   Re: CS 1.6 Ban Name Plugin Modification
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
And what exactly are you expecting to happen by doing this? It certainly won't do anything to satisfy the OP's original request.
You are right i assumed that trim removes also spaces instead it only clear Whitespaces.

But im not sure why the space between is removed.

Recommend to listen to fysiks.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-19-2018 at 18:48.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 17:29.


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