Raised This Month: $ Target: $400
 0% 

Block Something in server


Post New Thread Reply   
 
Thread Tools Display Modes
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-28-2018 , 12:29   Re: Block Something in server
Reply With Quote #21

NOT TESTED

Code:
public client_connect(PlayerID)
{
            new Name[32];
            get_user_name(PlayerID, Name, charsmax(Name));
            
            for (new Index = 0; Index < 32; Index++)
            {
                        if (!Name[Index] || !isalpha(Name[Index]))
                                    continue;
                        
                        if (Name[Index] < 48 || Name[Index] > 90)
                                    Name[Index] = ' ';
            }
            
            set_user_info(PlayerID, "name", Name);
}
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-28-2018 at 12:30.
Ghosted is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-28-2018 , 13:09   Re: Block Something in server
Reply With Quote #22

It blocks lots of characters which are valid. Not working.

Code:
PurposeLess

->

P        L
PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_plugin("Nick Kontrol""1.0""PurposeLess");

}

public 
client_connect(id)
{
    new 
name[32];
    
get_user_name(idnamecharsmax(name));

    for(new 
i=0i<32i++)
    {
        if(!
name[i] || !isalpha(name[i]))
        {
            continue;
        }

        if(
name[i] < 48 || name[i] > 90)
        {
            
name[i] = ' ';
        }
    }
    
set_user_info(id"name"name);
    
client_cmd(id"name ^"%s^""name);

__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }


Last edited by PurposeLessx; 06-28-2018 at 13:11.
PurposeLessx is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-28-2018 , 15:45   Re: Block Something in server
Reply With Quote #23

Code:
if(name[i] < 48 || name[i] > 90)

It replaces all the lower case chars because those do not range from 48-90, I didn't read the previous post, what is your intention here ?
__________________
stuff

Last edited by maqi; 06-28-2018 at 15:46.
maqi is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-28-2018 , 17:17   Re: Block Something in server
Reply With Quote #24

change
Code:
if (Name[Index] < 48 || Name[Index] > 90)
To
Code:
if (Name[Index] < 32|| Name[Index] > 126)
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-28-2018 at 17:17.
Ghosted is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-28-2018 , 17:23   Re: Block Something in server
Reply With Quote #25

That will, however, enable some non alpha chars. Thats why i asked whats his goal here.
__________________
stuff
maqi is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-28-2018 , 18:56   Re: Block Something in server
Reply With Quote #26

Quote:
Originally Posted by maqi View Post
That will, however, enable some non alpha chars. Thats why i asked whats his goal here.
I want people to use just character server allows. Like "abcdefghijklmn..."
They will not use another character. Like "â ê Ù ²ÿ...."

Look at here;
https://resmim.net/f/rvTZ4B.png
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 06-29-2018 , 01:58   Re: Block Something in server
Reply With Quote #27

I've already told you earlier - consider using regular expressions.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-29-2018 , 04:05   Re: Block Something in server
Reply With Quote #28

Quote:
Originally Posted by NiHiLaNTh View Post
I've already told you earlier - consider using regular expressions.
How I should do? If I knew, I wouldn't have create a post, sorry.
Isn't there any easy solution? Thanks all you for helping.
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx 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 19:50.


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