Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] == 0)
{
SendClientMessage(playerid,COLOR_LIGHTRED,"Vocк nгo bateu cartгo");
return 1;
}
if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) && !PlayerToPoint(6.0, playerid, 1545.4073,-1607.9791,13.3828) && !PlayerToPoint(6.0, playerid, 324.3141,-1496.9177,24.9219) && !PlayerToPoint(6.0, playerid, 1407.9673,420.0705,19.7823) && !PlayerToPoint(6.0, playerid, 221.1459,115.3492,999.0156) && !PlayerToPoint(6.0, playerid, 919.4354,-1198.5142,16.9832) && !PlayerToPoint(6.0, playerid, 1545.7220,-1609.4769,13.3828) && !PlayerToPoint(6.0, playerid, 1019.6051,-317.6436,73.9922)
&& !PlayerToPoint(6.0, playerid, -1392.2369,2641.2480,55.9728))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб perto da cela, nгo pode prender o suspeito !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [id] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new playa3;
playa3 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " O Tempo nao pode ser menor que 1 nem maior que 20 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Fianca nao pode ser menor que 0 nem maior que 1 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, " O Preзo nгo pode ser menor que %0 nem maior que R$3000000 !"); return 1; }
// new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(playa3))
{
if(GetDistanceBetweenPlayers(playerid,playa3) < 5)
{
GetPlayerName(playa3, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[playa3] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no mнnimo 1 nivel de procurado!");
return 1;
}
format(string, sizeof(string), "* Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoneyEx(playa3, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ por R$%d", sendername, time);
GameTextForPlayer(playa3, string, 5000, 5);
ResetPlayerWeapons(playa3);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< Policia Militar %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(playa3, 6);
SetPlayerPos(playa3,264.6288,77.5742,1001.0391);
PlayerInfo[playa3][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[playa3] = bailprice;
format(string, sizeof(string), "Voce foi preso por %d Segundos. Bail: R$%d", PlayerInfo[playa3][pJailTime], JailPrice[playa3]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[playa3] = 0;
format(string, sizeof(string), "Voce foi preso por %d Segundos. Bail: Unable", PlayerInfo[playa3][pJailTime]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
PlayerInfo[playa3][pJailed] = 1;
PlayerInfo[playa3][pArrested] += 1;
SetPlayerFree(playa3,playerid, "Got Arrested");
WantedPoints[playa3] = 0;
WantedLevel[playa3] = 0;
WantAdvogado[playa3] = bail;
TogglePlayerControllable(playa3, 1);
PlayerCuffed[playa3] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2)
{
GetPlayerName(playa3, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[playa3] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nivel de procurado!");
return 1;
}
format(string, sizeof(string), "* Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoneyEx(playa3, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(playa3, string, 5000, 5);
ResetPlayerWeapons(playa3);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< B.O.P.E %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(playa3, 10);
SetPlayerPos(playa3,223.5335,110.3779,999.0156);
PlayerInfo[playa3][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[playa3] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[playa3][pJailTime], JailPrice[playa3]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[playa3] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Sem", PlayerInfo[playa3][pJailTime]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
PlayerInfo[playa3][pJailed] = 3;
PlayerInfo[playa3][pArrested] += 1;
SetPlayerFree(playa3,playerid, "Got Arrested");
WantedPoints[playa3] = 0;
WantedLevel[playa3] = 0;
WantAdvogado[playa3] = 1;
TogglePlayerControllable(playa3, 1);
PlayerCuffed[playa3] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 25 || PlayerInfo[playerid][pLider] == 25)
{
GetPlayerName(playa3, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[playa3] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nivel de procurado!");
return 1;
}
format(string, sizeof(string), "* Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoneyEx(playa3, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(playa3, string, 5000, 5);
ResetPlayerWeapons(playa3);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< O Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(playa3, 10);
SetPlayerPos(playa3,1019.2576,-310.5826,73.9931);
PlayerInfo[playa3][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[playa3] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[playa3][pJailTime], JailPrice[playa3]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[playa3] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Sem", PlayerInfo[playa3][pJailTime]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
PlayerInfo[playa3][pJailed] = 5;
PlayerInfo[playa3][pArrested] += 1;
SetPlayerFree(playa3,playerid, "Got Arrested");
WantedPoints[playa3] = 0;
WantedLevel[playa3] = 0;
WantAdvogado[playa3] = 1;
TogglePlayerControllable(playa3, 1);
PlayerCuffed[playa3] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 17 || PlayerInfo[playerid][pLider] == 17)
{
GetPlayerName(playa3, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[playa3] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador deve ter no minimo 1 nivel de procurado!");
return 1;
}
format(string, sizeof(string), "* Prendeu %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoneyEx(playa3, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(playa3, string, 5000, 5);
ResetPlayerWeapons(playa3);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< Policial Civil %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(playa3, 3);
SetPlayerPos(playa3,198.1076,175.0731,1003.0234);
PlayerInfo[playa3][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[playa3] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. fianзa: R$%d", PlayerInfo[playa3][pJailTime], JailPrice[playa3]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[playa3] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: sem", PlayerInfo[playa3][pJailTime]);
SendClientMessage(playa3, COLOR_LIGHTBLUE, string);
}
PlayerInfo[playa3][pJailed] = 4;
PlayerInfo[playa3][pArrested] += 1;
SetPlayerFree(playa3,playerid, "Got Arrested");
WantedPoints[playa3] = 0;
WantedLevel[playa3] = 0;
TogglePlayerControllable(playa3, 1);
PlayerCuffed[playa3] = 0;
WantAdvogado[playa3] = 1;
return 1;
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " ID Invalido.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й COP !");
return 1;
}
}//not connected
return 1;
}