Код:
if(strcmp(cmd, "/ctempo", true) == 0)
{
SendClientMessage(playerid, COLOR_RED,"[============ Cativeiro United Life ============]");
format(string, sizeof(string), " Ainda faltam %i segundos para vocк sair do cativeiro.", PlayerInfo[playerid][pCativeiro]);
SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
if(strcmp(cmd,"/cativeiro",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE,"USE: /cativeiro [ID do Player] [Tempo]");
return 1;
}
new para1;
new time;
new org = GetPlayerOrg(playerid);
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext,idx);
time = strval(tmp);
if(time < 80 || time > 90) { SendClientMessage(playerid,TEAM_CYAN_COLOR, "ERRO: {FFFFFF}Tempo de cativeiro entre 80 a 90 minutos."); return 1; }
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (ProxDetectorS(3.0,playerid,giveplayerid))
{
if(PlayerInfo[para1][pMembro] == 6||PlayerInfo[para1][pLider] == 6)
{
SendClientMessage(playerid,COLOR_ERRO,"ERRO: {FFFFFF}Vocк nгo pode prender um terrorista no cativeiro.");
return 1;
}
GetPlayerName(para1,giveplayer,sizeof(giveplayer));
GetPlayerName(playerid,sendername,sizeof(sendername));
if ((org == 6) && PlayerToPoint(2.0, playerid,-1104.1871,-1666.2097,76.4672))
{
PlayerInfo[para1][pCativeiro] = time*60;
format(string,256,"<< Terrorista %s prendeu %s no cativeiro. >>",sendername,giveplayer);
SendRadioMessage(6,TEAM_CYAN_COLOR,string);
format(string,sizeof(string),"<!> Vocк ficara %d segundos no cativeiro.",PlayerInfo[para1][pCativeiro]);
SendClientMessage(para1,COLOR_OOC,string);
format(string,sizeof(string),"* Vocк foi preso no cativeiro da FARC.");
SendClientMessage(para1,COLOR_RED,string);
format(string,sizeof(string),"* Vocк prendeu %s no cativeiro.",giveplayer);
SendClientMessage(playerid,COLOR_OOC,string);
format(string,sizeof(string),"* %s prendeu %s no cativeiro.",sendername,giveplayer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerInfo[para1][pJailed] = 4; //Cativeiro
PlayerInfo[para1][pPnumber] = 0;
Telefoneoff[para1] = 1;
ResetPlayerWeapons(para1);
SetPlayerPos(para1,-1104.1200,-1664.0133,76.4672);
GameTextForPlayer(para1, "~r~Cativeiro", 3000, 1);
SetCameraBehindPlayer(para1);
}
return true;
}
else
{
SendClientMessage(playerid,COLOR_ERRO,"ERRO: {FFFFFF}Vocк nгo esta proximo ao personagem.");
}
}
}
}
Код:
public SetPlayerUnjail()
{
new plname[MAX_PLAYER_NAME];
new string[256];
if(PaintballPlayers >= 2 && PaintballRound != 1 && StartingPaintballRound != 1)
{
StartingPaintballRound = 1;
SetTimer("PreparePaintball",15000,0);
}
if(KartingPlayers >= 2 && KartingRound != 1 && StartingKartRound != 1)
{
StartingKartRound = 1;
SetTimer("PrepareKarting",15000,0);
}
if(KartingRound != 0 && KartingPlayers < 2)
{
StartingKartRound = 0;
KartingRound = 0;
EndingKartRound = 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new newcar = GetPlayerVehicleID(i);
/* new level = PlayerInfo[i][pLevel];
if(level >= 0 && level <= 2) { PlayerInfo[i][pSalario] += 10; }
else if(level >= 3 && level <= 4) { PlayerInfo[i][pSalario] += 8; }
else if(level >= 5 && level <= 6) { PlayerInfo[i][pSalario] += 7; }
else if(level >= 7 && level <= 8) { PlayerInfo[i][pSalario] += 6; }
else if(level >= 9 && level <= 10) { PlayerInfo[i][pSalario] += 5; }
else if(level >= 11 && level <= 12) { PlayerInfo[i][pSalario] += 4; }
else if(level >= 13 && level <= 14) { PlayerInfo[i][pSalario] += 3; }
else if(level >= 15 && level <= 20) { PlayerInfo[i][pSalario] += 2; }
else if(level >= 21) { PlayerInfo[i][pSalario] += 1; }*/
new vip = PlayerInfo[i][pPremio];
if(vip >= 1 && vip <= 2) { PlayerInfo[i][pSalario] += 8; }
else if(vip >= 3) { PlayerInfo[i][pSalario] += 9; }
if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0 && PlayerInfo[i][pCativeiro] > 0 && WantAdvogado[i] == 0)
{
PlayerInfo[i][pJailTime]--;
PlayerInfo[i][pCativeiro]--;
}
if(PlayerInfo[i][pJailTime] <= 0 && PlayerInfo[i][pCativeiro] <= 0 && WantAdvogado[i] == 0)
{
PlayerInfo[i][pJailTime] = 0;
PlayerInfo[i][pCativeiro] = 0;
if(PlayerInfo[i][pJailed] == 1) //DP-LV
{
SetPlayerInterior(i,6);
SetPlayerPos(i,246.3717,70.7452,1003.6406);
format(string,sizeof(string),"~g~Liberdade~n~~w~voce pagou pelos seus crimes");
SendClientMessage(i,COLOR_WHITE,"Vocк estб livre а sociedade, nгo cometa mais Crimes.");
}
else if(PlayerInfo[i][pJailed] == 2) //Presidio
{
SetPlayerInterior(i,0);
SetPlayerPos(i,135.2981,1950.0212,19.3877);
format(string,sizeof(string),"~g~Liberdade~n~~w~voce pagou pelos seus crimes");
SendClientMessage(i,COLOR_WHITE,"Vocк estб livre а sociedade, nгo cometa mais Crimes.");
}
else if(PlayerInfo[i][pJailed] == 3) //DC
{
SetPlayerInterior(i,3);
SetPlayerPos(i,231.3009,151.1486,1003.0234);
format(string,sizeof(string),"~g~Liberdade~n~~w~voce pagou pelos seus crimes");
SendClientMessage(i,COLOR_WHITE,"Vocк estб livre а sociedade, nгo cometa mais Crimes.");
}
else if(PlayerInfo[i][pJailed] == 4) //Cativeiro
{
SetPlayerInterior(i,0);
SetPlayerPos(i,-1003.3812,-1715.4420,77.5703);
format(string,sizeof(string),"~g~Liberdade~n~~w~voce foi liberado do cativeiro");
}
PlayerInfo[i][pJailed] = 0;
Telefoneoff[i] = 0;
if(gTeam[i] == 4) { gTeam[i] = 3; }
ClearCrime(i);
TextDrawUpdate(i);
}