Scripting command(s)
#2

You only need to add SendClientMessageToAll under the both formats! And you don't need both callbacks (OnPlayerCommandText), only one.

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;
}
You must not define a global string, you must make one for each format, regards!
Reply


Messages In This Thread
Scripting command(s) - by Wrench - 01.01.2017, 14:51
Respuesta: Scripting command(s) - by Goncho28 - 01.01.2017, 15:00
Re: Scripting command(s) - by Loinal - 01.01.2017, 15:01
Re: Scripting command(s) - by Wrench - 01.01.2017, 15:09
Re: Scripting command(s) - by saffierr - 01.01.2017, 16:27
Re: Scripting command(s) - by Codeah - 01.01.2017, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)