SA-MP Forums Archive
Double text on caht... - 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: Double text on caht... (/showthread.php?tid=411404)



Double text on caht... - Scrillex - 28.01.2013

Код:
public OnPlayerText(playerid,text[])
{
    if((GetTickCount() - GetPVarInt(playerid, "AntiSpam")) > 1)
    {
        SendClientMessageToAll(-1, text);
        SetPVarInt(playerid, "AntiSpam", GetTickCount());
    }
    else
    {
        SendClientMessage(playerid, -1, "You must wait 10 seconds before using another Command!");
    }
    if(text[0] == '#')
    {
        new string[128];  GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]);
        printf("%s", string);

        for(new i = 0; i < MAX_PLAYERS; i++) 
        {
            if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
    return 0;
}
I rally cant find anything...

Maybe someone can help.. In chat it shows like

Код:
ha
Nick: ha



Re: Double text on caht... - Roach_ - 28.01.2013

Have you looked in your Filterscripts ?


Re: Double text on caht... - Scrillex - 28.01.2013

Don't have them!


AW: Double text on caht... - LeBoyce - 28.01.2013

return 1 when you sent your text


Re: Double text on caht... - Scrillex - 28.01.2013

That ain't a answer!


AW: Double text on caht... - LeBoyce - 28.01.2013

Yes, read to fast.

Remove SendClientMessageToAll();
Код:
    if((GetTickCount() - GetPVarInt(playerid, "AntiSpam")) > 1)
    {
        SendClientMessageToAll(-1, text);
        SetPVarInt(playerid, "AntiSpam", GetTickCount());
    }



Re: Double text on caht... - MP2 - 28.01.2013

You need to return 0 if you don't want the text to be sent.