Advertisement
Chip7

[FS] FilterScript Restaurante Absolut

Jul 6th, 2012
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.80 KB | None | 0 0
  1. /*VISITE NOSSO SITE: http://www.sampknd.com/
  2.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  3. */
  4.    
  5.    
  6. #include <a_samp>
  7. #include <cpstream>
  8.  
  9. #if defined FILTERSCRIPT
  10. #define Comidas               1
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     print("|------------------------------------------|");
  15.     print("| Restaurante Absolut Iniciado com Sucesso.|");
  16.     print("|------------------------------------------|");
  17.     print("| Carregando Objetos Do Restaurante ...    |");
  18.     print("| Objetos Carregados Com Sucesso .         |");
  19.     print("|------------------------------------------|");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. #else
  29.  
  30. main()
  31. {
  32.     print("|---------------------------------------------|");
  33.     print("| Restaurante Absolut Desligado com Sucesso.  |");
  34.     print("|---------------------------------------------|");
  35.     print("| Descarregando Objetos Do Restaurante ...    |");
  36.     print("| Objetos Descarregados Com Sucesso .         |");
  37.     print("|---------------------------------------------|");
  38. }
  39.  
  40. #endif
  41.  
  42. public OnGameModeInit()
  43. {
  44.     AddStaticPickup(1318, 2, 1827.2057,-1393.1920,13.4259, 0);
  45.     AddStaticPickup(1241, 2, 450.6672,-84.7247,999.5547, 0);
  46.     AddStaticPickup(1318, 2, 459.4602,-88.7886,999.5547, 0);
  47.     Create3DTextLabel("{FFFFFF}Restaurante Absolut\nAperte 'ENTER' para usar",0xFFFFFF, 450.6672,-84.7247,999.5547, 10.0,0);
  48.     Create3DTextLabel("{FFFFFF}Restaurante Absolut\nAperte 'ENTER' para entrar",0xFFFFFF, 1827.2057,-1393.1920,13.4259, 10.0,0);
  49.     Create3DTextLabel("{FFFFFF}Restaurante Absolut\nAperte 'ENTER' para sair",0xFFFFFF, 459.4602,-88.7886,999.5547, 10.0,0);
  50.     CreateObject(18239,1822.19995117,-1399.90002441,12.39999962,0.00000000,0.00000000,180.00000000);
  51.     CreateObject(643,1830.50000000,-1402.90002441,12.89999962,0.00000000,0.00000000,0.00000000);
  52.     CreateObject(1432,1833.80004883,-1399.59997559,12.39999962,0.00000000,0.00000000,0.00000000);
  53.     CreateObject(1969,1834.80004883,-1404.80004883,12.89999962,0.00000000,0.00000000,0.00000000);
  54.     CreateObject(1969,1834.80004883,-1403.90002441,12.89999962,0.00000000,0.00000000,0.00000000);
  55.     CreateObject(1486,1833.90002441,-1399.50000000,13.19999981,0.00000000,0.00000000,0.00000000);
  56.     CreateObject(987,1817.80004883,-1406.50000000,12.30000019,0.00000000,0.00000000,176.00000000);
  57.     CreateObject(1412,1836.69995117,-1403.80004883,13.69999981,0.00000000,0.00000000,269.99996948);
  58.     CreateObject(1412,1836.69995117,-1398.59997559,13.69999981,0.00000000,0.00000000,269.99450684);
  59.     CreateObject(1412,1836.90002441,-1390.19995117,13.89999962,0.00000000,0.00000000,269.99450684);
  60.     CreateObject(3475,1811.09997559,-1387.50000000,15.00000000,0.00000000,0.00000000,90.00000000);
  61.     CreateObject(3475,1816.90002441,-1387.50000000,15.00000000,0.00000000,0.00000000,90.00000000);
  62.     CreateObject(3475,1822.80004883,-1387.50000000,15.00000000,0.00000000,0.00000000,90.00000000);
  63.     CreateObject(3475,1828.50000000,-1387.50000000,15.00000000,0.00000000,0.00000000,90.00000000);
  64.     CreateObject(3550,1833.80004883,-1388.09997559,13.30000019,0.00000000,2.00000000,269.99996948);
  65.     CreateObject(1594,1815.19995117,-1403.30004883,12.89999962,0.00000000,0.00000000,0.00000000);
  66.     CreateObject(1968,1815.19995117,-1399.30004883,12.89999962,0.00000000,0.00000000,0.00000000);
  67.     CreateObject(1432,1810.69995117,-1402.00000000,12.39999962,0.00000000,0.00000000,0.00000000);
  68.     CreateObject(1825,1810.90002441,-1395.30004883,12.39999962,0.00000000,0.00000000,0.00000000);
  69.     CreateObject(1970,1810.30004883,-1389.40002441,13.19999981,0.00000000,0.00000000,0.00000000);
  70.     CreateObject(1970,1814.09997559,-1389.40002441,13.19999981,0.00000000,0.00000000,0.00000000);
  71.     CreateObject(1970,1817.90002441,-1389.40002441,13.19999981,0.00000000,0.00000000,0.00000000);
  72.     return 1;
  73. }
  74. public OnPlayerConnect(playerid)
  75. {
  76.     SetPlayerMapIcon(playerid, 1,1827.2057,-1393.1920,13.4259, 50, 0xE6E6E6E6);
  77.     return 1;
  78. }
  79. public OnPlayerCommandText(playerid, cmdtext[])
  80. {
  81.     if(strcmp(cmdtext, "/entrar", true) == 0)
  82.     {
  83.             if (PlayerToPoint(3.0, playerid,1827.2057,-1393.1920,13.4259))
  84.             {
  85.                 SetPlayerPos(playerid, 457.304748,-88.428497,999.554687);
  86.                 GameTextForPlayer(playerid, "~w~Restaurante",5000,1);
  87.                 SetPlayerInterior(playerid,4);
  88.                 SetPlayerFacingAngle(playerid, 0);
  89.                 SetPlayerVirtualWorld(playerid, 0);
  90.             }
  91.             else if (PlayerToPoint(3.0, playerid, 457.304748,-88.428497,999.554687))
  92.             {
  93.                 SetPlayerPos(playerid, 1827.2057,-1393.1920,13.4259);
  94.                 SetPlayerInterior(playerid,0);
  95.                 SetPlayerFacingAngle(playerid, 0);
  96.                 SetPlayerVirtualWorld(playerid, 0);
  97.             }
  98.      }
  99.     if (strcmp(cmdtext, "/cardapio", true) == 0)
  100.     {
  101.       if(PlayerToPoint(10.0,playerid, 450.6672,-84.7247,999.5547))
  102.       {
  103.         ShowPlayerDialog(playerid, 6656 ,DIALOG_STYLE_LIST,"Cardápio Absolut","- Arroz Com Feijão \t{00EE76}R$150\n- Macarronada\t{00EE76}R$200\n- Marmitex\t{00EE76}R$120\n- Salmão Grelhado\t{00EE76}R$200\n- Bacalhau\t{00EE76}R$210\n- Bífe a Portuguesa\t{00EE76}R$250\n- Costeletas\t{00EE76}R$120\n- Lombetas de Porco\t{00EE76}R$170\n- Lasanha\t{00EE76}R$500\n\n","Aceitar","Cancelar");
  104.         return 1;
  105.       }
  106.     }
  107.     return 0;
  108. }
  109. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  110. {
  111.     if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  112.     {
  113.         OnPlayerCommandText(playerid,"/entrar");
  114.         OnPlayerCommandText(playerid,"/cardapio");
  115.     }
  116.     return 1;
  117. }
  118. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  119. {
  120.     if(dialogid == 6656)
  121.     {
  122.         new Float:health;
  123.         TogglePlayerControllable(playerid, 0);
  124.         if(!response) { return 1; }
  125.         switch(listitem)
  126.         {
  127.             case 0://Arroz
  128.             {
  129.                 if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$150 para comprar!");
  130.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  131.                 GivePlayerMoney(playerid, 150);
  132.                 TogglePlayerControllable(playerid, 1);
  133.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Arroz Com Feijão'");
  134.                 SetPlayerHealth(playerid, health + 10.0);
  135.             }
  136.             case 1://Macarronada
  137.             {
  138.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$200 para comprar!");
  139.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  140.                 GivePlayerMoney(playerid, 200);
  141.                 TogglePlayerControllable(playerid, 1);
  142.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Macarronada'");
  143.                 SetPlayerHealth(playerid, health + 10.0);
  144.             }
  145.             case 2://Marmitex
  146.             {
  147.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$120 para comprar!");
  148.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  149.                 GivePlayerMoney(playerid, 120);
  150.                 TogglePlayerControllable(playerid, 1);
  151.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Marmitéx'");
  152.                 SetPlayerHealth(playerid, health + 20.0);
  153.             }
  154.             case 3://Salmão Grelhado
  155.             {
  156.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$200 para comprar!");
  157.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  158.                 GivePlayerMoney(playerid, 200);
  159.                 TogglePlayerControllable(playerid, 1);
  160.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Salmão Grelhado'");
  161.                 SetPlayerHealth(playerid, health + 50.0);
  162.             }
  163.             case 4://Bacalhau
  164.             {
  165.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$210 para comprar!");
  166.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  167.                 GivePlayerMoney(playerid, 210);
  168.                 TogglePlayerControllable(playerid, 1);
  169.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Bacalhau'");
  170.                 SetPlayerHealth(playerid, health + 70.0);
  171.             }
  172.             case 5://Bife à Portuguesa
  173.             {
  174.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$250 para comprar!");
  175.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  176.                 GivePlayerMoney(playerid, 250);
  177.                 TogglePlayerControllable(playerid, 1);
  178.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Bife à Portuguesa'");
  179.                 SetPlayerHealth(playerid, health + 60.0);
  180.             }
  181.             case 6://Costeletas
  182.             {
  183.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$120 para comprar!");
  184.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  185.                 GivePlayerMoney(playerid, 120);
  186.                 TogglePlayerControllable(playerid, 1);
  187.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Costeletas'");
  188.                 SetPlayerHealth(playerid, health + 70.0);
  189.             }
  190.             case 7://Lombeta de Porco
  191.             {
  192.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$170 para comprar!");
  193.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  194.                 GivePlayerMoney(playerid, 170);
  195.                 TogglePlayerControllable(playerid, 1);
  196.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Lombeta de Porco'");
  197.                 SetPlayerHealth(playerid, health + 80.0);
  198.             }
  199.             case 8://Lasanha
  200.             {
  201.                 if(GetPlayerMoney(playerid) < 120) return SendClientMessage(playerid, 0xF68E00F6,"{FF0000}[ERRO] {FFFFFF}Você não tem R$500 para comprar!");
  202.                 ApplyAnimation(playerid,"FOOD","EAT_Pizza",4.1,0,1,1,1,1);
  203.                 GivePlayerMoney(playerid, 500);
  204.                 TogglePlayerControllable(playerid, 1);
  205.                 SendClientMessage(playerid, 0xFFFFFF ,"[INFO] Você acabou de comprar um prato 'Lasanha'");
  206.                 SetPlayerHealth(playerid, health + 100.0);
  207.             }
  208.         }
  209.     }
  210.     return 1;
  211. }
  212. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  213. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  214. {
  215.     if(IsPlayerConnected(playerid))
  216.     {
  217.         new Float:oldposx, Float:oldposy, Float:oldposz;
  218.         new Float:tempposx, Float:tempposy, Float:tempposz;
  219.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  220.         tempposx = (oldposx -x);
  221.         tempposy = (oldposy -y);
  222.         tempposz = (oldposz -z);
  223.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  224.         {
  225.             return 1;
  226.         }
  227.     }
  228.     return 0;
  229. }
  230. /* FilterScript criado totalmente do 0 por Mateus Menezes a pedidos do servidor BRG.
  231.    Nenhum BUG encontrado, caso o encontre o mesmo entre em contato mateus.qzs@hotmail.com.
  232.    Não retire os créditos de autoria original do FilterScript disponíveis para uso!*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement