public OnPlayerText(playerid, text[]) { switch(ChatState{playerid}) { case 0: { CostumFormat(SCSString,"%s: %s",GetPlayerNameEx(playerid),text); SCGeneral(playerid,SCSString,5,7,10,13,15,SWhite,SChat1,SChat2,SChat3,SChat4); } case 1: { CostumFormat(SCSString,"[Chuchotement]%s: %s",GetPlayerNameEx(playerid),text); SCGeneral(playerid,text,2,4,6,8,10,COLOR_GREY,SChat1,SChat2,SChat3,SChat4); } case 2: { CostumFormat(SCSString,"[Crie]%s: %s",GetPlayerNameEx(playerid),text); SCGeneral(playerid,text,15,20,25,30,35,SWhite,SChat1,SChat2,SChat3,SChat4); } } SCAnim(playerid,text,at); return 1; }
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;
}
"strreplace(pname,'_',' ');"
Where does it comes from? Because i got "error 017: undefined symbol "strreplace"" Thanks |
stock strreplace(src[], chartoreplace[], with[])
{
for(new i = 0; i < strlen(src); i++)
{
if(!strcmp(src[i], chartoreplace))
{
format(src[i], 1, "%s", with);
}
}
return src;
}
strreplace(string, "a", "b");