if(strcmp(cmd, "/prender", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsACop(playerid)) { if(OnDuty[playerid] != 1) { SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!"); return 1; } if(!PlayerToPoint(12.0, playerid, 268.3327,77.8972,1001.0391) && !PlayerToPoint(12.0, playerid, 1545.4073,-1607.9791,13.3828) && !PlayerToPoint(12.0, playerid, 324.3141,-1496.9177,24.9219) && !PlayerToPoint(12.0, playerid, 920.5212,-1184.8267,16.9766) && !PlayerToPoint(12.0, playerid, 221.1459,115.3492,999.0156) && !PlayerToPoint(12.0, playerid, 193.9101,179.2799,1003.0234) && !PlayerToPoint(12.0, playerid, 1545.7220,-1609.4769,13.3828) && !PlayerToPoint(12.0, playerid, 1019.6051,-317.6436,73.9922) && !PlayerToPoint(12.0, playerid, 195.5733,158.4008,1003.0234) && !PlayerToPoint(12.0, playerid, -1298.8188,490.5014,11.1953) && !PlayerToPoint(12.0, playerid, 264.1557,77.5797,1001.0391) && !PlayerToPoint(12.0, playerid, 1361,175.1075,1003.0234) && !PlayerToPoint(12.0, playerid, 321.8284,315.6733,999.1484)) { 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; } giveplayerid = ReturnUser(tmp); 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 time = strval(tmp); if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, " O Tempo nгo pode ser menor que 1 nem maior que 60!"); 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 bail = strval(tmp); if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " Fianзa Tem Que ser 0=Nгo ou 1=Sim!"); 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 bailprice = strval(tmp); if(bailprice < 0 || bailprice > 300000) { SendClientMessage(playerid, COLOR_GREY, " O Preзo nгo pode ser menor que 0 nem maior que R$300000!"); return 1; } new suspect = GetClosestPlayer(playerid); if(IsPlayerConnected(suspect)) { if(GetDistanceBetweenPlayers(playerid,suspect) < 15) { if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1) { GetPlayerName(suspect, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(WantedPoints[suspect] < 1) { SendClientMessage(playerid, COLOR_GREY, " O Player deve ter no mнnimo 1 nнvel de procurado!"); return 1; } format(string, sizeof(string), "* Vocк prendeu %s!", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "Preso por %s", sendername); GameTextForPlayer(suspect, string, 5000, 3); ResetPlayerWeaponsEx(suspect); SetPlayerSkin(suspect,268); if(PlayerInfo[playerid][pMembro]==1||PlayerInfo[playerid][pLider]==1) { format(string, sizeof(string), "<< Policial 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), "O policial acima o prendeu por %ds, sem Fianзa!", PlayerInfo[suspect][pJailTime], JailPrice[suspect]); SendClientMessage(suspect, COLOR_LIGHTBLUE, string); } else { JailPrice[suspect] = 0; format(string, sizeof(string), "O policial acima o prendeu por %ds, sem Fianзa!", PlayerInfo[suspect][pJailTime]); SendClientMessage(suspect, COLOR_LIGHTBLUE, string); } PlayerInfo[suspect][pJailed] = 1; WantedPoints[suspect] = 0; SetPlayerWantedLevel(suspect, 0); WantAdvogado[suspect] = 1; PlayerInfo[suspect][pMuted] = 0; TogglePlayerControllable(suspect, 1); PlayerCuffed[suspect] = 0; PlayerInfo[suspect][pDrogas] = 0; PlayerInfo[suspect][pDrogas2] = 0; PlayerInfo[suspect][pDrogas3] = 0; PlayerInfo[suspect][pMats] = 0; return 1; }
PlayerInfo[suspect][pJailTime] = time * 60;
PlayerInfo[giveplayerid][pJailed] = 1;
WantedPoints[suspect] = 0;
SetPlayerWantedLevel(suspect, 0);
WantAdvogado[suspect] = 1;
PlayerInfo[suspect][pMuted] = 0;
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pDrogas] = 0;
PlayerInfo[suspect][pDrogas2] = 0;
PlayerInfo[suspect][pDrogas3] = 0;
PlayerInfo[suspect][pMats] = 0;
Falta iniciar o timer, lб no login deve ter algum SetTimerEx para "ArrestTime" ou "JailTime", copie e coloque antes do "return 1;"
|
PlayerInfo[i][pJailTime]--;
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { PlayerInfo[i][pSalario] += 10; if(PlayerInfo[i][pVIP] == 1) { PlayerInfo[i][pSalario] += 10; } if(PlayerInfo[i][pVIP] == 2) { PlayerInfo[i][pSalario] += 20; } if(PlayerInfo[i][pJailed] > 0) { if(PlayerInfo[i][pJailTime] > 0 && WantAdvogado[i] == 0) { PlayerInfo[i][pJailTime]--; } if(PlayerInfo[i][pJailTime] <= 0 && WantAdvogado[i] == 0) { PlayerInfo[i][pJailTime] = 0; if(PlayerInfo[i][pJailed] == 1) { SetPlayerInterior(i, 6); SetPlayerPos(i,268.0903,77.6489,1001.0391); } else if(PlayerInfo[i][pJailed] == 3) { SetPlayerInterior(i, 0); SetPlayerPos(i,338.3080,-1523.9946,33.2635); } else if(PlayerInfo[i][pJailed] == 4) { SetPlayerInterior(i, 0); SetPlayerPos(i,-86.0892,-300.3380,2.7646); } else if(PlayerInfo[i][pJailed] == 5) { SetPlayerInterior(i, 0); SetPlayerPos(i,1024.3496,-373.1364,73.3885); } else if(PlayerInfo[i][pJailed] == 6) { SetPlayerInterior(i, 0); SetPlayerPos(i,1541.1633,-1674.6908,13.5520); } else if(PlayerInfo[i][pJailed] == 7) { SetPlayerInterior(i, 0); SetPlayerPos(i,-1529.3772,486.5050,7.1797); } else if(PlayerInfo[i][pJailed] == 2) { SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000); SetPlayerInterior(i, 0); SetPlayerPos(i, 90.2101,1920.4854,17.9422); } PlayerInfo[i][pJailed] = 0; GameTextForPlayer(i, "~g~Livre~n~~w~Nao cometa mais crimes", 5000, 3); SetPlayerSkin(i,PlayerInfo[i][pSkin]); if(gTeam[i] == 4) { gTeam[i] = 3; } ClearCrime(i); SetPlayerToTeamColor(i); } }
new unjailtimer;
forward SetPlayerUnjail();
public SetPlayerUnjail()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0 && WantAdvogado[i] == 0)
{
PlayerInfo[i][pJailTime]--;
}
if(PlayerInfo[i][pJailTime] <= 0 && WantAdvogado[i] == 0)
{
PlayerInfo[i][pJailTime] = 0;
if(PlayerInfo[i][pJailed] == 1)
{
SetPlayerInterior(i, 6);
SetPlayerPos(i,268.0903,77.6489,1001.0391);
}
else if(PlayerInfo[i][pJailed] == 3)
{
SetPlayerInterior(i, 0);
SetPlayerPos(i,338.3080,-1523.9946,33.2635);
}
else if(PlayerInfo[i][pJailed] == 4)
{
SetPlayerInterior(i, 0);
SetPlayerPos(i,-86.0892,-300.3380,2.7646);
}
else if(PlayerInfo[i][pJailed] == 5)
{
SetPlayerInterior(i, 0);
SetPlayerPos(i,1024.3496,-373.1364,73.3885);
}
else if(PlayerInfo[i][pJailed] == 6)
{
SetPlayerInterior(i, 0);
SetPlayerPos(i,1541.1633,-1674.6908,13.5520);
}
else if(PlayerInfo[i][pJailed] == 7)
{
SetPlayerInterior(i, 0);
SetPlayerPos(i,-1529.3772,486.5050,7.1797);
}
else if(PlayerInfo[i][pJailed] == 2)
{
SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(i, 0);
SetPlayerPos(i, 90.2101,1920.4854,17.9422);
}
PlayerInfo[i][pJailed] = 0;
GameTextForPlayer(i, "~g~Livre~n~~w~Nao cometa mais crimes", 5000, 3);
SetPlayerSkin(i,PlayerInfo[i][pSkin]);
if(gTeam[i] == 4) { gTeam[i] = 3; }
ClearCrime(i);
SetPlayerToTeamColor(i);
}
}
}
}
}
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);
public GameModeExitFunc()
{
KillTimer(unjailtimer);
...