Posts: 278
Threads: 100
Joined: May 2011
Reputation:
0
Where or How i can found or make a police and arrest suspects system?
Thanks for reading
Posts: 398
Threads: 19
Joined: Aug 2011
Reputation:
0
Pretty sure if you use the Search bar, you'll find one, their all over the filterscripts section.
Posts: 278
Threads: 100
Joined: May 2011
Reputation:
0
But i cant find :/
Exactly i want a system which a cop can arrest a suspect if he is near to him..
Posts: 102
Threads: 6
Joined: Mar 2012
Reputation:
0
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
Posts: 278
Threads: 100
Joined: May 2011
Reputation:
0
Harish,could you give all the parts of your cop system ?Because i need it...
Posts: 102
Threads: 6
Joined: Mar 2012
Reputation:
0
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.
Posts: 102
Threads: 6
Joined: Mar 2012
Reputation:
0
#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);
}
Posts: 102
Threads: 6
Joined: Mar 2012
Reputation:
0
If this helps you please give me reputations on left side.thank you