Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmdtext, "/ar", true) == 0)
- {
- if(gTeam[playerid] != TEAM_COPS && gTeam[playerid] != TEAM_SWAT)
- {
- SendClientMessage(playerid,COLOR_RED,"You are not a Law Enforcement officer ");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- giveplayerid = strval(tmp);
- if(!IsNumeric(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /ar (id) ID Must be a number");
- return 1;
- }
- if(!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- return 1;
- }
- new oname[24];
- new cname[24];
- GetPlayerName(playerid,oname, 24);
- GetPlayerName(giveplayerid, cname, 24);
- if(GetPlayerWantedLevel(giveplayerid) <= 3)
- {
- format(string, sizeof(string), "%s(%d) does not have a warrant. You cannot arrest a player without a warrant",cname,giveplayerid);
- SendClientMessage(playerid,COLOR_RED,string);
- return 1;
- }
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid,COLOR_RED,"You cannot arrest a suspect if you are in a car");
- return 1;
- }
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- format(string, sizeof(string), "%s(%d) Is in a vehicle. Get the suspect out before making the arrest",cname,giveplayerid);
- SendClientMessage(playerid,COLOR_RED,string);
- return 1;
- }
- if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 4)
- {
- format(string, sizeof(string), "%s(%d) Is too far away. You cannot arrest that player",cname,giveplayerid);
- SendClientMessage(playerid,COLOR_RED,string);
- return 1;
- }
- if(giveplayerid == playerid)
- {
- SendClientMessage(playerid,COLOR_RED,"You cannot arrest yourself");
- return 1;
- }
- if(GetPlayerWantedLevel(giveplayerid) >=4)
- {
- SetPlayerInterior(giveplayerid,3);
- new rnd;
- rnd = random(sizeof (ArrestedSpawn));
- SetPlayerPos(giveplayerid, ArrestedSpawn[rnd][0], ArrestedSpawn[rnd][1], ArrestedSpawn[rnd][2]);
- SetPlayerFacingAngle(giveplayerid, ArrestedSpawn[rnd][3]);
- format(string, sizeof(string), "Officer %s(%d) has arrested %s(%d) and has sent the suspect to Jail",oname,playerid,cname,giveplayerid);
- SendClientMessageToAll(0x00C7FFAA, string);
- SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Busted_|");
- format(string, sizeof(string), "You have been sent to jail by Officer %s(%d)",oname,playerid);
- SendClientMessage(giveplayerid,0x00C7FFAA, string);
- SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from jail once you have served your sentence");
- SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
- format(string, sizeof(string), "You have sent %s(%d) to jail - you receive a $5000 arrest bonus",cname,giveplayerid);
- SendClientMessage(playerid,0x00C7FFAA, string);
- GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
- format(string, sizeof(string), "%s(%d) has been arrested and sent to jail by Officer %s(%d)",cname,giveplayerid,oname,playerid);
- printf("%s", string);
- GivePlayerMoney(playerid,5000);
- Jailed[giveplayerid] =1;
- ResetPlayerWeapons(giveplayerid);
- JailTime[giveplayerid] =320;
- JailTimeServed[giveplayerid] =0;
- SetPlayerWantedLevel(giveplayerid,0);
- new oscore;
- oscore = GetPlayerScore(playerid);
- SetPlayerScore(playerid, oscore +1);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement