08.03.2012, 21:35
What MP2 said is entirely correct. Returning 1 sends the traditional samp chat. Wait, why would you make your own format function? You are not defining the string. This is how my OnPlayerText code looks. Try to change your stragedy in light of seeing mine.
pawn Код:
public OnPlayerText(playerid, text[])
{
new pname[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, pname, sizeof(pname));
strreplace(pname,'_',' ');
switch(pInfo[playerid][pAccent])
{
case 0:format(str, sizeof(str), "%s says: %s", pname, text);
case 1:format(str, sizeof(str), "[American Accent] %s says: %s", pname, text);
case 2:format(str, sizeof(str), "[Mexican Accent] %s says: %s", pname, text);
case 3:format(str, sizeof(str), "[Russian Accent] %s says: %s", pname, text);
}
ProxDetector(30.0, playerid, str, COLOR_WHITE);
new lstring[254];
new File:chatlog=fopen(LOG,io_append);
format(lstring,254,"[chat][local][%s]: %s\r\n",pname,text);
fwrite(chatlog,lstring);
fclose(chatlog);
return 0;
}

