Advertisement
MarlonCS

Sistema de Polícia

Aug 3rd, 2012
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 26.34 KB | None | 0 0
  1. /* ------------------ FilterScript de Policial 1.6 ----------------------------
  2.  
  3.             Criador: [XPG]MarlonCS
  4.                                  ~Não retire os créditos~
  5. -----------------------------------------------------------------------------*/
  6.  
  7. // ________________ Includes _________________
  8. #include <a_samp>
  9. #include <zcmd>
  10. #include <DOF2>
  11. #include <sscanf>
  12.  
  13. // ________________ Defines ________________
  14. #define COR_CINZA 0xBFC0C2FF
  15. #define COR_BRANCO 0xFAFAFAFF
  16. #define COR_VERMELHO 0xFF0000AA
  17. #define COR_AZUL 0x00A5FFFF
  18. #define DialogBoxEx 1
  19. #define ARQUIVO "PolicialSys/%s.ini"
  20.  
  21. // ________________ News ________________
  22.  
  23. new
  24.    quantidade[MAX_PLAYERS],
  25.    procurando[MAX_PLAYERS],
  26.    procurado[MAX_PLAYERS],
  27.    policial[MAX_PLAYERS],
  28.    nome[MAX_PLAYER_NAME],
  29.    Prisao[MAX_PLAYERS],
  30.    mortes[MAX_PLAYERS],
  31.    level[MAX_PLAYERS],
  32.    time[MAX_PLAYERS],
  33.    giveplayerid,
  34.    playermoney,
  35.    arquivo[50],
  36.    texto[256],
  37.    timer[500],
  38.    cmd[256],
  39.    carro
  40. ;
  41. public OnFilterScriptInit()
  42. {
  43.     print("\n--------------|||||--------------------------");
  44.     print(" Sistema de Policia ---- made by [XPG]MarlonCS");
  45.     print(" .........................Carregado com sucesso!");
  46.     print("-----------------------------------------------\n");
  47.     return 1;
  48. }
  49. public OnFilterScriptExit()
  50. {
  51.     DOF2_Exit();
  52.     return 1;
  53. }
  54. public OnPlayerConnect(playerid)
  55. {
  56. //  ___________________ Carregar Informações do Player ___________________
  57.     format(arquivo, sizeof(arquivo), ARQUIVO, pnome(playerid));
  58.     policial[playerid] = DOF2_GetInt(arquivo, "Policial");
  59.     procurado[playerid] = DOF2_GetInt(arquivo, "Procurado");
  60.     level[playerid] = DOF2_GetInt(arquivo, "LevelProcura");
  61.     Prisao[playerid] = DOF2_GetInt(arquivo, "Preso");
  62.     quantidade[playerid] = DOF2_GetInt(arquivo, "Contagem");
  63.     SetPlayerWantedLevel(playerid, level[playerid]);
  64.     DOF2_SaveFile();
  65.     return 1;
  66. }
  67. public OnPlayerDisconnect(playerid, reason)
  68. {
  69.     format(arquivo, sizeof(arquivo), ARQUIVO, pnome(playerid));
  70.     level[playerid] = GetPlayerWantedLevel(playerid);
  71.     DOF2_SetInt(arquivo, "LevelProcura", level[playerid]);
  72.     DOF2_SetInt(arquivo, "Procurado", procurado[playerid]);
  73.     DOF2_SetInt(arquivo, "Preso", Prisao[playerid]);
  74.     DOF2_SetInt(arquivo,"Contagem",quantidade[playerid]);
  75.     DOF2_SaveFile();
  76.     return 1;
  77. }
  78. public OnPlayerDeath(playerid, killerid, reason)
  79. {
  80.     mortes[playerid]++;
  81.     quantidade[killerid]++;
  82.     new arquivok[32];
  83.     new tmatador[32];
  84.     format(arquivo, sizeof(arquivo), ARQUIVO,pnome(playerid));
  85.  
  86.     if(policial[playerid]==1) { // Se o player matar um policial
  87.         if(policial[killerid]==0) {
  88.             new condenado[MAX_PLAYER_NAME];
  89.             GetPlayerName(killerid, condenado, MAX_PLAYER_NAME);
  90.             procurado[killerid]=1;
  91.             level[killerid]=GetPlayerWantedLevel(killerid);
  92.             if(level[killerid]==0)SetPlayerWantedLevel(killerid, 1);
  93.             if(level[killerid]==1)SetPlayerWantedLevel(killerid, 2);
  94.             if(level[killerid]==2)SetPlayerWantedLevel(killerid, 3);
  95.             if(level[killerid]==3)SetPlayerWantedLevel(killerid, 4);
  96.             if(level[killerid]==4)SetPlayerWantedLevel(killerid, 5);
  97.             if(level[killerid]==5)SetPlayerWantedLevel(killerid, 6);
  98.             if(level[killerid]==6)SetPlayerWantedLevel(killerid, 6);
  99.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  100.             level[playerid] = GetPlayerWantedLevel(killerid);
  101.             format(arquivo, sizeof(arquivo), ARQUIVO,condenado);
  102.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  103.             DOF2_SetInt(arquivo,"LevelProcura",level[killerid]);
  104.             DOF2_SetInt(arquivo,"Contagem",quantidade[killerid]);
  105.             DOF2_SaveFile();
  106.             format(texto,sizeof(texto),"[SERVER] Player %s matou o policial %s.",condenado,pnome(playerid));
  107.             SendClientMessageToAll(COR_VERMELHO, texto);
  108.         }
  109.     }
  110.  
  111.     if(policial[killerid]==1 && procurado[playerid]==1 && GetPlayerWantedLevel(playerid) > 0) { // Se o policial matar um procurado
  112.         new pmnome[MAX_PLAYER_NAME];
  113.         GetPlayerName(killerid, pmnome, MAX_PLAYER_NAME);
  114.         level[playerid] = GetPlayerWantedLevel(killerid);
  115.         if(level[playerid]==1)GivePlayerMoney(killerid, 1000);
  116.         if(level[playerid]==2)GivePlayerMoney(killerid, 2000);
  117.         if(level[playerid]==3)GivePlayerMoney(killerid, 3000);
  118.         if(level[playerid]==4)GivePlayerMoney(killerid, 4000);
  119.         if(level[playerid]==5)GivePlayerMoney(killerid, 5000);
  120.         if(level[playerid]==6)GivePlayerMoney(killerid, 6000);
  121.         GivePlayerMoney(playerid, -500);
  122.         format(texto, sizeof(texto), "[SERVER] Policial %s matou o procurado %s [%i].",pmnome,pnome(playerid),playerid);
  123.         SendClientMessageToAll(COR_AZUL,texto);
  124.         procurado[playerid]=0;
  125.         quantidade[playerid]=0;
  126.         level[playerid] = SetPlayerWantedLevel(playerid, 0);
  127.         DOF2_SetInt(arquivo,"Procurado",procurado[playerid]);
  128.         DOF2_SetInt(arquivo,"LevelProcura",level[playerid]);
  129.         DOF2_SetInt(arquivo,"Contagem",quantidade[playerid]);
  130.         DOF2_SaveFile();
  131.     }
  132.  
  133.     if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER) { // Se alguém cometer DB
  134.         if(policial[killerid]==0) {
  135.             procurado[killerid]=1;
  136.             new acusado[MAX_PLAYER_NAME];
  137.             new vitima[MAX_PLAYER_NAME];
  138.             GetPlayerName(killerid, acusado, MAX_PLAYER_NAME);
  139.             GetPlayerName(playerid, vitima, MAX_PLAYER_NAME);
  140.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  141.             GameTextForPlayer(playerid,"~r~Atropelado",5000,3);
  142.             format(texto, sizeof(texto), "[SERVER] %s Fez Drive-By (DB) em %s.",acusado,vitima);
  143.             format(arquivo, sizeof(arquivo), ARQUIVO,acusado);
  144.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  145.             DOF2_SaveFile();
  146.             level[killerid] = GetPlayerWantedLevel(killerid);
  147.             //Aumentar level de procurado do player
  148.             if(level[killerid]==0)SetPlayerWantedLevel(killerid, 1);
  149.             if(level[killerid]==1)SetPlayerWantedLevel(killerid, 2);
  150.             if(level[killerid]==2)SetPlayerWantedLevel(killerid, 3);
  151.             if(level[killerid]==3)SetPlayerWantedLevel(killerid, 4);
  152.             if(level[killerid]==4)SetPlayerWantedLevel(killerid, 5);
  153.             if(level[killerid]==5)SetPlayerWantedLevel(killerid, 6);
  154.             if(level[killerid]==6)SetPlayerWantedLevel(killerid, 6);
  155.             for(new i; i < MAX_PLAYERS; i++)
  156.                 if(policial[i]==1){SendClientMessage(i, 0xCECE00AA, texto);}
  157.         }
  158.     }
  159.  
  160.     // Quanto mais matar, mais procurado fica
  161.     GetPlayerName(killerid,tmatador,sizeof(tmatador));
  162.     format(arquivok, sizeof(arquivok), ARQUIVO,tmatador);
  163.     DOF2_SetInt(arquivok,"Contagem",quantidade[killerid]);
  164.     if(quantidade[playerid] == 10) {
  165.         if(policial[killerid]==0) {
  166.             new matador[MAX_PLAYER_NAME];
  167.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  168.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  169.             procurado[killerid]=1;
  170.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  171.             DOF2_SaveFile();
  172.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  173.             SetPlayerWantedLevel(killerid, 1);
  174.         }
  175.     }
  176.     if(quantidade[killerid] == 20) {
  177.         if(policial[killerid]==0) {
  178.             new matador[MAX_PLAYER_NAME];
  179.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  180.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  181.             procurado[killerid]=1;
  182.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  183.             DOF2_SaveFile();
  184.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  185.             SetPlayerWantedLevel(killerid, 2);
  186.         }
  187.     }
  188.     if(quantidade[killerid] == 30) {
  189.         if(policial[killerid]==0) {
  190.             new matador[MAX_PLAYER_NAME];
  191.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  192.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  193.             procurado[killerid]=1;
  194.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  195.             DOF2_SaveFile();
  196.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  197.             SetPlayerWantedLevel(killerid, 3);
  198.         }
  199.     }
  200.     if(quantidade[killerid] == 40) {
  201.         if(policial[killerid]==0) {
  202.             new matador[MAX_PLAYER_NAME];
  203.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  204.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  205.             procurado[killerid]=1;
  206.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  207.             DOF2_SaveFile();
  208.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  209.             SetPlayerWantedLevel(killerid, 4);
  210.         }
  211.     }
  212.     if(quantidade[killerid] == 50) {
  213.         if(policial[killerid]==0) {
  214.             new matador[MAX_PLAYER_NAME];
  215.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  216.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  217.             procurado[killerid]=1;
  218.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  219.             DOF2_SaveFile();
  220.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  221.             SetPlayerWantedLevel(killerid, 5);
  222.         }
  223.     }
  224.     if(quantidade[killerid] == 60) {
  225.         if(policial[killerid]==0) {
  226.             new matador[MAX_PLAYER_NAME];
  227.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  228.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  229.             procurado[killerid]=1;
  230.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  231.             DOF2_SaveFile();
  232.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Seu nível de procurado aumentou.");
  233.             SetPlayerWantedLevel(killerid, 6);
  234.         }
  235.     }
  236.     if(quantidade[killerid] > 61) { // Nível crítico. Aqui o Player pode ser preso
  237.         if(policial[killerid]==0) {
  238.             new matador[MAX_PLAYER_NAME];
  239.             GetPlayerName(killerid, matador, MAX_PLAYER_NAME);
  240.             format(arquivo, sizeof(arquivo), ARQUIVO,matador);
  241.             procurado[killerid]=1;
  242.             DOF2_SetInt(arquivo,"Procurado",procurado[killerid]);
  243.             DOF2_SaveFile();
  244.             SendClientMessage(killerid,COR_VERMELHO,"[SERVER] Cuidado, você pode ser preso agora.");
  245.             SetPlayerWantedLevel(killerid, 7);
  246.         }
  247.     }
  248.     return 1;
  249. }
  250. public OnPlayerSpawn(playerid)
  251. {
  252.     if(Prisao[playerid]==1) {
  253.         SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0233);
  254.         SetPlayerInterior(playerid, 3);
  255.         SetTimerEx("SetPlayerPrisao", 1800000, 0, "i", playerid);
  256.         SendClientMessage(playerid, COR_VERMELHO, "[SERVER] Aguarde 3 minutos para se libertar.");
  257.     }
  258.     return 1;
  259. }
  260. stock pnome(playerid)
  261. {
  262. GetPlayerName(playerid, nome, sizeof(nome));
  263. return nome;
  264. }
  265. forward SetPlayerPrisao(playerid);
  266. public SetPlayerPrisao(playerid)
  267. {
  268.     SetPlayerInterior(playerid,0);
  269.     Prisao[playerid] = 0;
  270.     GameTextForPlayer(playerid, "~g~Voce esta livre!", 1000,1);
  271.     level[playerid]=0;
  272.     SetPlayerWantedLevel(playerid, level[playerid]);
  273.     procurado[playerid]=0;
  274.     quantidade[playerid]=0;
  275.     format(arquivo, sizeof(arquivo), ARQUIVO,pnome(playerid));
  276.     DOF2_SetInt(arquivo,"Procurado",procurado[playerid]);
  277.     DOF2_SetInt(arquivo,"LevelProcura",level[playerid]);
  278.     DOF2_SetInt(arquivo,"Preso",Prisao[playerid]);
  279.     DOF2_SetInt(arquivo,"Contagem",quantidade[playerid]);
  280.     DOF2_SaveFile();
  281.     SpawnPlayer(playerid);
  282.     SendClientMessage(playerid,0x00FF00FF,"[SERVER] Pronto, você está livre.");
  283.     return 1;
  284. }
  285. // ____________________________ ZCMDs ____________________________
  286. CMD:pmcmds(playerid, params[])
  287. {
  288.     if(policial[playerid]==1) {
  289.         new strdialog[2024];
  290.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/pmc [texto]{FFFFFF} => Chat Policial.\n");
  291.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/procurar [ID]{FFFFFF} => Procure um Player por ID.\n");
  292.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/v{FFFFFF} => Crie um veículo policial.\n");
  293.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/procurados{FFFFFF} => Ver lista de procurados.\n");
  294.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/moto{FFFFFF} => Crie uma moto policial.\n");
  295.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/dizer{FFFFFF} => Diga algo em destaque para os players.\n");
  296.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/helicoptero{FFFFFF} => Crie um helicóptero policial.\n");
  297.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/prender [ID]{FFFFFF} => Prenda um Player por 3 minutos.\n");
  298.         format(strdialog, sizeof(strdialog),"%s%s",strdialog, "{00FF00}/desprender [ID]{FFFFFF} => Liberte um player que esteja preso.\n");
  299.         return ShowPlayerDialog(playerid, DialogBoxEx, DIALOG_STYLE_MSGBOX, "===== {00FF00}Comandos de Policial{FFFFFF} =====", strdialog, "OK", "");
  300.     }
  301.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  302. }
  303. CMD:policiais(playerid, params[])
  304. {
  305.     new arm[500]; arm[0] = '\0';
  306.     new str[500];  str[0] = '\0';
  307.     new Nome[24]; Nome[0] = '0';
  308.     new count;
  309.     for(new i=0;i<MAX_PLAYERS;i++) {
  310.         if(policial[i] > 0 && IsPlayerConnected(i)) {
  311.             count++;
  312.             GetPlayerName(i, Nome, sizeof(Nome));
  313.             format(str, sizeof(str),"{FFFFFF}Nome: {00FF00}%s {FFFFFF}[%i]\n", Nome, i);
  314.             strcat(arm, str);
  315.         }
  316.     }
  317.     if(count<=0)return ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "===== {00FF00}Policiais{FFFFFF} ======", "{FF0000}Nenhum policial online", "OK", "");
  318.     if(count>0)ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "===== {00FF00}Policiais{FFFFFF} ======", arm, "OK", "");
  319.     return 1;
  320. }
  321. CMD:procurados(playerid, params[])
  322. {
  323.     static arm[500]; arm[0] = '\0';
  324.     static str[500];  str[0] = '\0';
  325.     static Nome[24]; Nome[0] = '0';
  326.     new count;
  327.     new preso[32];
  328.     for(new i=0;i<MAX_PLAYERS;i++) {
  329.         if(procurado[i] > 0 && IsPlayerConnected(i) && policial[i]==0 && GetPlayerWantedLevel(i) > 0) {
  330.             count++;
  331.             GetPlayerName(i, Nome, sizeof(Nome));
  332.             if(Prisao[i]==1)preso="{00FF00}Sim";
  333.             if(Prisao[i]==0)preso="{FF0000}Não";
  334.             format(str, sizeof(str),"{FFFFFF}Nome: {FF0000}%s {FFFFFF}[%i] {FF0000}(Nível: %d) {FFFFFF}| Preso: %s{FFFFFF}\n", Nome, i, GetPlayerWantedLevel(i), preso);
  335.             strcat(arm, str);
  336.         }
  337.     }
  338.     if(count<=0)return ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "===== {FF0000}Procurados{FFFFFF} ======", "{00FF00}Nenhum suspeito online", "OK", "");
  339.     if(count>0)ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "===== {FF0000}Procurados{FFFFFF} ======", arm, "OK", "");
  340.     return 1;
  341. }
  342. CMD:pmc(playerid, params[])
  343. {
  344.     if(policial[playerid]==1) {
  345.         if(!cmd[3])return SendClientMessage(playerid, 0xFF0000FF, "[SERVER] USO: /chat [texto]");
  346.         format(texto, sizeof(texto), "[Policiais] %s: {FFFFFF}%s", pnome(playerid), cmd[5]);
  347.         for(new i=0;i<MAX_PLAYERS;i++)
  348.             if(policial[i]==1)SendClientMessage(i,0x1E90FFFF,texto);
  349.         return 1;
  350.     }
  351.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  352. }
  353. CMD:procurar(playerid, params[])
  354. {
  355.     if(policial[playerid]==1) {
  356.         if(sscanf(params, "u",giveplayerid)) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /procurar [ID]"); }
  357.         else
  358.         {
  359.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "[SERVER] Id invalido.");
  360.             SendClientMessage(playerid, COR_AZUL, "[SERVER] Para desativar o GPS use /procurar d");
  361.             format(texto,sizeof(texto),"[SERVER] Policial %s está a sua procura.", pnome(playerid));
  362.             SendClientMessage(giveplayerid,COR_VERMELHO,texto);
  363.             new Float:X,Float:Y,Float:Z;
  364.             procurando[playerid]=1;
  365.             GetPlayerPos(giveplayerid, X,Y,Z);
  366.             SetPlayerCheckpoint(playerid, X,Y,Z, 6);
  367.             timer[playerid] = SetTimerEx("Procurar",100,true,"ii",playerid,giveplayerid);
  368.         }
  369.         if (procurando[playerid]==1) {
  370.             switch (cmd[10]) {
  371.                 case 'd': DisablePlayerCheckpoint(playerid), KillTimer(timer[playerid]), procurando[playerid]=0, SendClientMessage(playerid, COR_BRANCO, "[SERVER] GPS Desativado.");
  372.             }
  373.         }
  374.         return 1;
  375.     }
  376.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  377. }
  378. CMD:dizer(playerid, params[])
  379. {
  380.     if(policial[playerid]==1) {
  381.         if(!cmd[5])return SendClientMessage(playerid, 0xFF0000FF, "[SERVER] USO: /dizer [texto]");
  382.         format(texto, sizeof(texto), "[POLICIAL] %s: {FFFFFF}%s", pnome(playerid), cmd[7]);
  383.         SendClientMessageToAll(0x00FF00AA, texto);
  384.         return 1;
  385.     }
  386.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  387. }
  388. CMD:prender(playerid, params[])
  389. {
  390.     new variavel[256];
  391.     new nomep[32];
  392.     new Float:x, Float:y, Float:z;
  393.     if(policial[playerid]==1) {
  394.         if(sscanf(params, "u",giveplayerid)) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /prender [ID]"); }
  395.         else
  396.         {
  397.             if(policial[giveplayerid]==1)return SendClientMessage(playerid, COR_CINZA, "[SERVER] Player é um policial!");
  398.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "[SERVER] Id invalido.");
  399.             if(Prisao[giveplayerid]==1) return SendClientMessage(playerid, COR_CINZA, "[SERVER] Player já está preso!");
  400.             level[giveplayerid] = GetPlayerWantedLevel(giveplayerid);
  401.             GetPlayerPos(giveplayerid, x, y, z);
  402.             if(IsPlayerConnected(giveplayerid) && IsPlayerInRangeOfPoint(playerid, 10, x, y, z)) {
  403.                 if(level[giveplayerid] == 5) {
  404.                     Prisao[giveplayerid] = 1;
  405.                     GetPlayerName(giveplayerid,nomep,sizeof(nomep));
  406.                     SetPlayerPos(giveplayerid, 197.6661, 173.8179, 1003.0233);
  407.                     SetPlayerInterior(giveplayerid, 3);
  408.                     time[giveplayerid] = SetTimerEx("SetPlayerPrisao", 180000, 0, "i", giveplayerid);
  409.                     format(variavel,sizeof(variavel),"[SERVER] Você foi preso pelo policial %s",pnome(playerid));
  410.                     format(texto,sizeof(texto),"[SERVER] %s foi preso por 3 minutos pelo policial %s",nomep,pnome(playerid));
  411.                     SendClientMessage(giveplayerid, COR_VERMELHO, variavel);
  412.                     SendClientMessageToAll(COR_VERMELHO, texto);
  413.                 }
  414.                 if(level[giveplayerid] < 5){ return SendClientMessage(playerid, COR_CINZA, "[SERVER] O Player não tem level de procurado suficiente!"); }
  415.             }
  416.         }
  417.     }
  418.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  419. }
  420. CMD:desprender(playerid, params[])
  421. {
  422.     new nomep[32];
  423.     if(policial[playerid]==1) {
  424.         if(sscanf(params, "u",giveplayerid)) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /desprender [ID]"); }
  425.         else
  426.         {
  427.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "[SERVER] Id invalido.");
  428.             if(Prisao[giveplayerid]==0) return SendClientMessage(playerid, COR_CINZA, "[SERVER] Player não está preso!");
  429.             GetPlayerName(giveplayerid,nomep,sizeof(nomep));
  430.             SetPlayerInterior(giveplayerid,0);
  431.             SpawnPlayer(giveplayerid);
  432.             Prisao[giveplayerid] = 0;
  433.             GameTextForPlayer(giveplayerid, "~g~Voce esta livre!", 1000,1);
  434.             level[giveplayerid]=0;
  435.             SetPlayerWantedLevel(giveplayerid, level[giveplayerid]);
  436.             GetPlayerWantedLevel(giveplayerid);
  437.             KillTimer(time[giveplayerid]);
  438.             procurado[giveplayerid]=0;
  439.             quantidade[giveplayerid]=0;
  440.             format(arquivo, sizeof(arquivo), ARQUIVO,nomep);
  441.             DOF2_SetInt(arquivo,"Procurado",procurado[giveplayerid]);
  442.             DOF2_SetInt(arquivo,"LevelProcura",level[giveplayerid]);
  443.             DOF2_SetInt(arquivo,"Preso",Prisao[giveplayerid]);
  444.             DOF2_SetInt(arquivo,"Contagem",quantidade[giveplayerid]);
  445.             DOF2_SaveFile();
  446.             format(texto,sizeof(texto),"[SERVER] %s foi solto pelo policial %s",nomep,pnome(playerid));
  447.             SendClientMessageToAll(COR_AZUL,texto);
  448.             SendClientMessage(giveplayerid,0x00FF00FF,"[SERVER] Pronto, você está livre.");
  449.             return 1;
  450.         }
  451.     }
  452.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  453. }
  454. CMD:v(playerid, params[])
  455. {
  456.     if(policial[playerid]==1) {
  457.         if(IsPlayerInAnyVehicle(playerid)) {
  458.             return SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você já está em um veículo");
  459.         }
  460.         playermoney = GetPlayerMoney(playerid);
  461.         if(playermoney > 1000) {
  462.             new Float:var0 = 0, Float:var1 = 0, Float:var2 = 0, Float:var3 = 0;
  463.             GetPlayerPos(playerid, var0, var1, var2);
  464.             GetPlayerFacingAngle(playerid, var3);
  465.             GivePlayerMoney(playerid,-1000);
  466.             SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você gastou R$ 1.000,00 pelo veículo.");
  467.             carro = CreateVehicle(596, var0 + 1, var1 + 1, var2, var3, 103, 1, 60);
  468.             SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você gastou R$ 1.000,00 pelo veículo.");
  469.             PutPlayerInVehicle(playerid, carro, 0);
  470.         }
  471.         else {
  472.             SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não tem dinheiro suficiente");
  473.         }
  474.         return 1;
  475.     }
  476.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  477. }
  478. CMD:moto(playerid, params[])
  479. {
  480.     if(policial[playerid]==1) {
  481.         if(IsPlayerInAnyVehicle(playerid)) {
  482.             return SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você já está em um veículo");
  483.         }
  484.         playermoney = GetPlayerMoney(playerid);
  485.         if(playermoney > 1000) {
  486.             new Float:var0 = 0, Float:var1 = 0, Float:var2 = 0, Float:var3 = 0;
  487.             GetPlayerPos(playerid, var0, var1, var2);
  488.             GetPlayerFacingAngle(playerid, var3);
  489.             GivePlayerMoney(playerid,-1000);
  490.             SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você gastou R$ 1.000,00 pelo veículo.");
  491.             carro = CreateVehicle(523, var0 + 1, var1 + 1, var2, var3, 103, 1, 60);
  492.             SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você gastou R$ 1.000,00 pelo veículo.");
  493.             PutPlayerInVehicle(playerid, carro, 0);
  494.         }
  495.         else {
  496.             SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não tem dinheiro suficiente");
  497.         }
  498.         return 1;
  499.     }
  500.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  501. }
  502. CMD:helicoptero(playerid, params[])
  503. {
  504.     if(policial[playerid] == 1) {
  505.         if(IsPlayerInAnyVehicle(playerid)) {
  506.             return SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você já está em um veículo");
  507.         }
  508.         playermoney = GetPlayerMoney(playerid);
  509.         if(playermoney > 4000) {
  510.             new Float:var0 = 0, Float:var1 = 0, Float:var2 = 0, Float:var3 = 0;
  511.             GetPlayerPos(playerid, var0, var1, var2);
  512.             GetPlayerFacingAngle(playerid, var3);
  513.             GivePlayerMoney(playerid,-4000);
  514.             SendClientMessage(playerid, 0x33AA33AA, "[SERVER] Você gastou R$ 4.000,00 pelo veículo.");
  515.             carro = CreateVehicle(497, var0 + 1, var1 + 1, var2, var3, 103, 1, 60);
  516.             PutPlayerInVehicle(playerid, carro, 0);
  517.         }
  518.         else {
  519.             SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não tem dinheiro suficiente.");
  520.         }
  521.         return 1;
  522.     }
  523.     return SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é policial!");
  524. }
  525. // _______________________________ RCON _______________________________
  526. CMD:darpm(playerid, params[])
  527. {
  528.     new nomep[32];
  529.     if(IsPlayerAdmin(playerid)) {
  530.         if(sscanf(params, "u",giveplayerid)) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /darpm [ID]"); }
  531.         else
  532.         {
  533.             GetPlayerName(giveplayerid,nomep,sizeof(nomep));
  534.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "[SERVER] Id invalido.");
  535.             if(policial[giveplayerid]==1){return SendClientMessage(playerid, COR_CINZA, "[SERVER] Player já é Policial!");}
  536.             if(procurado[giveplayerid]==1){return SendClientMessage(playerid, COR_CINZA, "[SERVER] O player é um procurado.");}
  537.             policial[giveplayerid]=1;
  538.             format(arquivo, sizeof(arquivo), ARQUIVO, nomep);
  539.             DOF2_SetInt(arquivo,"Policial",policial[giveplayerid]);
  540.             DOF2_SaveFile();
  541.             format(texto,sizeof(texto),"[SERVER] %s [%d] foi feito policial pelo Admin %s",nomep,giveplayerid,pnome(playerid));
  542.             SendClientMessage(giveplayerid, COR_AZUL, "[SERVER] Para ver os comandos de PMs, use /pmcmds");
  543.             SendClientMessageToAll(COR_AZUL, texto);
  544.         }
  545.     }
  546.     else { SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é Admin!"); }
  547.     return 1;
  548. }
  549. CMD:tirarpm(playerid, params[])
  550. {
  551.     new nomep[32];
  552.     if(IsPlayerAdmin(playerid)) {
  553.         if(sscanf(params, "u",giveplayerid)) { return SendClientMessage(playerid, -1, "[SERVER] Uso: /tirarpm [ID]"); }
  554.         else
  555.         {
  556.             GetPlayerName(giveplayerid,nomep,sizeof(nomep));
  557.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COR_BRANCO, "[SERVER] Id invalido.");
  558.             if(policial[giveplayerid]!=1) SendClientMessage(playerid, COR_CINZA, "[SERVER] Player não é um policial!");
  559.             policial[giveplayerid]=0;
  560.             format(arquivo, sizeof(arquivo), ARQUIVO, nomep);
  561.             DOF2_SetInt(arquivo,"Policial",policial[giveplayerid]);
  562.             DOF2_SaveFile();
  563.             format(texto,sizeof(texto),"[SERVER] %s [%d] foi retirado dos policiais pelo admin %s",nomep,giveplayerid,pnome(playerid));
  564.             SendClientMessageToAll(COR_VERMELHO, texto);
  565.         }
  566.     }
  567.     else { SendClientMessage(playerid, COR_CINZA, "[SERVER] Você não é Admin!"); }
  568.     return 1;
  569. }
  570. // _______________________________________________________________ FIM DO CÓDIGO
  571. // Bugs? Ajuda?
  572. // marloncs_22 << Skype
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement