11.04.2012, 19:46
Is it possible converting this to ZCMD?:
I have tried but no luck. Here is what I did:
Or can someone tell me what I'm doing wrong?
pawn Код:
if (strcmp("/copmessage", cmdtext, true, 11) == 0)
{
if(strlen(cmdtext) <= 11)
{
SendClientMessage(playerid,red,"USAGE: /copmessage (message) - Enter A Valid Cop Message.");
return 1;
}
else
{
new output[255];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,12,strlen(cmdtext));
format(string, sizeof(string), "COP MESSAGE: %s(%d) %s",pname,playerid,output);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Team == TEAM_COP)
{
format(string, sizeof(string), "COP MESSAGE: %s (%d): %s",pname,playerid,output);
MessageToCops(blue,string);
//SendClientMessage(i,blue,string);
return 1;
}
else
{
if(isnull(cmdtext)) return SendClientMessage(playerid,red,"You Are Not A Cop. You May Not Use The Cop Radio Device.");
SendClientMessage(playerid,red,"You Are Not A Cop. You May Not Use The Cop Radio Device.");
return 1;
}
}
}
}
pawn Код:
CMD:cm(playerid, params[])
{
if(strlen(cmdtext) <= 11)
{
SendClientMessage(playerid,red,"USAGE: /cm (message) - sends a message out to all Cops.");
return 1;
}
else
{
new output[255];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,12,strlen(cmdtext));
format(string, sizeof(string), "[COP MESSAGE] %s(%d) %s",pname,playerid,output);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Team == TEAM_COP)
{
format(string, sizeof(string), "[COP MESSAGE] %s (%d): %s",pname,playerid,output);
MessageToCops(blue,string);
//SendClientMessage(i,blue,string);
return 1;
}
else
{
if(isnull(cmdtext)) return SendClientMessage(playerid,red,"You Are Not A Cop. You Cannot Use The Cop Radio.");
SendClientMessage(playerid,red,"You Are Not A Cop. You Cannot Use The Cop Radio.");
return 1;
}
}
}
}