pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMembro] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб trabalhando !");
return 1;
}
if((PlayerInfo[playerid][pMembro] == 1 && !PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391)) || (PlayerInfo[playerid][pMembro] == 3 && !PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391)) || (PlayerInfo[playerid][pMembro] == 2 && !PlayerToPoint(6.0, playerid, 197.8769,179.0946,1003.0297)))
{// Jail spot
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб prуximo a cela de sua corporaзгo !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /deter [preзo da prisгo] [tempo (minutos)] [direito a fianзa (0=nгo 1=sim)] [preзo fianзa]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 10) { SendClientMessage(playerid, COLOR_GREY, " O preзo da prisгo entre R$1 e R$10 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /deter [preзo da prisгo] [tempo (minutos)] [direito a fianзa (0=nгo 1=sim)] [preзo fianзa]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " Os minutos mбximo sгo de 1 a 20 (traga o suspeito antes atй a cadeia primeiro) !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /deter [preзo da prisгo] [tempo (minutos)] [direito a fianзa (0=nгo 1=sim)] [preзo fianзa]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Direito a Fianзa 0 = NГO 1 = SIM !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /deter [preзo da prisгo] [tempo (minutos)] [direito a fianзa (0=nгo 1=sim)] [Preзo de Fianзa]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 999999) { SendClientMessage(playerid, COLOR_GREY, " O preзo da fianзa tende somente a ser entre R$1 e R$999999 !"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " O jogador precisa ter ao mнnimo nнvel de Procurado 1 !");
return 1;
}
format(string, sizeof(string), "* Vocк deteve %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoneyEx(suspect, -moneys);
format(string, sizeof(string), "~w~detido por ~g~%s ~w~~n~ por ~r~R$ %d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1)
{
format(string, sizeof(string), "<< O Oficial %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMembro]==2||PlayerInfo[playerid][pLider]==2)
{
format(string, sizeof(string), "<< O agente Federal %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMembro]==3||PlayerInfo[playerid][pLider]==3)
{
format(string, sizeof(string), "<< O militar %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMembro]==14||PlayerInfo[playerid][pLider]==14)
{
format(string, sizeof(string), "<< O Cherife %s prendeu o suspeito %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 6);
if(PlayerInfo[playerid][pMembro] == 1)
{
PlayerInfo[suspect][pJailTime] = time * 60;
lol= --diminuir[playerid];
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time-lol;
}
if(PlayerInfo[playerid][pMembro] == 2)
{
PlayerInfo[suspect][pJailTime] = time * 60;
lol= --diminuir[playerid];
SetPlayerInterior(suspect, 3);
SetPlayerPos(suspect,198.0481,175.3411,1003.0234);
PlayerInfo[suspect][pJailTime] = time-lol;
}
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Vocк foi preso com %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 com %d segundos. << Fianзa: Desativada >>", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
if(PlayerInfo[playerid][pMembro] == 1) { PlayerInfo[suspect][pJailed] = 1; }
if(PlayerInfo[playerid][pMembro] == 2) { PlayerInfo[suspect][pJailed] = 3; }
PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Xadrez");
WantedLevel[suspect] = 0;
WantedLevel[suspect] = 0;
WantedLevel[suspect] = 1;
}//distance
}//not connected
else
{
SendClientMessage(playerid, COLOR_GREY, " Ninguйm com este ID para ser detido");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um PM / PF / Forзas Armadas !");
return 1;
}
}//not connected
return 1;
}