Hello.
PHP код:
dcmd_amsg(playerid,params[])
{
if(AccInfo[playerid][Level] >= 1 && AccInfo[playerid][LoggedIn] == 1)
{
new text[256], id;
new str[128];
if(sscanf(params, "us[256]",id,text)) return GameTextForPlayer(playerid,"~g~/amsg ~w~(id) (text)",3000,3);
if(AccInfo[id][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return GameTextForPlayer(playerid,"~r~~h~ERROR: You cannot use this command on this admin",6000,3);
if(!IsPlayerConnected(id)) return GameTextForPlayer(playerid,"~r~player is not connected",4000,3);
format(str,sizeof(str),"{FFFFFF}%s",text);
ShowPlayerDialog(id,13003,DIALOG_STYLE_MSGBOX,"{00FF00}Admins Message",str,"Close","");
}
return 1;
}
The new line '\n' is one character. The problem is that it takes your input as two characters separated.
You need a loop and check if current index is equal to '\\' and index+1 is equal to 'n' character. Then replace index with ' ' and index+1 with '\n' character.