Jump to content

Recommended Posts

Posted

Salut, doresc sa ma ajute cineva cu comanda /arrest
vreau sa-mi schimbati comanda sa fie simpla de genu sa dau doar /arrest [playerid] nu complicata cum e ea.

  Ascunde conținuturi

    if(strcmp(cmd, "/arrest", true) == 0)
    {
        if(IsPlayerConnected(playerid))
           {
            if(gTeam[playerid] == 2  || IsACop(playerid))
            {
                if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You are not on Duty!");
                    return 1;
                }
                if(!PlayerToPoint(6.0, playerid, 1527.9849,-1664.6001,6.2188))// || PlayerToPoint(6.0, playerid, -1566.4946,755.7339,-4.9063))
                {// Jail spot
                    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest !");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                moneys = strval(tmp);
                if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $99999 !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new time = strval(tmp);
                if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bail = strval(tmp);
                if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1 !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bailprice = strval(tmp);
                if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
                new suspect = GetClosestPlayer(playerid);
                if(IsPlayerConnected(suspect))
                {
                    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
                    {
                        GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        if(PlayerInfo[suspect][pWantedLevel] < 1)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Player must be at least Wanted Level 1 !");
                            return 1;
                        }
                        format(string, sizeof(string), "* You arrested %s !", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        GivePlayerMoney(suspect, -moneys);
                        format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
                        GameTextForPlayer(suspect, string, 5000, 5);
                        ResetPlayerWeapons(suspect);
                        if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
                        {
                            format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
                        {
                            format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
                        {
                            format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                         SetPlayerInterior(suspect, 10);
                        SetPlayerPos(suspect,223.2281,114.4777,999.0156);
                        PlayerInfo[suspect][pJailTime] = time * 60;
                        if(bail == 1)
                        {
                            JailPrice[suspect] = bailprice;
                            format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        else
                        {
                            JailPrice[suspect] = 0;
                            format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        PlayerInfo[suspect][pJailed] = 1;
                        PlayerInfo[suspect][pArrested] += 1;
                        SetPlayerFree(suspect,playerid, "Got Arrested");
                         TextDrawShowForPlayer(suspect, JailTD[suspect]);
                        WantedPoints[suspect] = 0;
                        WantedLevel[suspect] = 0;
                        WantLawyer[suspect] = 1;
                    }//distance
                }//not connected
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   No-one close enough to arrest.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop / FBI / NG !");
                return 1;
            }
        }//not connected
        return 1;
    }

 

Posted

CMD:arrest(playerid, params[])
{
    if(IsPlayerConnected(playerid))
       {
        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
        {
            if(PlayerToPoint(12.0, playerid, 268.8965,78.1789,1001.0391) || PlayerToPoint(6.0, playerid, 1528.7789,-1677.9139,5.8906))
            {
                new tmp[60], idx, moneys, giveplayer[MAX_PLAYERS], sendername[MAX_PLAYER_NAME], string[196];
                tmp = strtok(params, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, 0xC10000FF, "Foloseste: {FFFFFF}/arrest [playerid] [pret] [timp (minute)]");
                    return 1;
                }
                new suspect;
                suspect = ReturnUser(tmp);
                if(suspect == INVALID_PLAYER_ID) { format(string, sizeof(string), "  %d nu este conectat.", suspect); SendClientMessage(playerid, COLOR_GREY, string); return 1; }
                tmp = strtok(params, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/arrest [playerid] [pret] [timp (minute)]");
                    return 1;
                }
                moneys = strvalEx(tmp);
                if(moneys < 1 || moneys > 9999)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Pretul trebuie sa fie cuprins intre $1 si $10000!");
                    return 1;
                }
                tmp = strtok(params, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/arrest [playerid] [pret] [timp (minute)]");
                    return 1;
                }
                new time = strvalEx(tmp);
                if(time < 1 || time > 20)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{C10000}Info: {FFFFFF}Timpul de puscarie trebuie sa fie cuprins intre 1 si 20 minute!");
                    return 1;
                }
                if(IsPlayerConnected(suspect))
                {
                    if(GetDistanceBetweenPlayers(playerid,suspect) < 10)
                    {
                        GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        if(WantedLevel[suspect] < 1)
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "{C10000}Info: {FFFFFF}Jucatorul trebuie sa aiba cel putin wanted level 1!");
                            return 1;
                        }
                        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            format(string, sizeof(string), "L-ai arestat pe %s pentru %d secunde !", giveplayer, PlayerInfo[suspect][pJailTime]);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            GivePlayerCash(suspect, -moneys);
                            GivePlayerCash(playerid, moneys);
                            format(string, sizeof(string), "Arestat de %s ~n~ pentru $%d ", sendername, moneys);
                            GameTextForPlayer(suspect, string, 5000, 5);
                            ResetPlayerWeapons(suspect);
                          }
                        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                        {
                            format(string, sizeof(string), "<< Ofiterul %s a arestat suspectul %s pentru %d secunde, $%d. >>", sendername, giveplayer, time*60, moneys);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
                        {
                            format(string, sizeof(string), "<< Agentul FBI %s a arestat suspectul %s pentru %d secunde, $%d. >>", sendername, giveplayer, time*60,  moneys);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                        {
                            format(string, sizeof(string), "<< Soldatul %s a arestat suspectul %s pentru %d secunde, $%d. >>", sendername, giveplayer, time*60, moneys);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        PlayerInfo[suspect][pJailTime] = time * 60;
                        format(string, sizeof(string), "UPDATE players SET JailTime='%d' WHERE id=%d", PlayerInfo[suspect][pJailTime], PlayerInfo[suspect][pSQLID]);
                        mysql_query(string);

                        new celula = random(6);
                        if(celula == 1)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 2;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -177.1723,20.2788,1277.4308);
                        }
                        else if(celula == 2)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 3;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -144.1180,18.4294,1277.4308);
                        }
                        else if(celula == 3)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 4;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -143.8891,-0.4445,1277.4308);
                        }
                        else if(celula == 4)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 5;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -171.2202,0.1797,1273.9252);
                        }
                        else if(celula == 5)
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 1;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -158.5971,0.0016,1273.9252);
                        }
                        else
                        {
                            TogglePlayerControllable(suspect, 0);
                            SetTimerEx("UnfreezePlayerTime", 3000, false, "d", suspect);
                            PlayerInfo[suspect][pJailed] = 1;
                            SetPlayerInterior(suspect, 1);
                            SetPlayerPos(suspect, -158.6696,17.3605,1273.9252);
                        }
                        PlayerInfo[suspect][pArrested] += 1;
                        SetPlayerFree(suspect,playerid, "Bun arest");
                        WantedPoints[suspect] = 0;
                        WantedLevel[suspect] = 0;

                        PlayerInfo[suspect][pWantedPoints] = WantedPoints[suspect];
                        format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerInfo[suspect][pWantedPoints], PlayerInfo[suspect][pSQLID]);
                        mysql_query(string);
                        format(string, sizeof(string), "UPDATE players SET Arrested='%d' WHERE id=%d", PlayerInfo[suspect][pArrested], PlayerInfo[suspect][pSQLID]);
                        mysql_query(string);
                        format(string, sizeof(string), "UPDATE players SET WantedLevel='%d' WHERE id=%d", WantedLevel[suspect], PlayerInfo[suspect][pSQLID]);
                        mysql_query(string);
                        format(string, sizeof(string), "UPDATE players SET Jailed='%d' WHERE id=%d", PlayerInfo[suspect][pJailed], PlayerInfo[suspect][pSQLID]);
                        mysql_query(string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{C10000}Info: {FFFFFF}Nu e nici-un suspect langa tine.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "{C10000}Info: {FFFFFF}Nu esti langa sediul politie, nu poti aresta!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{C10000}Info: {FFFFFF}Nu esti autorizat sa folosesti aceasta comanda!");
            return 1;
        }
    }
    return 1;
}

 

Posted
Chiar acum, LorD. a spus:

Salut, doresc sa ma ajute cineva cu comanda /arrest
vreau sa-mi schimbati comanda sa fie simpla de genu sa dau doar /arrest [playerid] nu complicata cum e ea.

  Reafișează conținuturi ascunse

    if(strcmp(cmd, "/arrest", true) == 0)
    {
        if(IsPlayerConnected(playerid))
           {
            if(gTeam[playerid] == 2  || IsACop(playerid))
            {
                if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You are not on Duty!");
                    return 1;
                }
                if(!PlayerToPoint(6.0, playerid, 1527.9849,-1664.6001,6.2188))// || PlayerToPoint(6.0, playerid, -1566.4946,755.7339,-4.9063))
                {// Jail spot
                    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest !");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                moneys = strval(tmp);
                if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $99999 !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new time = strval(tmp);
                if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bail = strval(tmp);
                if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1 !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{66FFCC}Foloseste:{FFFFFF} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bailprice = strval(tmp);
                if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
                new suspect = GetClosestPlayer(playerid);
                if(IsPlayerConnected(suspect))
                {
                    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
                    {
                        GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        if(PlayerInfo[suspect][pWantedLevel] < 1)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Player must be at least Wanted Level 1 !");
                            return 1;
                        }
                        format(string, sizeof(string), "* You arrested %s !", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        GivePlayerMoney(suspect, -moneys);
                        format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
                        GameTextForPlayer(suspect, string, 5000, 5);
                        ResetPlayerWeapons(suspect);
                        if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
                        {
                            format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
                        {
                            format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
                        {
                            format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
                            OOCNews(COLOR_LIGHTRED, string);
                        }
                         SetPlayerInterior(suspect, 10);
                        SetPlayerPos(suspect,223.2281,114.4777,999.0156);
                        PlayerInfo[suspect][pJailTime] = time * 60;
                        if(bail == 1)
                        {
                            JailPrice[suspect] = bailprice;
                            format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        else
                        {
                            JailPrice[suspect] = 0;
                            format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        PlayerInfo[suspect][pJailed] = 1;
                        PlayerInfo[suspect][pArrested] += 1;
                        SetPlayerFree(suspect,playerid, "Got Arrested");
                         TextDrawShowForPlayer(suspect, JailTD[suspect]);
                        WantedPoints[suspect] = 0;
                        WantedLevel[suspect] = 0;
                        WantLawyer[suspect] = 1;
                    }//distance
                }//not connected
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   No-one close enough to arrest.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop / FBI / NG !");
                return 1;
            }
        }//not connected
        return 1;
    }

 

CMD:arrest(playerid, params[]) {

	new
		string[128],
		playerName[2][MAX_PLAYER_NAME],
		targetID;

	if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1) return SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");

	else if(sscanf(params, "u", targetID)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/arrest [playerid]");

	else if((IsPlayerInRangeOfPoint(playerid,5, 1528.5240,-1678.2472,5.8906) && IsPlayerInRangeOfPoint(targetID,5, 1528.5240,-1678.2472,5.8906)) || ((IsPlayerInRangeOfPoint(playerid,5, -1605.8667,675.1851,-5.6662) && IsPlayerInRangeOfPoint(targetID,5, -1605.8667,675.1851,-5.6662)) || ((IsPlayerInRangeOfPoint(playerid,5, 2282.2065,2431.0796,3.0005) && IsPlayerInRangeOfPoint(targetID,5, 2282.2065,2431.0796,3.0005)))))
	{

			if(playerVariables[targetID][pFreezeType] == 2)
			{
			        GetPlayerName(playerid, playerName[0], MAX_PLAYER_NAME);
					GetPlayerName(targetID, playerName[1], MAX_PLAYER_NAME);
					format(playerVariables[targetID][pCrimeReason], MAX_PLAYER_NAME, "");
                    if(playerVariables[targetID][pWarrants] == 1)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 1000$ with a sentence of 2 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 1000;
						playerVariables[targetID][pPrisonTime] = 120;
						playerVariables[playerid][pMoney] += 1000;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];

						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);
                    }
                    if(playerVariables[targetID][pWarrants] == 2)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 2500$ with a sentence of 5 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 2500;
                        playerVariables[playerid][pMoney] += 2500;
						playerVariables[targetID][pPrisonTime] = 300;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];
						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);
                    }
                    if(playerVariables[targetID][pWarrants] == 3)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 4500$ with a sentence of 7 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 4500;
						playerVariables[targetID][pPrisonTime] = 420;
						playerVariables[playerid][pMoney] += 4500;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];
						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);
                    }
                    if(playerVariables[targetID][pWarrants] == 4)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 6000$ with a sentence of 10 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 6000;
						playerVariables[targetID][pPrisonTime] = 600;
						playerVariables[playerid][pMoney] += 6000;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];
						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);

                    }
                    if(playerVariables[targetID][pWarrants] == 5)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 8000$ with a sentence of 15 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 8000;
						playerVariables[targetID][pPrisonTime] = 900;
						playerVariables[playerid][pMoney] += 8000;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];
						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);
                    }
                    if(playerVariables[targetID][pWarrants] == 6)
                    {
						format(string, sizeof(string),"%s has arrested suspect %s, issuing a fine of 10000$ with a sentence of 20 minutes.", playerName[0], playerName[1]);
						SCMTA(COLOR_LIGHTRED,string);
                        playerVariables[targetID][pMoney] -= 10000;
						playerVariables[targetID][pPrisonTime] = 1200;
						playerVariables[playerid][pMoney] += 5000;
						validResetPlayerWeapons(targetID);
						playerVariables[targetID][pFreezeTime] = 0;
						playerVariables[targetID][pFreezeType] = 0;
						playerVariables[targetID][pPrisonID] = 3;
						playerVariables[targetID][pWarrants] = 0;
		               	SetPlayerWantedLevel(targetID, 0);
						SetPlayerArmour(targetID, 0);
						TogglePlayerControllable(targetID, true);
						playerVariables[targetID][pArmour] = 0;
						playerVariables[targetID][pArrests]++;
						playerVariables[targetID][pCrimes] += playerVariables[targetID][pWarrants];
						SetPlayerInterior(targetID, 6);
						SetPlayerVirtualWorld(targetID, GROUP_VIRTUAL_WORLD+0);
						new spawn = random(sizeof(JailSpawns));
						SetPlayerPos(targetID, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
						SetPlayerFacingAngle(targetID, 0);
                    }
                    format(playerVariables[targetID][pCrimeReason], 250, "");
            }
			else SendClientMessage(playerid, COLOR_GREY, "The person you wish to arrest must be restrained first (cuffed).");
	}
	return 1;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.