10.08.2012, 17:58
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
if(PlayerInfo[playerid][pDuty] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** Vocк nгo estб em serviзo!");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 6, 255.4480,85.8236,1002.4453) || IsPlayerInRangeOfPoint(playerid, 6, 1771.2113,-1557.6365,-16.4052))
{//New arrest system SAPD
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[TL] /prender [ID] [horas (minutos)] [fianзa (0=nгo 1=sim)] [preзodafianзa]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 20000) { SendClientMessage(playerid, COLOR_GREY, " Preзo da fianзa $1 ou menor que $20000!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[TL] /prender [ID] [horas (minutos)] [fianзa (0=nгo 1=sim)] [preзodafianзa]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 500000) { SendClientMessage(playerid, COLOR_GREY, " Jail Time Minutes can't be below 1 or above 500000 (Take the person to prison then)!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[TL] /prender [ID] [horas (minutos)] [fianзa (0=nгo 1=sim)] [preзodafianзa]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Jail Bailing can't be below 0 or above 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[TL] /prender [ID] [horas (minutos)] [fianзa (0=nгo 1=sim)] [preзodafianзa]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 2000000) { SendClientMessage(playerid, COLOR_GREY, "** Jail Bailing can't be below $0 or above $2000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Vocк prendeu %s!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "preso por %s ~n~ por $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
new currank[64];
if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officer"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Senior Officer"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "[Police] %s %s prendeu %s", currank ,sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "[Police] Agent %s prendeu %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "[Police] Soldier %s prendeu %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
SafeSetPlayerInterior(suspect, 6);
SafeSetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d segundos. Fianзa: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d segundos. Fianзa: Inafianзavel", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
PlayerInfo[suspect][pWantedLevel] = 0;
PlayerInfo[suspect][pJailed] = 5;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Preso!");
TextDrawShowForPlayer(suspect, Textdraw1[suspect]);
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
PlayerCuffed[suspect] = 0;
GaveUp[suspect] = 0;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s prendeu %s por %s segundos. Fianзa: $%d, Preзo: $%d",d,m,y,h,mi,s,sendername,giveplayer, PlayerInfo[suspect][pJailTime],JailPrice[suspect],moneys);
JailLog(string);
}//distance
}//not connected
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "** Vocк nгo й do FBI!");
return 1;
}
}//not connected
return 1;
}