pawn Код:
dcmd_ar(playerid,params[])
{
new string[128];
new ID;
if(sscanf(params, "u", ID))
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}USAGE: /ar (Player Name/ID)");
return 1;
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF} You Are Kidnapped. You Cannot Use this Command!");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
return 1;
}
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_SWAT)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}Only law enforcement can arrest wanted suspects.");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"{FF0000}[ERROR]: {FFFFFF}The player ID (%d) is not connected to the server. You cannot arrest them.",ID);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) > 4)
{
format(string,sizeof(string),"{FF0000}[ERROR]: {FFFFFF}%s(%d) is too far away. You cannot reach him to arrest him.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You cannot arrest a suspect while in a vehicle. Exit the vehicle first.");
return 1;
}
if(GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
return 1;
}
if(InAdminMode[ID] == 1)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You cannot use this command on this player because they are in Administrator mode.");
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You cannot arrest yourself, why would you do that anyway?");
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"{FF0000}[ERROR]: {FFFFFF}%s(%d) is not spawned. You arrest dead people ..",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
if(IsFrozen[ID] == 1)
{
format(string,sizeof(string),"{FF0000}[ERROR]: {FFFFFF}%s(%d) is frozen by a Server Administrator. You cannot arrest them.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
if(GetPlayerWantedLevel(ID) < 4)
{
format(string,sizeof(string),"{FF0000}[ERROR]: {FFFFFF}%s(%d)'s wanted level is too low. You cannot jail them. Use /tk (Player ID).",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) <= 4)
{
SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Arrested_]]");
format(string,sizeof(string),"You have been sent to San Fierro Prison by Law Enforcement Officer %s(%d)",PlayerName(playerid),playerid);
SendClientMessage(ID,COLOR_LIGHTBLUE,string);
//Give the Police Officer Reward
IncreasePlayerScore(playerid,2);
//Show the jail TextDraw for suspect
TextDrawShowForPlayer(ID,JailTimer[ID]);
//Others
ResetPlayerWeapons(ID);
//Send the suspect to jail
if(GetPlayerWantedLevel(ID) >= 4 && GetPlayerWantedLevel(ID) <= 10)
{
format(string,sizeof(string),"{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,string);
format(string,sizeof(string),"7{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
//Give the police officer reward
format(string,sizeof(string),"{00FFFF}You have recieved $5000 for sending the low wanted suspect {FFFFFF}%s(%d) {00FFFF}to prison.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
GivePlayerMoney(playerid,5000);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =60;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =60;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
StopLoopingAnim(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}
if(GetPlayerWantedLevel(ID) >= 11 && GetPlayerWantedLevel(ID) <= 19)
{
format(string,sizeof(string),"{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,string);
format(string,sizeof(string),"7{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
//Give the police officer reward
format(string,sizeof(string),"{00FFFF}You have recieved $10000 for sending the wanted suspect {FFFFFF}%s(%d) {00FFFF}to prison.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
GivePlayerMoney(playerid,10000);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =120;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =120;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
StopLoopingAnim(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}
if(GetPlayerWantedLevel(ID) >= 20 && GetPlayerWantedLevel(ID) <= 29)
{
format(string,sizeof(string),"{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,string);
format(string,sizeof(string),"7{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
//Give the police officer reward
format(string,sizeof(string),"{00FFFF}You have recieved $15000 for sending the wanted suspect {FFFFFF}%s(%d) {00FFFF}to prison.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
GivePlayerMoney(playerid,15000);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =150;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =150;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
StopLoopingAnim(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}
if(GetPlayerWantedLevel(ID) >= 30 && GetPlayerWantedLevel(ID) <= 39)
{
format(string,sizeof(string),"{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ORANGE,string);
format(string,sizeof(string),"7{00FFFF}Suspect %s(%d) Has been rrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
//Give the police officer reward
format(string,sizeof(string),"{00FFFF}You have recieved $20000 for sending the most wanted suspect {FFFFFF}%s(%d) {00FFFF}to prison.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
GivePlayerMoney(playerid,20000);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =180;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =180;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
StopLoopingAnim(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}
if(GetPlayerWantedLevel(ID) >= 40)
{
format(string,sizeof(string),"{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,string);
format(string,sizeof(string),"7{00FFFF}Suspect %s(%d) Has been Arrested by {FFFFFF}Law Enforcement Officer {00FFFF}%s(%d)!",PlayerName(ID),ID,PlayerName(playerid),playerid);
//Give the police officer reward
format(string,sizeof(string),"{00FFFF}You have recieved $25000 for sending the maniac {FFFFFF}%s(%d) {00FFFF}to prison.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_WHITE,string);
GivePlayerMoney(playerid,25000);
new rnd = random(sizeof(JailSpawnPoints));
JailTime[ID] =200;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =200;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
StopLoopingAnim(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
return 1;
}
return 1;
}
return 1;
}