SA-MP Forums Archive
When types "Hi" gets banned - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: When types "Hi" gets banned (/showthread.php?tid=406632)



When types "Hi" gets banned - RiChArD_A - 11.01.2013

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.


Re: When types "Hi" gets banned - [CG]Milito - 11.01.2013

Use
pawn Код:
Strfind



Re: When types "Hi" gets banned - Threshold - 11.01.2013

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



Re: When types "Hi" gets banned - RajatPawar - 11.01.2013

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;
    }



Re: When types "Hi" gets banned - Mr.Anonymous - 11.01.2013

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


Respuesta: Re: When types "Hi" gets banned - RiChArD_A - 13.01.2013

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.


Re: When types "Hi" gets banned - martin3644 - 13.01.2013

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?


Re: When types "Hi" gets banned - ThePhenix - 14.01.2013

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.


Re: When types "Hi" gets banned - martin3644 - 14.01.2013

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