19.04.2013, 18:16
Here,
pawn Код:
dcmd_arrest(playerid,params[]) //This is the not the full code. There is more commands (if etc. ..) but it is not necessary right now.
{
new string[128];
new ID;
if(GetDistanceBetweenPlayers(playerid,ID) <= 4)
{
IncreasePlayerScore(playerid,2);
TextDrawShowForPlayer(ID,WantedTimer[ID]);
ResetPlayerWeapons(ID);
if(GetPlayerWantedLevel(ID) >= 6)
{
new wanted;
wanted = GetPlayerWantedLevel(ID) * 200;
new wantedtime;
wantedtime = GetPlayerWantedLevel(ID) * 10;
GivePlayerMoney(playerid,wanted);
format(string,sizeof(string),""COL_POLICE"[POLICE] "COL_WHITE"%s(%d) has sent the suspect %s to the jail for: %d.",PlayerName(playerid),playerid,PlayerName(ID),wantedtime);
SendClientMessageToAll(COLOR_ORANGE,string);
format(string,sizeof(string),"7[POLICE] %s(%d) has sent the suspect %s to the jail for: %d.",PlayerName(playerid),playerid,PlayerName(ID),wantedtime);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),""COL_GREEN"[POLICE] "COL_WHITE"You have recieved "COL_YELLOW"$%d "COL_WHITE"for sending the suspect "COL_YELLOW"%s "COL_WHITE"to the jail.",wanted,PlayerName(ID));
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x,y,z);
for(new i=0; i<MAX_PLAYERS; i++)
{
for(new d=0; d<MAX_PLAYER_ATTACHED_OBJECTS; d++)
{
if(IsPlayerAttachedObjectSlotUsed(i, d)) RemovePlayerAttachedObject(i, d);
SetPlayerSpecialAction(i, SPECIAL_ACTION_NONE);
}
}
new rnd = random(sizeof(JailSpawnPoints));
TotalWantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10;
IsTazed[ID] =0;
TazeTime[ID] =0;
IsCuffed[ID] =0;
CuffTime[ID] =0;
SetPlayerInterior(ID,10);
SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
TogglePlayerControllable(ID,1);
ClearAnimations(ID);
SetPlayerWantedLevel(ID,0);
SetPlayerToTeamColour(ID);
SetPlayerHealth(ID,999999);
return 1;
}
return 1;
}
return 1;
}