05.04.2014, 14:31
i need some help, when you get jail, you will be not in the jail, but in the sky [jail bug] help please
pawn Код:
new Float:LSPDJail[4][3] = {
{227.5998,109.4855,999.0156},
{224.1798,110.0768,999.0156},
{219.0644,110.1949,999.0156},
{214.8077,110.2932,999.0156}
};
pawn Код:
CMD:arrest(playerid, params[])
{
if(IsACop(playerid) || IsALVMPDCop(playerid) || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || PlayerInfo[playerid][pMember] == 20)
{
if(!IsAtArrestPoint(playerid))
{// Jail spot
SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the arrest point.");
return 1;
}
new string[128], moneys, time, bail, bailprice;
if(sscanf(params, "dddd", moneys, time, bail, bailprice)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
if(moneys < 1 || moneys > 50000000) { SendClientMessageEx(playerid, COLOR_GREY, "The jail price can't be below $1 or above $50,000,000."); return 1; }
if(time < 1 || time > 60) { SendClientMessageEx(playerid, COLOR_GREY, "Jail time can't be below 1 or above 60 minutes - take the person to prison for more time."); return 1; }
if(bail < 0 || bail > 1) { SendClientMessageEx(playerid, COLOR_GREY, "The bail option must be set to 0 or 1."); return 1; }
if(bailprice < 0 || bailprice > 25000000) { SendClientMessageEx(playerid, COLOR_GREY, "The bail price can't be below $0 or above $25,000,000."); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(ProxDetectorS(5.0, playerid,suspect))
{
if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12)
{
SendClientMessageEx(playerid, COLOR_GREY, "The player must have a wanted level of at least one star.");
return 1;
}
format(string, sizeof(string), "* You arrested %s!", GetPlayerNameEx(suspect));
PlayerInfo[playerid][pArrestsMade]++;
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
GivePlayerCash(suspect, -moneys);
Tax += moneys;
ResetPlayerWeaponsEx(suspect);
if(PlayerVehicleInfo[suspect][0][pvTicket] != 0)
{
PlayerVehicleInfo[suspect][0][pvTicket] = 0;
}
if(PlayerVehicleInfo[suspect][1][pvTicket] != 0)
{
PlayerVehicleInfo[suspect][1][pvTicket] = 0;
}
if(PlayerVehicleInfo[suspect][2][pvTicket] != 0)
{
PlayerVehicleInfo[suspect][2][pvTicket] = 0;
}
if(PlayerVehicleInfo[suspect][3][pvTicket] != 0)
{
PlayerVehicleInfo[suspect][3][pvTicket] = 0;
}
if(PlayerVehicleInfo[suspect][4][pvTicket] != 0)
{
PlayerVehicleInfo[suspect][4][pvTicket] = 0;
}
//TogglePlayerControllable(suspect, 1);
if(IsPlayerInRangeOfPoint(playerid, 4.0, 2273.53, -79.64, 26.05) || IsPlayerInRangeOfPoint(playerid, 3.0,1528.4888,-1677.7632,5.8906) || IsPlayerInRangeOfPoint(playerid, 3.0, 1820.199,432.948,19.290) || IsPlayerInRangeOfPoint(playerid,4.0,1733.8361,-2056.5571,13.5785) || IsPlayerInRangeOfPoint(playerid,4.0,680.2208,-1546.9856,14.8516) || IsPlayerInRangeOfPoint(playerid,4.0,1407.27, 419.85, 19.59) || IsPlayerInRangeOfPoint(playerid,4.0,-1606.275,673.763,-5.242) || PlayerInfo[playerid][pVW] == 133337)
{
//format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", GetPlayerNameEx(playerid), GetPlayerNameEx(suspect));
//OOCNews(COLOR_LIGHTRED, string);
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
new rand = random(sizeof(LSPDJail));
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerFacingAngle(suspect, 0);
SetPlayerPos(suspect, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
//SetPlayerPos(suspect, 227.5998,109.4855,999.0156);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
//SetPlayerPos(suspect, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 1;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
SetPlayerVirtualWorld(suspect, 0);
}
else if(PlayerInfo[playerid][pMember] == 11) {
TogglePlayerControllable(suspect, 0);
GameTextForPlayer(suspect, "Objects loading...", 4000, 5);
SetPVarInt(suspect, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", suspect);
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
SetPlayerVirtualWorld(suspect, 0);
PlayerInfo[suspect][pVW] = 0;
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
PlayerInfo[suspect][pJailed] = 2;
PhoneOnline[suspect] = 1;
DeletePVar(suspect, "IsFrozen");
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
new rand = random(sizeof(ICPrisonSpawns));
Streamer_UpdateEx(suspect, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
SetPlayerPos(suspect, ICPrisonSpawns[rand][0], ICPrisonSpawns[rand][1], ICPrisonSpawns[rand][2]);
ResetPlayerWeaponsEx(suspect);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
//format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
//OOCNews(COLOR_LIGHTRED, string);
TogglePlayerControllable(suspect, 0);
GameTextForPlayer(suspect, "Objects loading...", 4000, 5);
SetPVarInt(suspect, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", suspect);
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pVW] = 0;
PlayerInfo[suspect][pInt] = 1;
SetPlayerVirtualWorld(suspect, 0);
SetPlayerPos(suspect,315.1677,-1451.5564,-33.5292);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
PlayerInfo[suspect][pJailed] = 3;
PhoneOnline[suspect] = 1;
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
//format(string, sizeof(string), "<< Prison Officer %s arrested suspect %s >>", sendername, giveplayer);
//OOCNews(COLOR_LIGHTRED, string);
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, 198.1944,175.9581,1003.0234);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 8;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
SetPlayerVirtualWorld(suspect, 0);
}
else if(PlayerInfo[playerid][pMember]==7||PlayerInfo[playerid][pLeader]==7)
{
//format(string, sizeof(string), "<< Deputy %s arrested suspect %s >>", sendername, giveplayer);
//OOCNews(COLOR_LIGHTRED, string); //LASD
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, 2500.3296,-1679.2875,562.7988);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 7;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
SetPlayerVirtualWorld(suspect, 0);
}
else if(PlayerInfo[playerid][pMember]==12||PlayerInfo[playerid][pLeader]==12)
{
TogglePlayerControllable(suspect, 0);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 9;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
SetPlayerInterior(suspect, 0);
PlayerInfo[suspect][pInt] = 10;
PlayerInfo[suspect][pVW] = 10;
SetPlayerVirtualWorld(suspect, 10);
SetPlayerPos(suspect, 319.554931, 312.155181, 999.148437);
}
else if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
new rand = random(sizeof(LSPDJail));
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]);
//SetPlayerPos(suspect, 214.8077,110.2932,999.0156);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 1;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerVirtualWorld(suspect, 0);
}
else if(PlayerInfo[playerid][pMember]==18||PlayerInfo[playerid][pLeader]==18)
{
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, 319.17, 312.13, 999.14);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 1;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerVirtualWorld(suspect, 0);
SetPlayerInterior(suspect, 1);
}
else if(PlayerInfo[playerid][pMember]==19||PlayerInfo[playerid][pLeader]==19)
{
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, 227.5998,109.4855,999.0156);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
DeletePVar(suspect, "IsFrozen");
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 1;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
DeletePVar(suspect, "PlayerCuffed");
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerVirtualWorld(suspect, 0);
SetPlayerInterior(suspect, 3);
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0,611.96, -587.25, 17.22))
{
//format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
//OOCNews(COLOR_LIGHTRED, string);
SetPlayerInterior(suspect, 1);
PlayerInfo[suspect][pInt] = 1;
Player_StreamPrep(suspect, 1856.9955,-1657.1003,5215.6299, 4000);
SetPlayerPos(suspect, 319.17, 312.13, 999.14);
RemovePlayerAttachedObject(suspect,0);
ClearAnimations(suspect);
SetPlayerSpecialAction(suspect, SPECIAL_ACTION_NONE);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
SetPVarInt(suspect, "IsFrozen", 0);
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 5;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
SetPVarInt(suspect, "PlayerCuffed", 0);
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerVirtualWorld(suspect, 0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0,2334.65, 566.84, 7.78) || IsPlayerInRangeOfPoint(playerid, 3.0,2182.20, 530.32, 1.19))
{
//format(string, sizeof(string), "<< Coast Guardsman %s arrested suspect %s >>", sendername, giveplayer);
//OOCNews(COLOR_LIGHTRED, string);
SetPlayerInterior(suspect, 0);
SetPlayerPos(suspect,319.17, 312.13, 999.14);
if(PlayerInfo[suspect][pDonateRank] >= 2)
{
PlayerInfo[suspect][pJailTime] = ((time*60)*75)/100;
}
else
{
PlayerInfo[suspect][pJailTime] = time * 60;
}
SetPVarInt(suspect, "IsFrozen", 0);
//Frozen[suspect] = 0;
PlayerInfo[suspect][pJailed] = 5;
PhoneOnline[suspect] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "was arrested");
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWantedLevel] = 0;
SetPlayerToTeamColor(suspect);
SetPlayerWantedLevel(suspect, 0);
WantLawyer[suspect] = 1;
TogglePlayerControllable(suspect, 1);
ClearAnimations(suspect);
PlayerCuffed[suspect] = 0;
SetPVarInt(suspect, "PlayerCuffed", 0);
PlayerCuffedTime[suspect] = 0;
PlayerInfo[suspect][pVW] = 0;
SetPlayerVirtualWorld(suspect, 0);
}
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessageEx(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessageEx(suspect, COLOR_LIGHTBLUE, string);
}
}//distance
}//not connected
else
{
SendClientMessageEx(playerid, COLOR_GREY, " No-one close enough to arrest.");
return 1;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not a Cop / FBI / Coastguard!");
return 1;
}
return 1;
}