Disabling the OnPlayerText Through Include?
#1

i'm making a include called "Badword" but accidentally i cannot disable my format text onplayertext which is return 0;
i try to add return 0; in the include code but nothing happens it show like

Код:
ScriptJorkis: [0] Test
The word Bitch has been replace with Anti-badword Replacement
ScriptJorkis: [0] Bitch
how can i fix this problem?
Reply
#2

Show some of your code in OnPlayerText which is related to the word censoring
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(GetPVarInt(playerid, "Muted") == 1)
    {
        SendClientMessage(playerid,COLOR_RED, "You cant talk while on Class Selection");
        return 0;
    }
    else if(GetPVarInt(playerid, "Muted") == 0)
    {
        format(text, 1024, "%s: {FFFFFF}[%d] {FFFFFF}%s", PlayerName, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), text);
        return 0;
    }

    ChatLog(playerid, text);

    CreateBadword("Bitch");
    return 0;
}
Reply
#4

pawn Код:
new badwords[][] =
{
    "Bitch",
    "Whore",
    "Fuck"
};
public OnPlayerText(playerid, text[])
{
   
    for (new loop; loop < sizeof(badwords); loop ++)
    {
        new sfind = strfind(text, badwords[loop], true);
        if(sfind == -1) continue;
        while(text[sfind ] != 0 || text[sfind ] != ' ') text[sfind] = '*';
    }
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(GetPVarInt(playerid, "Muted") == 1)
    {
        SendClientMessage(playerid,COLOR_RED, "You cant talk while on Class Selection");
        return 0;
    }
    else if(GetPVarInt(playerid, "Muted") == 0)
    {
        format(text, 1024, "%s: {FFFFFF}[%d] {FFFFFF}%s", PlayerName, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), text);
        return 0;
    }
    return 1;
}
Was a rough idea that I just put together .
Reply
#5

lol i don't want when i type bitch it would became ****.
want to see my include here you go just come of the codes not the full version

pawn Код:
stock CreateBadword(text[])
{
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
    if(IsPlayerConnected(i))
    {
            new string[1052],pname[MAX_PLAYER_NAME];
            new RandomReplace = random(4);
            GetPlayerName(i, pname, sizeof(pname));
            switch(RandomReplace)
            {
                case 0:
                {
                   format(string,sizeof(string), "%s: "WHITE"[%d] i love to say badword but i'm so stupid and forgetful", pname, i);
                   SendClientMessageToAll(GetPlayerColor(i),string);
                }
                case 1:
                {
                   format(string,sizeof(string), "%s: "WHITE"[%d] i'm so stupid i forget that swearing is not good", pname, i);
                   SendClientMessageToAll(GetPlayerColor(i),string);
                }
                case 2:
                {
                   format(string,sizeof(string), "%s: "WHITE"[%d] i love you guys as i want to say today", pname, i);
                   SendClientMessageToAll(GetPlayerColor(i),string);
                }
                case 3:
                {
                   format(string,sizeof(string), "%s: "WHITE"[%d] today is the good day no agruments between my playmate", pname, i);            
                   SendClientMessageToAll(GetPlayerColor(i),string);
                }
            }
            format(string,sizeof(string), "The word %s has been replace with Antibadword Replacement", text);
            SendClientMessage(i,GetPlayerColor(i),string);
        }
     }
     return 1;
}
Reply
#6

Simple as fast:

pawn Код:
new BadWords[][] =
{
    "Motherfucker",
    "Nigga",
    "Nigger",
    "Asshole",
    "Bitch",
    "Cunt",
    "Fuckin bastard",
    "Stupid bitch",
    "fuckin nigga!",
    "hijo de puta",
    "puta",
    "/q",
    " /q",
    "/q for free money"
};
OnPlayerText:

pawn Код:
for(new a; a<sizeof(BadWords); a++)
{
    if(strfind(text, BadWords[a], true) != -1)
    {
        return 0;
     }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)