Advertisement
MarlonCS

Sistema de Polícia 3.0

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