19.10.2013, 08:30
In your code, all you're sending is just the NameOfPlayer, so all it will say is:
And that's it, it won't say the text. I fixed that below.
Can you show us the stock for NameOfPlayer? It should have square brackets "[playerid]" like it does in the format.
Quote:
Steve |
pawn Код:
CMD:newbie(playerid, params[])
{
if(Player[playerid][NMute] == 1) return SendErrorMessage(playerid, "You are unable to use /(n)ewbie, reason: muted");
new text[200], string[250];
if(sscanf(params, "s[200]", text)) return SendErrorMessage(playeid, "/(n)ewbie [text]");
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(Player[p][NToggled] != 1 && Player[p][NMute] != 1)
{
format(string, sizeof(string), "Newbie chat: %s: %s", NameOfPlayer[playerid], text); // make sure that your stock for NameOfPlayer has square brackets,
SendClientMessage(i, Colour_Newbie_Chat, string);
}
}
return 1;
}
return 1;
}