Advertisement
Hardware

Sistema de prisão - Bebida

Jul 15th, 2011
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.73 KB | None | 0 0
  1. /*
  2.     ~~~~~~~~~~~~~~~~~~~~ » Sistema de prisão - Por bebida! « ~~~~~~~~~~~~~~~~~~~~
  3.     Bom, fiz esse sistema para testar umas coisas. Só que no fim, acabou saindo isso.
  4.     Autor: Hardware - Bryan
  5.     Contato: mac-samp@hotmail.com
  6.     Quer usar esse sitema? Use, sem problem algum, mas não retire os créditos.
  7. */
  8.  
  9. #include <a_samp>
  10. #include "../include/gl_common.inc"
  11.  
  12. new
  13.     procurado[MAX_PLAYERS]
  14. ;
  15.  
  16. public OnGameModeInit()
  17. {
  18.     //Prisão:
  19.     printf("\n--------------------------------------");
  20.     printf(" [FS] SPrisão Bebida");
  21.     printf(" Autor: Hardware - Bryan");
  22.     printf("--------------------------------------\n");
  23.     CreateObject(2951, 2257.747070, 1017.940002, 78.554688, 0.000000, 0.000000, 22.000000); //object (a51_labdoor) (1)
  24.     CreateObject(2951, 2262.928711, 1019.919434, 78.554688, 0.000000, 0.000000, 21.994629); //object (a51_labdoor) (2)
  25.     CreateObject(2951, 2268.043701, 1021.883301, 78.554688, 0.000000, 0.000000, 21.994629); //object (a51_labdoor) (3)
  26.     CreateObject(2951, 2273.290039, 1024.149658, 78.554688, 0.000000, 0.000000, 21.994629); //object (a51_labdoor) (4)
  27.     CreateObject(2951, 2276.812012, 1022.577576, 78.554688, 0.000000, 0.000000, 287.994629); //object (a51_labdoor) (5)
  28.     CreateObject(2951, 2278.491455, 1017.513916, 78.554688, 0.000000, 0.000000, 287.990112); //object (a51_labdoor) (6)
  29.     CreateObject(2951, 2280.141357, 1012.578308, 78.554688, 0.000000, 0.000000, 287.990112); //object (a51_labdoor) (7)
  30.     CreateObject(2951, 2278.230957, 1008.947998, 78.554688, 0.000000, 0.000000, 199.990112); //object (a51_labdoor) (8)
  31.     CreateObject(2951, 2272.987549, 1007.086792, 78.554688, 0.000000, 0.000000, 199.989624); //object (a51_labdoor) (9)
  32.     CreateObject(2951, 2267.847412, 1005.301941, 78.554688, 0.000000, 0.000000, 199.989624); //object (a51_labdoor) (10)
  33.     CreateObject(2951, 2262.791992, 1003.570679, 78.554688, 0.000000, 0.000000, 199.990112); //object (a51_labdoor) (11)
  34.     CreateObject(2951, 2259.104248, 1005.134216, 78.554688, 0.000000, 0.000000, 109.989624); //object (a51_labdoor) (12)
  35.     CreateObject(2951, 2257.259033, 1010.333984, 78.554688, 0.000000, 0.000000, 109.984161); //object (a51_labdoor) (13)
  36.     CreateObject(2951, 2255.588867, 1014.873596, 78.554688, 0.000000, 0.000000, 109.989624); //object (a51_labdoor) (14)
  37.     CreateObject(1452, 2277.671631, 1010.760376, 79.613716, 0.000000, 0.000000, 288.000000); //object (DYN_OUTHOUSE) (1)
  38.     CreateObject(2935, 2258.395508, 1012.411560, 83.737259, 0.000000, 0.000000, 20.000000); //object (kmb_container_yel) (1)
  39.     CreateObject(2935, 2260.633789, 1006.451416, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (2)
  40.     CreateObject(2935, 2257.713867, 1014.500183, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (3)
  41.     CreateObject(2935, 2260.637451, 1015.711365, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (4)
  42.     CreateObject(2935, 2263.136719, 1008.911682, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (5)
  43.     CreateObject(2935, 2263.710449, 1007.454834, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (6)
  44.     CreateObject(2935, 2266.625000, 1008.601563, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (7)
  45.     CreateObject(2935, 2264.198242, 1014.741089, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (8)
  46.     CreateObject(2935, 2263.439453, 1016.801270, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (9)
  47.     CreateObject(2935, 2266.441895, 1017.745728, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (10)
  48.     CreateObject(2935, 2268.736084, 1011.715271, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (11)
  49.     CreateObject(2935, 2269.775391, 1008.750977, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (12)
  50.     CreateObject(2935, 2272.617188, 1009.698120, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (13)
  51.     CreateObject(2935, 2270.369385, 1016.060181, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (14)
  52.     CreateObject(2935, 2269.283691, 1019.013550, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (15)
  53.     CreateObject(2935, 2272.237305, 1020.096924, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (16)
  54.     CreateObject(2935, 2274.758301, 1013.576416, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (17)
  55.     CreateObject(2935, 2275.461914, 1010.967285, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (18)
  56.     CreateObject(2935, 2278.435547, 1012.363892, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (19)
  57.     CreateObject(2935, 2275.991455, 1018.996704, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (20)
  58.     CreateObject(2935, 2275.224121, 1021.237183, 83.737259, 0.000000, 0.000000, 19.995117); //object (kmb_container_yel) (21)
  59.     CreateObject(931, 2259.514160, 1017.240784, 79.616592, 0.000000, 0.000000, 20.000000); //object (RACK3) (1)
  60.     CreateObject(1771, 2274.431885, 1020.631409, 79.188354, 0.000000, 0.000000, 20.000000); //object (CJ_bunk_bed1) (1)
  61.     CreateObject(1771, 2272.849854, 1019.948059, 79.188354, 0.000000, 0.000000, 19.995117); //object (CJ_bunk_bed1) (2)
  62.     CreateObject(1771, 2271.267822, 1019.264465, 79.188354, 0.000000, 0.000000, 19.995117); //object (CJ_bunk_bed1) (3)
  63.     CreateObject(1771, 2269.389160, 1018.416809, 79.188354, 0.000000, 0.000000, 19.995117); //object (CJ_bunk_bed1) (4)
  64.     CreateObject(2297, 2259.832520, 1005.374512, 78.554688, 0.000000, 0.000000, 66.000000); //object (TV_UNIT_2) (1)
  65.     CreateObject(2514, 2277.421875, 1010.667114, 78.554688, 0.000000, 0.000000, 290.000000); //object (CJ_TOILET1) (1)
  66.     return 1;
  67. }
  68.  
  69.  
  70. public OnPlayerCommandText(playerid, cmdtext[])
  71. {
  72.         new tmp[256],idx,cmd[128];
  73.         cmd = strtok(cmdtext,idx);
  74.  
  75.         if(!strcmp(cmdtext,"/presos",true))
  76.         {
  77.             for(new i=0; i <MAX_PLAYERS; i++)
  78.             if(GetPlayerWantedLevel(i)>=3)
  79.             {
  80.                 new nick[64];
  81.                 GetPlayerName(i,nick,sizeof(nick));
  82.                 SendClientMessage(playerid,0xE8E800AA,"•    Presos:    •");
  83.                 format(nick,sizeof(nick),"%s",nick);
  84.                 SendClientMessage(playerid,0x666666AA,nick);
  85.             }
  86.             else
  87.             {
  88.                 SendClientMessage(playerid,0xFFFFFFAA,"• ~~~~~~~ Não há nenhum jogador preso ~~~~~~~~ •");
  89.                 return 0;
  90.             }
  91.             return 1;
  92.         }
  93.         if(!strcmp(cmd,"/pagarfianca",true))
  94.         {
  95.         new id;
  96.         tmp = strtok(cmdtext,idx);
  97.         if(!strlen(tmp)) return SendClientMessage(playerid,0xFF8080AA,"» Use:{FFFFFF}/pagarfianca [id]");
  98.         id = strval(tmp);
  99.         if(IsPlayerConnected(id) == 0) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Player não conectado!");
  100.         if(playerid == id) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Você não pode soltar a sí mesmo!");
  101.         if(GetPlayerMoney(playerid)>=1500)
  102.         {
  103.             new nickp[64],mnick[MAX_PLAYER_NAME], msg[128];
  104.             GetPlayerName(id,nickp,sizeof(nickp));
  105.             GetPlayerName(playerid,mnick,sizeof(mnick));
  106.             format(msg,sizeof(msg),"[INFO] O player %s te soltou ta cadeia.",mnick);
  107.             SendClientMessage(id,0x408080AA,msg);
  108.             SendClientMessage(id,0x408080AA,"[INFO] Você está solto, mas não faça isso novamente!");
  109.             format(msg,sizeof(msg),"[INFO] Você soltou o player %s.", nickp);
  110.             SendClientMessage(playerid,0x408080AA,msg);
  111.             SetPlayerPos(id,2079.7571,1337.5437,10.8203);
  112.             SetPlayerDrunkLevel(playerid,0);
  113.             SetPlayerWantedLevel(playerid,0);
  114.         }
  115.         else
  116.         {
  117.             SendClientMessage(playerid,0xFF0000AA,"[ERRO] Você não tem dinheiro para soltar alguém da prisão!");
  118.         }
  119.         return 1;
  120.         }
  121.  
  122.         if(!strcmp(cmd,"/procurar",true))
  123.         {
  124.             new id;
  125.             tmp = strtok(cmdtext,idx);
  126.             if(!strlen(tmp)) return SendClientMessage(playerid,0xFF8080AA,"{FFFFFF}[X]{FF8080} Use: /procurar [id]");
  127.             id = strval(tmp);
  128.             if(IsPlayerConnected(id) == 0) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Jogador não conectado!");
  129.             if(playerid == id) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Você não pode procurar a sí mesmo.");
  130.  
  131.             new nick[MAX_PLAYER_NAME],pnome[MAX_PLAYER_NAME],msg[128];
  132.             GetPlayerName(playerid,nick,sizeof(nick));
  133.             GetPlayerName(id,pnome,sizeof(pnome));
  134.             procurado[id]=1;
  135.             format(msg,sizeof(msg),"[INFO] Você está sendo procurado por %s",nick);
  136.             SendClientMessage(id,0x008000AA,msg);
  137.             format(msg,sizeof(msg),"[INFO] Você colocou o player %s na lista de procurados",pnome);
  138.             SendClientMessage(playerid,0x008000AA,msg);
  139.             return 1;
  140.         }
  141.         if(!strcmp(cmd,"/desprocurar",true))
  142.         {
  143.             new id;
  144.             tmp = strtok(cmdtext,idx);
  145.             if(!strlen(tmp)) return SendClientMessage(playerid,0xFF8080AA,"{FFFFFF}[X]{FF8080} Use: /desprocurar [id]");
  146.             id = strval(tmp);
  147.             if(IsPlayerConnected(id) == 0) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Jogador não conectado!");
  148.             if(playerid == id) return SendClientMessage(playerid,0xFF0000AA,"[ERRO] Você não pode desprocurar a sí mesmo.");
  149.  
  150.             new nick[MAX_PLAYER_NAME],pnome[MAX_PLAYER_NAME],msg[128];
  151.             GetPlayerName(playerid,nick,sizeof(nick));
  152.             GetPlayerName(id,pnome,sizeof(pnome));
  153.             procurado[id]=0;
  154.             format(msg,sizeof(msg),"[INFO] Você foi retirado da lista de procurados por %s",nick);
  155.             SendClientMessage(id,0x008000AA,msg);
  156.             format(msg,sizeof(msg),"[INFO] Você retirou o player %s da lista de procurados",pnome);
  157.             SendClientMessage(playerid,0x008000AA,msg);
  158.             return 1;
  159.         }
  160.         if(!strcmp(cmdtext,"/comandosP",true))
  161.         {
  162.             SendClientMessage(playerid,0x0080FFAA,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  163.             SendClientMessage(playerid,0xFFFFFFAA,"/presos || /pagarfianca || /procurar || /desprocurar");
  164.             SendClientMessage(playerid,0x0080FFAA,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  165.             return 1;
  166.         }
  167.         return 0;
  168.       }
  169.  
  170. public OnPlayerStateChange(playerid, newstate, oldstate)
  171. {
  172.     if(newstate == PLAYER_STATE_DRIVER && GetPlayerDrunkLevel(playerid) > 1999)
  173.     {
  174.         SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1);
  175.         SendClientMessage(playerid,0x8080FFAA,"[ERRO] Você não pode dirigir estando bêbado. E por isso está com +1 estrela de procurado.");
  176.         RemovePlayerFromVehicle(playerid);
  177.         if(GetPlayerWantedLevel(playerid)>=3)
  178.         {
  179.             SendClientMessage(playerid,0xFF0000AA,"[INFO] Fique aí na cadeia para pensar um pouco antes de dirigir alcoolizado.");
  180.             SetPlayerPos(playerid,2272.1833496094,1011.5466918945,79.92834472656);
  181.             SetPlayerInterior(playerid,0);
  182.             SetTimerEx("SoltarPreso",60*1000,false,"i",playerid);
  183.         }
  184.     }
  185.     return 1;
  186.  }
  187. forward SoltarPreso(playerid);
  188.  
  189. public SoltarPreso(playerid)
  190.     {
  191.         SetPlayerPos(playerid,2079.7571,1337.5437,10.8203);
  192.         SendClientMessage(playerid,0x00A600AA,"[INFO] Você foi solto, não dirija bêbado novamente!");
  193.         SetPlayerDrunkLevel(playerid,0);
  194.         SetPlayerWantedLevel(playerid,0);
  195.         return 1;
  196.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement