Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMembro] == 1 && PlayerInfo[playerid][pMembro] == 17 && PlayerInfo[playerid][pMembro] == 2)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб de plantгo!");
return 1;
}
if(!PlayerToPoint(6.0, playerid, 1754.7578,-1594.7642,13.5365) && !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, 1314.2915,-853.9916,39.5781) && !PlayerToPoint(6.0, playerid, 1545.7220,-1609.4769,13.3828) && !PlayerToPoint(6.0, playerid, 2794.3201,-1618.9304,10.9219))
{// 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 [preзo] [tempo (minutos)] [fianca (0=nao 1=sim)] [preco da fianca]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, " O Preзo nгo pode ser menor que R$1 ou maior que R$99999 !"); 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 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(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 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(suspect, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ por R$%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
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(suspect, 6);
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Voce foi preso por %d Segundos. Bail: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Voce foi preso por %d Segundos. Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 1;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 2 || PlayerInfo[playerid][pLider] == 2)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 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(suspect, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMembro]==2||PlayerInfo[playerid][pLider]==2)
{
format(string, sizeof(string), "<< ROTAM %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 10);
SetPlayerPos(suspect,223.5335,110.3779,999.0156);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Sem", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 3;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 22 || PlayerInfo[playerid][pLider] == 22)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 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(suspect, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMembro]==25||PlayerInfo[playerid][pLider]==25)
{
format(string, sizeof(string), "<< Policia Rodoviбria %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 0);
SetPlayerPos(suspect,1019.2576,-310.5826,73.9931);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Fianзa: Sem", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 5;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantAdvogado[suspect] = 1;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
return 1;
}
if(PlayerInfo[playerid][pMembro] == 17 || PlayerInfo[playerid][pLider] == 17)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 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(suspect, -moneys);
format(string, sizeof(string), "Preso por %s ~n~ fou R$%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
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(suspect, 3);
SetPlayerPos(suspect,198.1076,175.0731,1003.0234);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Bail: R$%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
JailPrice[suspect] = 0;
format(string, sizeof(string), "Vocк foi preso por %d Segundos. Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 4;
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
WantAdvogado[suspect] = 1;
return 1;
}
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " Nгo й o suficiente para fechar a prisao.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й PM/PC/B.O.P.E/Exercito !");
return 1;
}
}//not connected
return 1;
}