SA-MP Forums Archive
Convert /mir to ZCMD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Convert /mir to ZCMD (/showthread.php?tid=379482)



Convert /mir to ZCMD - MrSnapp - 22.09.2012

Hey there! I like this ravens RP command and I want it converted to ZCMD please. Any help is appreciated. Thanks!

pawn Код:
if(strcmp(cmd, "/mir", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid) || IsAFreecop(playerid))
            {
                if(PlayerInfo[playerid][pDuty] == 1)
                {
                    format(string, sizeof(string),"%s reads out the Miranda Rights:",sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    ProxDetector(30.0, playerid, "You have the right to remain silent, anything you say or do can and will be held against you in a court of law", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                    ProxDetector(30.0, playerid, "You have the right to an attorney, If you cannot afford an attorney, one will be provided for you", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                    ProxDetector(30.0, playerid, "You have the right to a Phone Call, but only ONE. Do you understand these rights I have just read to you?", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                }
            }
        }
        return 1;
    }



Re: Convert /mir to ZCMD - clarencecuzz - 22.09.2012

pawn Код:
CMD:mir(playerid, params[])
{
    if(IsACop(playerid) || IsAFreecop(playerid))
    {
        if(PlayerInfo[playerid][pDuty] == 1)
        {
            format(string,sizeof(string),"%s reads out the Miranda Rights:",sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            ProxDetector(30.0, playerid, "You have the right to remain silent, anything you say or do can and will be held against you in a court of law", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            ProxDetector(30.0, playerid, "You have the right to an attorney, If you cannot afford an attorney, one will be provided for you", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            ProxDetector(30.0, playerid, "You have the right to a Phone Call, but only ONE. Do you understand these rights I have just read to you?", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        }
    }
    return 1;
}
Remember: ZCMD commands do not go under ANY public functions. So you don't need to place this under OnPlayerCommandText.


Re: Convert /mir to ZCMD - MrSnapp - 22.09.2012

Okay I used your code you gave and added some things but when I type the CMD nothing comes up.

pawn Код:
CMD:mir(playerid, params[])
{
    new string[128], sendername[MAX_PLAYER_NAME];
    if(IsACop(playerid))
    {
        if(PlayerInfo[playerid][pDuty] == 1)
        {
            format(string,sizeof(string),"%s reads out the Miranda Rights:",sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            ProxDetector(30.0, playerid, "You have the right to remain silent, anything you say or do can and will be held against you in a court of law", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            ProxDetector(30.0, playerid, "You have the right to an attorney, If you cannot afford an attorney, one will be provided for you", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            ProxDetector(30.0, playerid, "You have the right to a Phone Call, but only ONE. Do you understand these rights I have just read to you?", COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        }
    }
    return 1;
}



Re: Convert /mir to ZCMD - JhnzRep - 22.09.2012

Change IsACop(playerid) to your enum or what ever you use to define cops.