Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:docarrest(playerid, params[])
- {
- if(!IsACop(playerid)) {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not part of the faction. ");
- }
- else if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2079.7764, -111.6902, 982.4116) && !IsPlayerInRangeOfPoint(playerid, 10.0, -2090.0583,-135.3540,40.1016) && !IsPlayerInRangeOfPoint(playerid, 10.0, -2053.8149,-198.9500,15.0703)) {
- SendClientMessageEx(playerid, COLOR_GREY, "You are not at the DoC Prison arrest point." );
- }
- else {
- new
- moneys,
- time,
- string[128];
- new suspect = GetClosestPlayer(playerid);
- if(sscanf(params, "dddd", moneys, time)) {
- SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /docarrest [fine] [minutes]");
- }
- else if(!(1 <= moneys <= 200000)) {
- SendClientMessageEx(playerid, COLOR_GREY, "The jail fine can't be below $1 or above $200,000.");
- }
- else if(!(1 <= time <= 120)) {
- SendClientMessageEx(playerid, COLOR_GREY, "Jail time can't be below 1 or above 120 minutes - take the person to prison for more time.");
- }
- else if(!IsPlayerConnected(suspect)) {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
- }
- else if(!ProxDetectorS(5.0, playerid, suspect)) {
- SendClientMessageEx(playerid, COLOR_GREY, "You are close enough to the suspect.");
- }
- else if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12) {
- SendClientMessageEx(playerid, COLOR_GREY, "The player must have a wanted level of at least one star.");
- }
- else {
- format(string, sizeof(string), "* You arrested %s!", GetPlayerNameEx(suspect));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- GivePlayerCash(suspect, -moneys);
- Tax += moneys;
- ResetPlayerWeaponsEx(suspect);
- for(new x; x < MAX_PLAYERVEHICLES; x++) if(PlayerVehicleInfo[suspect][x][pvTicket] >= 1) {
- PlayerVehicleInfo[suspect][x][pvTicket] = 0;
- }
- SetPlayerInterior(suspect, 10);
- new rand = random(sizeof(DocPrison));
- SetPlayerFacingAngle(suspect, 0);
- SetPlayerPosEx(suspect, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2]);
- if(PlayerInfo[suspect][pDonateRank] >= 2)
- {
- PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
- }
- else
- {
- PlayerInfo[suspect][pJailTime] = time * 60;
- }
- DeletePVar(suspect, "IsFrozen");
- PhoneOnline[suspect] = 1;
- PlayerInfo[suspect][pArrested] += 1;
- SetPlayerFree(suspect,playerid, "was arrested");
- PlayerInfo[suspect][pWantedLevel] = 0;
- SetPlayerToTeamColor(suspect);
- SetPlayerWantedLevel(suspect, 0);
- WantLawyer[suspect] = 1;
- TogglePlayerControllable(suspect, 1);
- ClearAnimations(suspect);
- PlayerCuffed[suspect] = 0;
- DeletePVar(suspect, "PlayerCuffed");
- PlayerCuffedTime[suspect] = 0;
- PlayerInfo[suspect][pVW] = 0;
- SetPlayerVirtualWorld(suspect, 0);
- strcpy(PlayerInfo[suspect][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
- strcpy(PlayerInfo[suspect][pPrisonReason], "[IC] EBCF Arrest", 128);
- SetPlayerToTeamColor(suspect);
- Player_StreamPrep(suspect, DocPrison[rand][0], DocPrison[rand][1], DocPrison[rand][2], FREEZE_TIME);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment