Chat doesn't change.
#1

I have added a chat filterscript, but my chat doesn't change. It just stays the same as it was before.
This is the filterscript.
Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <foreach>

#define FILTERSCRIPT

stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}

stock GetName(playerid)
{
    new
        name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}

stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}

public OnPlayerText(playerid, text[])
{
    new message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, message, -1);
    return 0;
    
}
In my gamemode I have this:
Код:
public OnPlayerText()
{
	return 0;
}
Reply
#2

Have you put your filterscript name in the server.cfg next to filterscripts?
Reply
#3

Yes I added it there.
If I type a message ingame, nothing shows up.
Reply
#4

Try putting the codes in your gamemode then.
I've not tried having the chat in your filterscript, it might be returning 0 so your filterscript can't send the chat message too.
Sorry if im wrong though.
Reply
#5

Okay, that worked. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)