Arrest checkpoint
#1

I am trying to make a checkpoint for criminals to be taken to and arrested.

So, I want it so that when a cop and a player who is wanted are in the same car, and the cop goes into the arrest checkpoint it displays something like "Police officer (name) has detained criminal (name)"


But if a player walks into the checkpoint by themself (on foot, or in car) it would say "Player (name) has surrendered and has been sent to jail"

This is what i have.... I need help changing it.


pawn Код:
if (gCheckpoint[40] == checkpointid) {
  new giveplayerid;
  if(EscapedConvict[giveplayerid] == 1 && GetPlayerWantedLevel(giveplayerid) >=10) {
    SetPlayerInterior(giveplayerid,10);
    new rnd;
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(giveplayerid, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(giveplayerid, AlcatrazArrestedSpawn[rnd][3]);
    format(szstring, sizeof(szstring), "Escaped Convict %s(%d) has been re-arrested and sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You have been sent to Alcatraz by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have sent escaped prisoner %s(%d) to Alcatraz - you receive a $4000 re-capture bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Escaped Convict %s(%d) has been re-arrested and sent to Alcatraz by Officer %s(%d)",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,4000);
    Jailed[giveplayerid] =1;
    InAlcatraz[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =320;
    JailTimeServed[giveplayerid] =0;
    EscapedConvict[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) >=4 && GetPlayerWantedLevel(giveplayerid) <=5) {
    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(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You were Arrested by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from jail or a Police Officer/Jail Turnkey can release you early");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If jail life sucks for you... Why not try /escapejail");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have arrested %s(%d) - you receive a $1500 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d)",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,1500);
    Jailed[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =80;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) >=6 && GetPlayerWantedLevel(giveplayerid) <=8) {
    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(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You were Arrested by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from jail or a Police Officer/Jail Turnkey can release you early");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If jail life sucks for you... Why not try /escapejail");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have arrested %s(%d) - you receive a $2000 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    format(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d)",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,2000);
    Jailed[giveplayerid] =1;

    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =140;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }

  if(GetPlayerWantedLevel(giveplayerid) == 9) {
    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(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You were Arrested by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from jail or a Police Officer/Jail Turnkey can release you early");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If jail life sucks for you... Why not try /escapejail");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have arrested %s(%d) - you receive a $2500 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Wanted suspect %s(%d) has been arrested by Officer %s(%d)",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,2500);
    Jailed[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =200;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) >=10 && GetPlayerWantedLevel(giveplayerid) <=14) {
    SetPlayerInterior(giveplayerid,10);
    new rnd;
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(giveplayerid, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(giveplayerid, AlcatrazArrestedSpawn[rnd][3]);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You have been sent to Alcatraz by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have sent Most Wanted suspect %s(%d) to Alcatraz - you receive a $3000 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been arrested and sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,3000);
    Jailed[giveplayerid] =1;
    InAlcatraz[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =280;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) >=15 && GetPlayerWantedLevel(giveplayerid) <=24) {
    SetPlayerInterior(giveplayerid,10);
    new rnd;
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(giveplayerid, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(giveplayerid, AlcatrazArrestedSpawn[rnd][3]);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You have been sent to Alcatraz by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have sent Most Wanted suspect %s(%d) to Alcatraz - you receive a $3500 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been arrested and sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,3500);
    Jailed[giveplayerid] =1;
    InAlcatraz[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =320;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +1);
    return 1;
  }
  if(GetPlayerWantedLevel(giveplayerid) >=25) {
    SetPlayerInterior(giveplayerid,10);
    new rnd;
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(giveplayerid, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(giveplayerid, AlcatrazArrestedSpawn[rnd][3]);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(szstring, sizeof(szstring), "You have been sent to Alcatraz by Officer %s(%d)",oname,playerid);
    SendClientMessage(giveplayerid,0x00C7FFAA, szstring);
    SendClientMessage(giveplayerid,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(giveplayerid,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(szstring, sizeof(szstring), "You have sent Most Wanted suspect %s(%d) to Alcatraz - you receive a $4000 bonus",pname,giveplayerid);
    SendClientMessage(playerid,0x00C7FFAA, szstring);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(szstring, sizeof(szstring), "Most Wanted suspect %s(%d) has been arrested and sent to Alcatraz by Officer %s(%d) ",pname,giveplayerid,oname,playerid);
    printf("%s", szstring);
    SendClientMessage(giveplayerid,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,4000);
    Jailed[giveplayerid] =1;
    InAlcatraz[giveplayerid] =1;
    StoleCopCarRecent[giveplayerid] =0;
    triedtoescaperecent[giveplayerid] =1;
    ResetPlayerWeapons(giveplayerid);
    JailTime[giveplayerid] =420;
    JailTimeServed[giveplayerid] =0;
    SetPlayerWantedLevel(giveplayerid,0);
    oscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, oscore +2);
    }
  }
Reply
#2

You cut check if there is anybody near the criminal with IsPlayerInRangeOfPoint and if so check if they are cops.
Reply
#3

Quote:
Originally Posted by Naxix
You cut check if there is anybody near the criminal with IsPlayerInRangeOfPoint and if so check if they are cops.
But it's a checkpoint, so can't i just check if they enter the checkpoint..
Reply
#4

Quote:
Originally Posted by MWF2
Quote:
Originally Posted by Naxix
You cut check if there is anybody near the criminal with IsPlayerInRangeOfPoint and if so check if they are cops.
But it's a checkpoint, so can't i just check if they enter the checkpoint..
Listen, checkpoints doesn't work like pickups. Checkpoints doesn't do jackshit but say "beep" when you enter them. However, you can detect if the player is within a range when he enters the checkpoint, and that way, find out what checkpoint he entered.

Make sense?
Reply
#5

giveplayerid? looks like that will allways = 0

should be playerid im thinking?

or new giveplayerid = something; atleast
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)