This should work:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/ma", true, 3)
{
if(!strlen(cmdtext)) return 1; /* No text was set in the command*/
new str[150], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizef(str), "{FFFF00}[Admin Megaphone:] {FFFFFF}%s", cmdtext);
SendClientMessageToAll(0xFFFFFF, str);
}
return 1;
}
CMD:ma(playerid, params[])
{
new text[150];
if(sscanf(params, "s[150]", text)) return 1; /* No text*/
new str[150], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizef(str), "{FFFF00}[Admin Megaphone:] {FFFFFF}%s", text);
SendClientMessageToAll(0xFFFFFF, str);
return 1;
}
EDIT: just noticed GetPlayerName & pName is not used in the string.. can delete it