SA-MP Forums Archive
Chat problem - 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 problem (/showthread.php?tid=445055)



Chat problem - martoivanov - 19.06.2013

When someone types something it appears two times in the chat. What can i do to fix this?
Here is my code in OnPlayertext

pawn Код:
public OnPlayerText(playerid,text[])
{

     new textstring[128];
    format(textstring, sizeof(textstring), "(%i) %s" ,playerid ,text);
    SendPlayerMessageToAll(playerid, textstring);

if(QuestionStarted == 1 && strfind(text[0], Question, false) == 0)
            {
                new string[128];
                    format(string, sizeof(string), " %s won $%d by typing '%s'!", PlayerName[playerid], RandomQuestionMoney, Question);
                    SendClientMessageToAll(COLOR_GREEN, string);
                    GivePlayerMoney(playerid, RandomQuestionMoney);
                    QuestionStarted = 0;
                    return 0;
            }

return 1;
}



Re: Chat problem - MP2 - 19.06.2013

Change return 1 to return 0 at the bottom.


Re: Chat problem - martoivanov - 19.06.2013

thank you very much