SA-MP Forums Archive
Cops arrest system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cops arrest system (/showthread.php?tid=329139)



Cops arrest system - jimis - 27.03.2012

Where or How i can found or make a police and arrest suspects system?


Thanks for reading


Re: Cops arrest system - TheLazySloth - 27.03.2012

Pretty sure if you use the Search bar, you'll find one, their all over the filterscripts section.


Re: Cops arrest system - jimis - 27.03.2012

ok i will try thanks for posting


Re: Cops arrest system - jimis - 27.03.2012

But i cant find :/
Exactly i want a system which a cop can arrest a suspect if he is near to him..


Re: Cops arrest system - Harish - 27.03.2012

In my Script i used a team cop and team civilian, and in command /ar [playerid]
it will check near player of range 5.o by using IsPlayerInRangeofPoint(givenplayerid,range,copx,co py,copz); and set playerpos to jail and some timer to unjail the player


Re: Cops arrest system - jimis - 27.03.2012

Harish,could you give all the parts of your cop system ?Because i need it...


Re: Cops arrest system - Harish - 27.03.2012

okay., but i will give it to you tomorrow because i want to write it . i'm not in my to home to copy paste.


Re: Cops arrest system - jimis - 27.03.2012

Ok thanks, no problem i will wait, if you dont find this thread tommorow then send me a pm


Re: Cops arrest system - Harish - 28.03.2012

#define Team_Cop 1
new gTeam[MAX_PLAYERS];
new releasetime[MAX_PLAYERS];
forward JailRelease(playerid);

onplayerrequestclass(playerid,classid)
{
SetPlayerTeamFromClass(playerid, classid);
}
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_Civilian;
}
else
{
gTeam[playerid] = TEAM_Cop;
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/ar", true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ar [playerid]");
new arrestplayer;
arrestplayer = strval(tmp);
if(gTeam[playerid] !=TEAM_Cop){SendClientMessage(playerid,COLOR_WHITE ,"Server:UnknownCommand');
}else
{
new coppos[3];
GetPlayerPos(playerid,coppos[0],coppos[1],coppos[2]);
if(IsPlayerInRangeOfPoint(arrestplayer,5.0,coppos[0],coppos[1],coppos[2])
{
SetPlayerInterior(arrestplayer,yourinterior); SetPlayerPos(arrestplayer,yourjailx,y,z);
releasetime[arrestplayer] = SetTimerEx("JailRelease",400000,0,"i",arrestplayer );
}
}
return 1;
}
return 0;
}
public JailRelease(playerid)
{
SetPlayerInterior(playerid,outinterior);
SetPlayerPos(playerid,outx,y,z);
GameTextForPlayer(playerid,"Be a Good Citizen",3000,1);
}


Re: Cops arrest system - Harish - 28.03.2012

If this helps you please give me reputations on left side.thank you