When types "Hi" gets banned
#1

Hello, I want that when a player types a text like for example "pin pon". He or she gets banned. How do I do it? Thank you.
Reply
#2

Use
pawn Код:
Strfind
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "pin pon", true) != -1) return Ban(playerid);
    return 1;
}
Reply
#4

pawn Код:
if( strcmp(text, "I suck", true ) == 0 )
    {
        // Bans the player who said 'I suck' and includes a reason ("Request")
        BanEx( playerid, "No hi's !" );
        return 1;
    }
Reply
#5

Why would you even directly ban a player? Warning them first is always a good thing.
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
pawn Код:
if( strcmp(text, "I suck", true ) == 0 )
    {
        // Bans the player who said 'I suck' and includes a reason ("Request")
        BanEx( playerid, "No hi's !" );
        return 1;
    }
Thank you I will use this.
Reply
#7

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
pawn Код:
if( strcmp(text, "I suck", true ) == 0 )
    {
        // Bans the player who said 'I suck' and includes a reason ("Request")
        BanEx( playerid, "No hi's !" );
        return 1;
    }
Where I put this?
Reply
#8

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "pin pon", true) != -1) return Ban(playerid);
    return 1;
}
Use the one that was made for BenzoAMG.

You just have to do strfind...

Strcmp doesn't detect spaces, strfind does.
Reply
#9

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Use the one that was made for BenzoAMG.

You just have to do strfind...

Strcmp doesn't detect spaces, strfind does.
Doesnt work for me And not needed too enymore
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)