Scripting command(s)
#1

Hello, everyone! I want to make a command. /onduty and /offduty for cops. I want like:
I did /offduty
I got the message: You're now an off-duty cop.
Everyone got: Wrench(ID.) is now an off-duty cop.
etc.
I did this:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/offduty", cmdtext, true, 5) == 0)
	{
SendClientMessage(playerid,0xFFFFFF,"You're now an off-duty cop.");
        format(fstr, sizeof(fstr), "%s [%d] is now an off-duty cop.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
        }
 	return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/onduty", cmdtext, true, 5) == 0)
	{
SendClientMessage(playerid,0xFFFFFF,"You're now an on-duty cop.");
        format(fstr, sizeof(fstr), "%s [%d] is now an on-duty cop.", GetName(playerid), playerid, GetName(targetid), targetid, reason);
        }
 	return 0;
}
I am sure that it is wrong. How can I do this? Please help me guys.
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: 3 Guest(s)