28.03.2010, 19:57
Код:
} if(strcmp(cmd, "/prender", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid)) { if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo bateucartгo!"); return 1; } if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391)||!PlayerToPoint(6.0, playerid, 198.3273,178.9865,1003.0303)||!PlayerToPoint(6.0, playerid, 1526.0563,-1678.3832,5.8906)||!PlayerToPoint(6.0, playerid, 312.8958,-1511.3781,24.9219)||PlayerInfo[playerid][pLocal] != 255) {// 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)] [fianзa (0=nгo 1=sim)] [preзofianзa]"); return 1; } moneys = strval(tmp); if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "Preзo Prisгo nгo pode ser inferior a 1 ou acima de $ 99999 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianзa (0=nгo 1=sim)] [preзofianзa]"); return 1; } new time = strval(tmp); if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, " Tempo na Prisao nгo pode ser inferior a 1 ou superior a 20 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianзa (0=nгo 1=sim)] [preзofianзa]"); return 1; } new bail = strval(tmp); if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, " preзo da fianзa nгo pode ser abaixo 0 ou acima 1 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /prender [preзo] [tempo (minutos)] [fianзa (0=nгo 1=sim)] [preзofianзa]"); return 1; } new bailprice = strval(tmp); if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, " fianзa nгo pode ser inferior a 0 ou acima de $ 3000000 $ !"); 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, " Jogador deve ser de pelo menos Procurado Nнvel 1 !"); return 1; } format(string, sizeof(string), "* You arrested %s !", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); GivePlayerMoneyEx(suspect, -moneys); format(string, sizeof(string), "Preso Por %s ~n~ Por $%d", sendername, moneys); GameTextForPlayer(suspect, string, 5000, 5); ResetPlayerWeapons(suspect); if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1) { format(string, sizeof(string), "<< Oficial %s Prendeu o Suspeito %s >>", sendername, giveplayer); OOCNews(COLOR_LIGHTRED, string); } else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2) { format(string, sizeof(string), "<< ROTAM %s Prendeu Suspeito %s >>", sendername, giveplayer); OOCNews(COLOR_LIGHTRED, string); } else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3) { format(string, sizeof(string), "<< Exercito %s Prendeu Suspeito %s >>", sendername, giveplayer); OOCNews(COLOR_LIGHTRED, string); } else if(PlayerInfo[playerid][pMember]==15||PlayerInfo[playerid][pLeader]==15) { format(string, sizeof(string), "<< agente %s Prendeu 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 Preзo Por %d Segundos. Fianca: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]); SendClientMessage(suspect, COLOR_LIGHTBLUE, string); } else { JailPrice[suspect] = 0; format(string, sizeof(string), "Voce Foi Preзo Por %d Segundos. Fianca: Unable", PlayerInfo[suspect][pJailTime]); SendClientMessage(suspect, COLOR_LIGHTBLUE, string); } PlayerInfo[suspect][pJailed] = 1; PlayerInfo[suspect][pArrested] += 1; SetPlayerFree(suspect,playerid, "Tem Detido"); WantedPoints[suspect] = 0; WantedLevel[suspect] = 0; WantLawyer[suspect] = 1; }//distance }//not connected else { SendClientMessage(playerid, COLOR_GREY, " Nгo Ficou Tempo Suficiente, Volte a prisao."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Voce nao e Cop / Gate / Guarda Nacional !"); return 1; } }//not connected return 1;