Is this possible? +REP
#1

Is it possible converting this to ZCMD?:

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;
                }
            }
        }
    }
I have tried but no luck. Here is what I did:

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;
                }
            }
        }
    }
Or can someone tell me what I'm doing wrong?
Reply


Messages In This Thread
Is this possible? +REP - by TheMightyEddy - 11.04.2012, 19:46
Re: Is this possible? +REP - by The__ - 11.04.2012, 19:48
Re: Is this possible? +REP - by TheMightyEddy - 11.04.2012, 19:52
Re: Is this possible? +REP - by DBan - 11.04.2012, 19:53
Re: Is this possible? +REP - by ColdRain - 11.04.2012, 19:55
Re: Is this possible? +REP - by ReneG - 11.04.2012, 19:56

Forum Jump:


Users browsing this thread: 1 Guest(s)