Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/arreter", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(gTeam[playerid] == 2 || IsACop(playerid))
- {
- if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Vous n'êtes pas en service!");
- return 1;
- }
- /*if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || !PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828))
- {// Jail spot
- SendClientMessage(playerid, COLOR_GREY, " You are not near the Jail, can't Arrest!");
- return 1;
- }*/
- if(PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828) || PlayerToPoint(6.0, playerid, 1528.9080,-1678.0759,5.8906) || PlayerToPoint(15.0, playerid,2292.0945,2452.4775,10.8203) || PlayerToPoint(15.0, playerid,2293.1460,2467.8892,10.8203))
- {//New arrest system
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arreter [prix] [temps (minutes)] [caution (0=non 1=Oui)] [prixcaution]");
- return 1;
- }
- moneys = strval(tmp);
- if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "Le prix de prison ne peux être en desous de $1 et au desus de $99999!"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arreter [prix] [temps (minutes)] [caution (0=non 1=Oui)] [prixcaution]");
- return 1;
- }
- new time = strval(tmp);
- if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "Le temps de prison ne peux être en desous de 1 et au desus de 20 minutes!"); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arreter [prix] [temps (minutes)] [caution (0=non 1=Oui)] [prixcaution]");
- 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(WantedLevel[suspect] < 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Ce joueur doit avoir au moin 1 niveau de recherche!");
- return 1;
- }
- format(string, sizeof(string), "Vous avez arreté %s!", giveplayer);
- SendClientMessage(playerid, COLOR_WHITE, string);
- SafeGivePlayerMoney(suspect, -moneys);
- format(string, sizeof(string), "Arreter par %s ~n~ pour $%d", sendername, moneys);
- GameTextForPlayer(suspect, string, 5000, 5);
- SafeResetPlayerWeapons(suspect);
- if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
- {
- new currank[64];
- if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
- else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officier"; }
- else if(PlayerInfo[playerid][pRank] == 3) { currank = "Corporal"; }
- else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
- else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
- else if(PlayerInfo[playerid][pRank] == 6) { currank = "Capitaine"; }
- else if(PlayerInfo[playerid][pRank] == 7) { currank = "Chef Adjoint"; }
- else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chef"; }
- else { currank = "Cadet"; }
- format(string, sizeof(string), "[Police] %s %s vien d'arreter %s", currank ,sendername, giveplayer);
- OOCNews(COLOR_BLUE, string);
- }
- else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
- {
- format(string, sizeof(string), "[Police] Agent %s vien d'arreter %s", sendername, giveplayer);
- OOCNews(COLOR_BLUE, string);
- }
- SetPlayerInterior(suspect, 6);
- SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
- PlayerInfo[suspect][pJailTime] = time * 60;
- PlayerCuffed[suspect] = 0;
- TogglePlayerControllable(suspect, 1);
- if(bail == 1)
- {
- JailPrice[suspect] = bailprice;
- format(string, sizeof(string), "Vous êtes en prison pour %d secondes. Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
- SendClientMessage(suspect, COLOR_WHITE, string);
- }
- else
- {
- JailPrice[suspect] = 0;
- format(string, sizeof(string), "Vous avez emprisonné le suspect pour %d secondes. Caution: Aucune", PlayerInfo[suspect][pJailTime]);
- SendClientMessage(suspect, COLOR_WHITE, string);
- }
- PlayerInfo[suspect][pJailed] = 1;
- PlayerInfo[suspect][pArrested] += 1;
- SetPlayerFree(suspect,playerid, "Arreter");
- WantedPoints[suspect] = 0;
- WantedLevel[suspect] = 0;
- WantLawyer[suspect] = 1;
- }//distance
- }//not connected
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Personne à emprisonné.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Vous n'êtes pas dans la cellule.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Vous n'êtes pas policier!");
- return 1;
- }
- }//not connected
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement