01.01.2017, 15:00
You only need to add SendClientMessageToAll under the both formats! And you don't need both callbacks (OnPlayerCommandText), only one.
You must not define a global string, you must make one for each format, regards!
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/offduty", cmdtext, true, 5) == 0)
{
new string[128];
SendClientMessage(playerid,0xFFFFFF,"You're now an off-duty cop.");
format(string, sizeof(string), "%s [%d] is now an off-duty cop.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendClientMessageToAll(-1, string);
}
if (strcmp("/onduty", cmdtext, true, 5) == 0)
{
new string[128];
SendClientMessage(playerid,0xFFFFFF,"You're now an on-duty cop.");
format(string, sizeof(string), "%s [%d] is now an on-duty cop.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SendClientMessageToAll(-1, string);
}
return 0;
}