iPaulinho

[FilterScript] Restaurante Absolut

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