SA-MP Forums Archive
Chat doesn't change. - 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: Chat doesn't change. (/showthread.php?tid=557884)



Chat doesn't change. - xX4m4zingXx - 15.01.2015

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



Re: Chat doesn't change. - CalvinC - 15.01.2015

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


Re: Chat doesn't change. - xX4m4zingXx - 15.01.2015

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


Re: Chat doesn't change. - CalvinC - 15.01.2015

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.


Re: Chat doesn't change. - xX4m4zingXx - 15.01.2015

Okay, that worked. Thank you.