Advertisement
Guest User

Sistema de Props - By Rhayziin

a guest
Apr 25th, 2015
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 50.46 KB | None | 0 0
  1. #include <a_samp>
  2. #include <DOF2>
  3. #include <zcmd>
  4. #include <streamer>
  5.  
  6. #define FILTERSCRIPT
  7.  
  8. //----> Configurações
  9. #define FOLDER_PROPRIEDADES "Propriedades/Prop_%d.txt" //Local onde as propriedades serão salvas.
  10.  
  11. #define MAX_PROPRIEDADES_SERVIDOR   150 //Número máximo de propriedades no servidor.
  12. #define MAX_PROPRIEDADES_POR_PLAYER 4   //Máximo de propriedades que um jogador pode comprar/obter/possuir.
  13.  
  14. #define ICONE_PROP_COMPRADA     43  //ID do icone (MapIcon) quando a propriedade está comprada.
  15. #define ICONE_PROP_NORMAL       44  //ID do icone (MapIcon) quando a propriedade não está comprada.
  16.  
  17. #define PICKUP_PROP_COMPRADA    1272 //ID da Pickup quando a propriedade está comprada.
  18. #define PICKUP_PROP_NORMAL      1273 //ID da Pickup quando a propriedade não está comprada.
  19.  
  20. #define MINUTOS_GANHOS_PROP     30*60000    //Minutos para o jogador ganhar a 'recompensa' da propriedade, ou seja, 10% do valor original. Modifique apenas o 30 (meia hora)
  21. #define DIAS_AUTO_VENDER        3*86400000  //Dias para a propriedade ser auto-vendida, ou seja, se o jogador não entrar no servidor durante os dias definidos (3), a propriedade é automaticamente vendida.
  22.  
  23. //----> Dialogs
  24. #define DIALOG_PROP_INFOS       (940)
  25. #define DIALOG_PROP_AJUSTES     (941)
  26. #define DIALOG_PROP_NOME        (942)
  27. #define DIALOG_PROP_VENDER      (943)
  28.  
  29. #define DIALOG_PROP_ADMIN_HOME  (944)
  30. #define DIALOG_PROP_NEW_NOME    (945)
  31. #define DIALOG_PROP_NEW_PRECO   (946)
  32. #define DIALOG_PROP_RESET_ALL   (947)
  33. #define DIALOG_PROP_DELETE_ALL  (948)
  34. #define DIALOG_PROP_SET_OWNER   (949)
  35. #define DIALOG_PROP_SET_PRICE   (950)
  36. #define DIALOG_PROP_LIST        (951)
  37.  
  38. #define DIALOG_PROP_INTERIORES  (952)
  39. #define DIALOG_PROP_EXTORCAO    (953)
  40.  
  41. enum _PropInfo
  42. {
  43.     Prop_ID,
  44.     Prop_Nome[64],
  45.     Prop_Dono[MAX_PLAYER_NAME],
  46.     Float:Prop_X,
  47.     Float:Prop_Y,
  48.     Float:Prop_Z,
  49.     bool:Prop_Comprada,
  50.     bool:Prop_IntActived,
  51.     Prop_Valor,
  52.     Prop_Ganhando,
  53.     Prop_InteriorID,
  54.     Prop_Extorcao,
  55.     Prop_AutoSell,
  56.  
  57.     //NÃO SALVÁVIES
  58.     Prop_Pickup,
  59.     Prop_MapIcon,
  60.     Text3D:PropText
  61. }
  62.  
  63. enum _PropIntInfo
  64. {
  65.     pIntName[80],
  66.     pID_Int,
  67.     Float:pPositions[4]
  68. }
  69.  
  70. new const _GetIntProps[][_PropIntInfo] = {
  71.     {{"24/7 - 1"}, {17}, {-25.63,-187.06,1003.54,0.97}},
  72.     {{"24/7 - 2"}, {10}, {5.92,-30.63,1003.54,357.19}},
  73.     {{"24/7 - 3"}, {18}, {-30.86,-90.48,1003.54,357.81}},
  74.     {{"24/7 - 4"}, {16}, {-25.89,-139.36,1003.54,2.99}},
  75.     {{"24/7 - 5"}, {4}, {-27.31,-29.27,1003.55,2.99}},
  76.     {{"24/7 - 6"}, {6}, {-27.30,-56.22,1003.54,359.52}},
  77.     {{"Shamal (Nave)"}, {1}, {1.44,23.43,1199.59,354.32}},
  78.     {{"Andromada (Avião)"}, {9}, {315.66,986.72,1958.51,357.79}},
  79.     {{"Loja de Armas - 1"}, {1}, {285.95,-40.73,1001.51,296.66}},
  80.     {{"Loja de Armas - 2"}, {4}, {285.57,-85.25,1001.51,359.96}},
  81.     {{"Loja de Armas - 3"}, {6}, {296.70,-111.21,1001.51,2.80}},
  82.     {{"Loja de Armas - 4"}, {7}, {315.60,-142.50,999.60,4.34}},
  83.     {{"Loja de Armas - 5"}, {6}, {316.52,-167.70,999.59,4.34}},
  84.     {{"Loja de Armas - Cabines"}, {7}, {303.55,-142.13,1004.06,88.01}},
  85.     {{"Loja de Armas - Pista"}, {7}, {298.50,-141.64,1004.05,88.01}},
  86.     {{"Sala de orçamento do motel"}, {12}, {446.56,507.34,1001.41,355.81}},
  87.     {{"Motel Jefferson"}, {15}, {2215.57,-1150.24,1025.79,264.95}},
  88.     {{"Loja de Apostas - Loteria"}, {3}, {833.48,7.50,1004.17,87.77}},
  89.     {{"Sex Shop"}, {3}, {-99.98,-24.04,1000.71,3.31}},
  90.     {{"Fábrica de Carne"}, {1}, {964.39,2108.34,1011.03,90.08}},
  91.     {{"Loja do Zero"}, {6}, {-2239.44,137.10,1035.41,269.43}},
  92.     {{"Porão de Caligula"}, {1}, {2170.55,1618.65,999.97,271.16}},
  93.     {{"Escritório do Woozie"}, {1}, {-2158.66,641.91,1052.37,179.38}},
  94.     {{"Binco (Loja de Roupas)"}, {15}, {207.73,-110.57,1005.13,3.60}},
  95.     {{"Didier Sachs (Loja de Roupas)"}, {14}, {204.33,-166.69,1000.52,3.60}},
  96.     {{"Prolaps (Loja de Roupas)"}, {3}, {207.05,-138.80,1003.50,3.60}},
  97.     {{"Suburban (Loja de Roupas)"}, {1}, {203.77,-48.49,1001.80,1.50}},
  98.     {{"Victim (Loja de Roupas)"}, {5}, {226.49,-7.99,1002.21,84.39}},
  99.     {{"Zip (Loja de Roupas)"}, {18}, {161.52,-95.08,1001.80,357.62}},
  100.     {{"Alhambra"}, {17}, {493.39,-22.72,1000.67,357.62}},
  101.     {{"Bar"}, {11}, {501.98,-69.15,998.75,187.02}},
  102.     {{"Bar Lil' pobre"}, {18}, {-228.54,1401.24,27.76,272.87}},
  103.     {{"Lanchonete do Jay"}, {4}, {458.89,-88.63,999.55,90.99}},
  104.     {{"Mundo de Coq"}, {1}, {446.50,-6.78,1000.73,173.52}},
  105.     {{"Burger shot"}, {10}, {363.79,-74.42,1001.50,314.96}},
  106.     {{"Clucki'n Bell"}, {9}, {365.07,-10.41,1001.85,356.17}},
  107.     {{"Well Stacked Pizza"}, {5}, {372.35,-132.67,1001.49,4.15}},
  108.     {{"Rusty Browns Rosquinhas"}, {17}, {377.13,-192.59,1000.63,0.08}},
  109.     {{"Quarto da Denise"}, {1}, {244.26,304.89,999.14,271.09}},
  110.     {{"Quarto da Katie"}, {2}, {267.77,305.10,999.14,264.03}},
  111.     {{"Quarto da Helena"}, {3}, {292.17,309.97,999.14,93.12}},
  112.     {{"Quarto da Michelle"}, {4}, {302.55,301.86,999.14,2.44}},
  113.     {{"Quarto da Barbara"}, {5}, {322.16,302.79,999.14,5.41}},
  114.     {{"Quarto da Millie"}, {6}, {344.85,305.12,999.14,272.39}},
  115.     {{"Represa Sherman"}, {17}, {-959.53,1952.08,9.00,179.16}},
  116.     {{"Prefeitura LS"}, {3}, {388.89,173.70,1008.38,92.83}},
  117.     {{"Area 51"}, {0}, {223.01,1872.59,13.73,267.50}},
  118.     {{"Academia LS"}, {5}, {772.40,-4.40,1000.72,1.96}},
  119.     {{"Academia SF"}, {6}, {774.21,-48.92,1000.58,1.96}},
  120.     {{"Academia LV"}, {7}, {773.95,-76.71,1000.65,358.51}},
  121.     {{"Casa do CJ"}, {3}, {2496.21,-1693.39,1014.74,179.43}},
  122.     {{"Mansão do Madd Dogg"}, {5}, {1263.19,-785.38,1091.90,272.80}},
  123.     {{"Casa do Ryder"}, {2}, {2455.36,-1705.34,1013.50,24.01}},
  124.     {{"Casa do Sweet"}, {1}, {2525.97,-1679.54,1015.49,270.27}},
  125.     {{"Fábrica de Crack"}, {2}, {2543.44,-1304.13,1025.07,179.74}},
  126.     {{"Rancho Big Spread"}, {3}, {1212.09,-27.03,1000.95,181.62}},
  127.     {{"Fanny Batters"}, {6}, {759.66,1442.55,1102.70,177.38}},
  128.     {{"Clube de Strip"}, {2}, {1204.76,-13.07,1000.92,2.56}},
  129.     {{"Clube de Strip (Sala Particular)"}, {2}, {1204.80,13.89,1000.92,2.56}},
  130.     {{"Bordel"}, {3}, {940.98,-18.30,1000.92,5.23}},
  131.     {{"Bordel dos Trigres"}, {3}, {964.93,-53.08,1001.12,90.29}},
  132.     {{"Cúpula do Prazer"}, {3}, {-2636.23,1406.27,906.46,89.04}},
  133.     {{"Liberty City (Fora)"}, {1}, {-729.27,503.08,1371.97,89.04}},
  134.     {{"Liberty City (Dentro)"}, {1}, {-795.01,491.45,1376.19,359.76}},
  135.     {{"Casa da Gangue"}, {5}, {2351.59,-1180.99,1027.97,87.79}},
  136.     {{"Casa de Crack"}, {5}, {318.73,1115.31,1083.88,357.55}},
  137.     {{"Armazém - 1"}, {1}, {1414.43,4.47,1000.92,125.05}},
  138.     {{"Armazém - 2"}, {18}, {1302.51,-1.78,1001.02,125.05}},
  139.     {{"Garagem do Sweet"}, {0}, {2526.54,-1673.45,14.85,96.20}},
  140.     {{"Casa Luxuosa"}, {12}, {2323.92,-1148.09,1050.71,359.72}},
  141.     {{"Batalha de Controle Remoto"}, {10}, {-973.50,1061.38,1345.67,90.58}},
  142.     {{"Barbearia - 1"}, {2}, {411.54,-22.33,1001.80,355.33}},
  143.     {{"Barbearia - 2"}, {3}, {418.65,-82.63,1001.80,355.33}},
  144.     {{"Barbearia - 3"}, {12}, {412.02,-52.64,1001.89,355.33}},
  145.     {{"Loja de Tatuagens - 1"}, {16}, {-204.43,-26.45,1002.27,355.33}},
  146.     {{"Loja de Tatuagens - 2"}, {17}, {-204.43,-8.46,1002.27,355.33}},
  147.     {{"Loja de Tatuagens - 3"}, {3}, {-204.43,-43.65,1002.27,355.33}},
  148.     {{"DP LS"}, {6}, {246.78,63.90,1003.64,355.33}},
  149.     {{"DP SF"}, {10}, {246.37,109.24,1003.21,355.33}},
  150.     {{"DP LV"}, {3}, {288.74,169.35,1007.17,355.33}},
  151.     {{"Auto Escola"}, {3}, {-2026.99,-104.49,1035.17,177.02}},
  152.     {{"Auto Escola 2"}, {3}, {1494.37,1304.58,1093.28,357.96}},
  153.     {{"Pista de Corrida"}, {7}, {-1398.06,-217.02,1051.11,177.02}},
  154.     {{"Pista de Terra"}, {15}, {-1423.99,932.84,1036.40,354.34}},
  155.     {{"Pista de Rally"}, {4}, {-1430.87,-660.88,1053.01,32.23}},
  156.     {{"Kickstart"}, {14}, {-1464.29,1557.34,1052.53,357.77}},
  157.     {{"Estádio Vice"}, {1}, {-1401.82,107.05,1032.27,357.77}},
  158.     {{"Garagem SF"}, {0}, {-1790.37,1433.84,7.18,354.90}},
  159.     {{"Garagem LS"}, {0}, {1643.30,-1517.71,13.56,358.01}},
  160.     {{"Loja de Bombas SF"}, {0}, {-1691.78,1035.54,45.21,271.21}},
  161.     {{"Armazém Blueberry"}, {0}, {64.96,-298.32,1.57,181.94}},
  162.     {{"Armazém LV"}, {0}, {1058.92,2087.63,10.82,278.73}},
  163.     {{"Armazém LV (Parte oculta)"}, {0}, {1059.18,2148.93,10.82,278.73}},
  164.     {{"Banco"}, {0}, {2306.19,-15.83,26.74,273.67}},
  165.     {{"Shopping LS"}, {18}, {1727.18,-1639.12,20.22,175.60}}
  166. };
  167.  
  168. new PropInfo[MAX_PROPRIEDADES_SERVIDOR][_PropInfo];
  169. new Propriedades_Criadas, RhayID[MAX_PLAYERS];
  170.  
  171. new Prop_List[MAX_PLAYERS][11], TimerProp[MAX_PLAYERS], IntMaxValue[MAX_PLAYERS][3], TimerAutoSellProp;
  172.  
  173. public OnFilterScriptInit()
  174. {
  175.     LoadAll_Property();
  176.     TimerAutoSellProp = SetTimer("FuncAutoSell", 3600000, true);
  177.     return 1;
  178. }
  179.  
  180. public OnFilterScriptExit()
  181. {
  182.     KillTimer(TimerAutoSellProp);
  183.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  184.     {
  185.         if(DOF2_FileExists(pProp(i)))
  186.         {
  187.             DestroyDynamicPickup(PropInfo[i][Prop_Pickup]);
  188.             DestroyDynamicMapIcon(PropInfo[i][Prop_MapIcon]);
  189.             DestroyDynamic3DTextLabel(PropInfo[i][PropText]);
  190.         }
  191.     }
  192.     DOF2_Exit();
  193.     return 1;
  194. }
  195.  
  196. public OnPlayerConnect(playerid)
  197. {
  198.     SetPVarInt(playerid, "EnterPropID", -1);
  199.     Prop_List[playerid][10] = -1;
  200.     TimerProp[playerid] = SetTimerEx("Propriedade_Ganhos", MINUTOS_GANHOS_PROP, true, "i", playerid);
  201.     return 1;
  202. }
  203.  
  204. public OnPlayerDisconnect(playerid, reason)
  205. {
  206.     KillTimer(TimerProp[playerid]);
  207.     DeletePVar(playerid, "EnterPropID");
  208.     DeletePVar(playerid, "PropTemp_Nome");
  209.     DeletePVar(playerid, "PropTemp_IntID");
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerEnterCheckpoint(playerid)
  214. {
  215.     DisablePlayerCheckpoint(playerid);
  216.     return 1;
  217. }
  218.  
  219. public OnPlayerSpawn(playerid) return SetPVarInt(playerid, "EnterPropID", -1);
  220. public OnPlayerDeath(playerid, killerid, reason) return SetPVarInt(playerid, "EnterPropID", -1);
  221.  
  222. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  223. {
  224.     new StringGameTextFP[20];
  225.     if(newkeys == KEY_SECONDARY_ATTACK && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  226.     {
  227.         if(GetPVarInt(playerid, "EnterPropID") >= 0)
  228.         {
  229.             SetPlayerPos(playerid, DOF2_GetFloat(pProp(GetPVarInt(playerid, "EnterPropID")), "Prop_X"), DOF2_GetFloat(pProp(GetPVarInt(playerid, "EnterPropID")), "Prop_Y"), DOF2_GetFloat(pProp(GetPVarInt(playerid, "EnterPropID")), "Prop_Z"));
  230.             SetPlayerInterior(playerid, 0);
  231.             SetPVarInt(playerid, "EnterPropID", -1);
  232.             return 1;
  233.         }
  234.  
  235.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  236.         if(RhayID[playerid] == -666) return 1;
  237.         if(PropInfo[RhayID[playerid]][Prop_IntActived])
  238.         {
  239.             if(GetPlayerMoney(playerid) < PropInfo[RhayID[playerid]][Prop_Extorcao] && strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid))) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem dinheiro suficiente para entrar nesta propriedade.");
  240.  
  241.             SetPlayerInterior(playerid, _GetIntProps[PropInfo[RhayID[playerid]][Prop_InteriorID]][pID_Int]);
  242.             SetPlayerPos(playerid, _GetIntProps[PropInfo[RhayID[playerid]][Prop_InteriorID]][pPositions][0], _GetIntProps[PropInfo[RhayID[playerid]][Prop_InteriorID]][pPositions][1], _GetIntProps[PropInfo[RhayID[playerid]][Prop_InteriorID]][pPositions][2]);
  243.             SetPlayerFacingAngle(playerid,  _GetIntProps[PropInfo[RhayID[playerid]][Prop_InteriorID]][pPositions][3]);
  244.  
  245.             SetPVarInt(playerid, "EnterPropID", RhayID[playerid]);
  246.  
  247.             SendClientMessage(playerid, -1, "{00FF00}[INFO]: Pressione '{FF0080}F{00FF00}' ou '{FF0080}Enter{00FF00}' para sair da propriedade.");
  248.  
  249.             if(PropInfo[RhayID[playerid]][Prop_Extorcao] > 0 && strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid)))
  250.             {
  251.                 format(StringGameTextFP, sizeof(StringGameTextFP), "~r~-R$ %d", PropInfo[RhayID[playerid]][Prop_Extorcao]);
  252.                 GameTextForPlayer(playerid, StringGameTextFP, 1000, 1);
  253.                 GivePlayerMoney(playerid, -PropInfo[RhayID[playerid]][Prop_Extorcao]);
  254.             }
  255.         }
  256.         else
  257.         {
  258.             if(!IsPlayerAdmin(playerid)) ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_INFOS);
  259.             else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  260.         }
  261.     }
  262.  
  263.     if(newkeys == KEY_YES && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  264.     {
  265.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  266.         if(RhayID[playerid] == -666) return 1;
  267.  
  268.         if(PropInfo[RhayID[playerid]][Prop_IntActived])
  269.         {
  270.             if(!IsPlayerAdmin(playerid)) ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_INFOS);
  271.             else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  272.         }
  273.     }
  274.     return 1;
  275. }
  276.  
  277. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  278. {
  279.     if(dialogid == DIALOG_PROP_INFOS)
  280.     {
  281.         if(response)
  282.         {
  283.             RhayID[playerid] = IsPlayerNearProperty(playerid);
  284.             if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  285.  
  286.             if(PropInfo[RhayID[playerid]][Prop_Comprada])
  287.             {
  288.                 if(!strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid)))
  289.                     return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_AJUSTES);
  290.             }
  291.             else
  292.             {
  293.                 if(GetPlayerMoney(playerid) < PropInfo[RhayID[playerid]][Prop_Valor]) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem dinheiro suficiente para comprar esta propriedade!");
  294.                 if(ContarMyProps(playerid) >= MAX_PROPRIEDADES_POR_PLAYER) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você já tem 4 propriedades, e não poderá comprar nenhuma.");
  295.  
  296.                 DOF2_SetString(pProp(RhayID[playerid]), "Prop_Dono", pNamer(playerid));
  297.                 DOF2_SetBool(pProp(RhayID[playerid]), "Prop_Comprada", true);
  298.                 DOF2_SetInt(pProp(RhayID[playerid]), "Prop_AutoSell", DIAS_AUTO_VENDER);
  299.  
  300.                 GivePlayerMoney(playerid, -PropInfo[RhayID[playerid]][Prop_Valor]);
  301.  
  302.                 CarregarProp(RhayID[playerid]);
  303.             }
  304.         }
  305.         return 1;
  306.     }
  307.     else if(dialogid == DIALOG_PROP_AJUSTES)
  308.     {
  309.         if(response)
  310.         {
  311.             if(!strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid)))
  312.             {
  313.                 RhayID[playerid] = IsPlayerNearProperty(playerid);
  314.                 if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  315.  
  316.                 switch(listitem)
  317.                 {
  318.                     case 0: ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NOME);
  319.                     case 1: ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_VENDER);
  320.                 }
  321.             }
  322.             else SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não é o dono desta propriedade!");
  323.         }
  324.         return 1;
  325.     }
  326.     else if(dialogid == DIALOG_PROP_NOME)
  327.     {
  328.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  329.         if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  330.  
  331.         if(response)
  332.         {
  333.             if(!strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid)) || IsPlayerAdmin(playerid))
  334.             {
  335.                 if(strlen(inputtext) > 64 || !strlen(inputtext)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NOME);
  336.                 DOF2_SetString(pProp(RhayID[playerid]), "Prop_Nome", inputtext);
  337.                 CarregarProp(RhayID[playerid]);
  338.  
  339.                 if(IsPlayerAdmin(playerid)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  340.             }
  341.             else SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não é o dono desta propriedade!");
  342.         }
  343.         else
  344.         {
  345.             if(IsPlayerAdmin(playerid)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  346.  
  347.             ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_AJUSTES);
  348.         }
  349.         return 1;
  350.     }
  351.     else if(dialogid == DIALOG_PROP_VENDER)
  352.     {
  353.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  354.         if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  355.  
  356.         if(response)
  357.         {
  358.             if(!strcmp(PropInfo[RhayID[playerid]][Prop_Dono], pNamer(playerid)))
  359.             {
  360.                 DOF2_SetString(pProp(RhayID[playerid]), "Prop_Dono", "Ninguém");
  361.                 DOF2_SetBool(pProp(RhayID[playerid]), "Prop_Comprada", false);
  362.                 DOF2_SetInt(pProp(RhayID[playerid]), "Prop_AutoSell", DIAS_AUTO_VENDER);
  363.  
  364.                 GivePlayerMoney(playerid, PropInfo[RhayID[playerid]][Prop_Valor]/2);
  365.  
  366.                 CarregarProp(RhayID[playerid]);
  367.             }
  368.             else SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não é o dono desta propriedade!");
  369.         }
  370.         else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_AJUSTES);
  371.         return 1;
  372.     }
  373.     else if(dialogid == DIALOG_PROP_ADMIN_HOME)
  374.     {
  375.         if(response)
  376.         {
  377.             RhayID[playerid] = IsPlayerNearProperty(playerid);
  378.             if(!IsPlayerAdmin(playerid)) return 1;
  379.  
  380.             switch(listitem)
  381.             {
  382.                 case 0: //Criar uma nova propriedade
  383.                 {
  384.                     if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  385.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NEW_NOME);
  386.                 }
  387.                 case 1: //Resetar todas as propriedades
  388.                 {
  389.                     if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  390.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_RESET_ALL);
  391.                 }
  392.                 case 2: //Excluir todas as propriedades
  393.                 {
  394.                     if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  395.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_DELETE_ALL);
  396.                 }
  397.                 case 3: //Excluir Propriedade (Atual)
  398.                 {
  399.                     if(!IsPlayerAdmin(playerid)) return 1;
  400.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  401.                     Deletar_Propriedade(RhayID[playerid]);
  402.                     SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Propriedade removida com sucesso.");
  403.                 }
  404.                 case 4: //Resetar Propriedade (Atual)
  405.                 {
  406.                     if(!IsPlayerAdmin(playerid)) return 1;
  407.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  408.                     DOF2_SetString(pProp(RhayID[playerid]), "Prop_Dono", "Ninguém");
  409.                     DOF2_SetBool(pProp(RhayID[playerid]), "Prop_Comprada", false);
  410.                     DOF2_SetBool(pProp(RhayID[playerid]), "Prop_IntActived", false);
  411.                     DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Extorcao", 0);
  412.                     DOF2_SetInt(pProp(RhayID[playerid]), "Prop_InteriorID", -1);
  413.                     DOF2_SetInt(pProp(RhayID[playerid]), "Prop_AutoSell", DIAS_AUTO_VENDER);
  414.                     CarregarProp(RhayID[playerid]);
  415.                     SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Propriedade resetada com sucesso.");
  416.                 }
  417.                 case 5: //Nome da Propriedade (Atual)
  418.                 {
  419.                     if(!IsPlayerAdmin(playerid)) return 1;
  420.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  421.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NOME);
  422.                 }
  423.                 case 6: //Dono da Propriedade (Atual)
  424.                 {
  425.                     if(!IsPlayerAdmin(playerid)) return 1;
  426.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  427.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_OWNER);
  428.                 }
  429.                 case 7: //Preço da Propriedade (Atual)
  430.                 {
  431.                     if(!IsPlayerAdmin(playerid)) return 1;
  432.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade.");
  433.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_PRICE);
  434.                 }
  435.                 case 8: //Definir ou Modificar interior da Propriedade (Atual)
  436.                 {
  437.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade!");
  438.                     IntMaxValue[playerid][2] = 0;
  439.                     CallViewListInts(playerid);
  440.                 }
  441.                 case 9: //Desabilitar Interior (Atual)
  442.                 {
  443.                     if(RhayID[playerid] == -666) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não está perto de nenhuma propriedade!");
  444.                     DOF2_SetBool(pProp(RhayID[playerid]), "Prop_IntActived", false);
  445.                     DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Extorcao", 0);
  446.                     DOF2_SetInt(pProp(RhayID[playerid]), "Prop_InteriorID", -1);
  447.                     CarregarProp(RhayID[playerid]);
  448.                     SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Interior desabilitado com sucesso.");
  449.                 }
  450.             }
  451.         }
  452.         return 1;
  453.     }
  454.     else if(dialogid == DIALOG_PROP_NEW_NOME)
  455.     {
  456.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  457.         if(!IsPlayerAdmin(playerid)) return 1;
  458.         if(response)
  459.         {
  460.             if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  461.             if(strlen(inputtext) > 64) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NEW_NOME);
  462.             if(!strlen(inputtext)) SetPVarString(playerid, "PropTemp_Nome", "Sem nome");
  463.             else SetPVarString(playerid, "PropTemp_Nome", inputtext);
  464.             ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NEW_PRECO);
  465.         }
  466.         return 1;
  467.     }
  468.     else if(dialogid == DIALOG_PROP_NEW_PRECO)
  469.     {
  470.         new StringPVar[65], Float:PVarPosition[3];
  471.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  472.         if(!IsPlayerAdmin(playerid)) return 1;
  473.         if(response)
  474.         {
  475.             if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  476.             if(strval(inputtext) < 100 || strval(inputtext) > 10000000 || !strlen(inputtext)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_NEW_PRECO);
  477.             GetPlayerPos(playerid, PVarPosition[0], PVarPosition[1], PVarPosition[2]);
  478.             GetPVarString(playerid, "PropTemp_Nome", StringPVar, sizeof(StringPVar));
  479.             Criar_Propriedade(StringPVar, "Ninguém", PVarPosition[0], PVarPosition[1], PVarPosition[2], false, strval(inputtext));
  480.         }
  481.         return 1;
  482.     }
  483.     else if(dialogid == DIALOG_PROP_RESET_ALL)
  484.     {
  485.         if(!IsPlayerAdmin(playerid)) return 1;
  486.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  487.         if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  488.         if(response)
  489.         {
  490.             ResetAll_Property();
  491.             SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Todas as propriedades foram resetadas com sucesso.");
  492.         }
  493.         else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  494.         return 1;
  495.     }
  496.     else if(dialogid == DIALOG_PROP_DELETE_ALL)
  497.     {
  498.         if(!IsPlayerAdmin(playerid)) return 1;
  499.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  500.         if(RhayID[playerid] != -666) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  501.         if(response)
  502.         {
  503.             ResetAll_Property(true); //Remover
  504.             SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Todas as propriedades foram excluídas com sucesso.");
  505.         }
  506.         else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  507.         return 1;
  508.     }
  509.     else if(dialogid == DIALOG_PROP_SET_OWNER)
  510.     {
  511.         new StringOwnerDialog[128];
  512.         if(!IsPlayerAdmin(playerid)) return 1;
  513.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  514.         if(response)
  515.         {
  516.             if(strval(inputtext) < 0 || strval(inputtext) > MAX_PLAYERS || !strlen(inputtext)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_OWNER);
  517.             if(!IsPlayerConnected(strval(inputtext)))
  518.             {
  519.                 SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado.");
  520.                 ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_OWNER);
  521.                 return 1;
  522.             }
  523.             if(ContarMyProps(strval(inputtext)) >= MAX_PROPRIEDADES_POR_PLAYER)
  524.             {
  525.                 format(StringOwnerDialog, sizeof(StringOwnerDialog), "[ERRO]: O jogador {FFFF00}%s {FF0000}já possui {FF8000}%d {FF0000}propriedades.", pNamer(strval(inputtext)), MAX_PROPRIEDADES_POR_PLAYER);
  526.                 SendClientMessage(playerid, 0xFF0000FF, StringOwnerDialog);
  527.                 ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_OWNER);
  528.                 return 1;
  529.             }
  530.  
  531.             DOF2_SetString(pProp(RhayID[playerid]), "Prop_Dono", pNamer(strval(inputtext)));
  532.             DOF2_SetBool(pProp(RhayID[playerid]), "Prop_Comprada", true);
  533.             DOF2_SetInt(pProp(RhayID[playerid]), "Prop_AutoSell", DIAS_AUTO_VENDER);
  534.             CarregarProp(RhayID[playerid]);
  535.  
  536.             format(StringOwnerDialog, sizeof(StringOwnerDialog), "{FF8000}[!] O administrador {FFFF00}%s {FF8000}te deu a propriedade de {00FFFF}ID %d{FF8000}, aproveite!", pNamer(playerid), RhayID[playerid]);
  537.             SendClientMessage(strval(inputtext), 0xFF0000FF, StringOwnerDialog);
  538.         }
  539.         else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  540.         return 1;
  541.     }
  542.     else if(dialogid == DIALOG_PROP_SET_PRICE)
  543.     {
  544.         if(response)
  545.         {
  546.             if(!IsPlayerAdmin(playerid)) return 1;
  547.             RhayID[playerid] = IsPlayerNearProperty(playerid);
  548.             if(strval(inputtext) < 100 || strval(inputtext) > 10000000 || !strlen(inputtext)) return ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_SET_PRICE);
  549.             DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Valor", strval(inputtext));
  550.             DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Ganhando", strval(inputtext) / 10);
  551.             CarregarProp(RhayID[playerid]);
  552.             SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Preço da propriedade redefinido com sucesso.");
  553.         }
  554.         else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  555.         return 1;
  556.     }
  557.     else if(dialogid == DIALOG_PROP_LIST)
  558.     {
  559.         if(response)
  560.         {
  561.             switch(listitem)
  562.             {
  563.                 case 0 .. 9:
  564.                 {
  565.                     if(DOF2_FileExists(pProp(Prop_List[playerid][listitem])))
  566.                     {
  567.                         if(IsPlayerAdmin(playerid)) SetPlayerPos(playerid, DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_X"), DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_Y"), DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_Z"));
  568.                         else SetPlayerCheckpoint(playerid, DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_X"), DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_Y"), DOF2_GetFloat(pProp(Prop_List[playerid][listitem]), "Prop_Z"), 3.0);
  569.                     }
  570.                 }
  571.                 case 10:
  572.                 {
  573.                     if(Prop_List[playerid][10] > 0) ViewListProps(playerid);
  574.                 }
  575.             }
  576.         }
  577.         return 1;
  578.     }
  579.     else if(dialogid == DIALOG_PROP_INTERIORES)
  580.     {
  581.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  582.         if(RhayID[playerid] == -666 || !IsPlayerAdmin(playerid)) return 1;
  583.         if(response)
  584.         {
  585.             switch(listitem)
  586.             {
  587.                 case 0 .. 9:
  588.                 {
  589.                     SetPVarInt(playerid, "PropTemp_IntID", IntMaxValue[playerid][0]+listitem);
  590.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_EXTORCAO);
  591.                 }
  592.                 case 10:
  593.                 {
  594.                     IntMaxValue[playerid][2]++; //Next
  595.                     CallViewListInts(playerid);
  596.                 }
  597.             }
  598.         }
  599.         else //Cancelar ou Voltar
  600.         {
  601.             if(IntMaxValue[playerid][2] > 0) //Se o jogador estiver na página 1 ou mais...
  602.             {
  603.                 IntMaxValue[playerid][2]--; //Back
  604.                 CallViewListInts(playerid);
  605.             }
  606.             else ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  607.         }
  608.         return 1;
  609.     }
  610.     if(dialogid == DIALOG_PROP_EXTORCAO)
  611.     {
  612.         RhayID[playerid] = IsPlayerNearProperty(playerid);
  613.         if(RhayID[playerid] == -666 || !IsPlayerAdmin(playerid)) return 1;
  614.         if(response)
  615.         {
  616.             if(!strlen(inputtext) || strval(inputtext) <= 0) DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Extorcao", 0);
  617.             else
  618.             {
  619.                 if(strval(inputtext) > DOF2_GetInt(pProp(RhayID[playerid]), "Prop_Valor")/2)
  620.                 {
  621.                     SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Valor máximo de extorção atingido, digite uma quantia válida.");
  622.                     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_EXTORCAO);
  623.                 }
  624.                 else DOF2_SetInt(pProp(RhayID[playerid]), "Prop_Extorcao", strval(inputtext));
  625.             }
  626.  
  627.             DOF2_SetInt(pProp(RhayID[playerid]), "Prop_InteriorID", GetPVarInt(playerid, "PropTemp_IntID"));
  628.             DOF2_SetBool(pProp(RhayID[playerid]), "Prop_IntActived", true);
  629.  
  630.             CarregarProp(RhayID[playerid]);
  631.         }
  632.         else
  633.         {
  634.             ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  635.         }
  636.         return 1;
  637.     }
  638.     return 0;
  639. }
  640.  
  641. stock ShowDialogProps(playerid, PropID, DialogID)
  642. {
  643.     new DialogInfosProp[500], StrCatMotherFuck[100];
  644.     Contar_Propriedades();
  645.     switch(DialogID)
  646.     {
  647.         case DIALOG_PROP_INFOS:
  648.         {
  649.             if(PropInfo[PropID][Prop_IntActived] && PropInfo[PropID][Prop_Extorcao] > 0)
  650.             {
  651.                 format(DialogInfosProp, sizeof(DialogInfosProp), "{408080}ID da Propriedade: {00FFFF}%d\n{408080}Nome da Propriedade: {FF8000}%s\n{408080}Dono da Propriedade: {FFFF00}%s\n{408080}Preço da Propriedade: {00FF00}R$ %d\n{408080}Ganhos da Propriedade: {009300}R$ %d\n{408080}Extorção de entrada: {FF0000}R$ %d", PropInfo[PropID][Prop_ID], PropInfo[PropID][Prop_Nome], PropInfo[PropID][Prop_Dono], PropInfo[PropID][Prop_Valor], PropInfo[PropID][Prop_Ganhando], PropInfo[PropID][Prop_Extorcao]);
  652.             }
  653.             else format(DialogInfosProp, sizeof(DialogInfosProp), "{408080}ID da Propriedade: {00FFFF}%d\n{408080}Nome da Propriedade: {FF8000}%s\n{408080}Dono da Propriedade: {FFFF00}%s\n{408080}Preço da Propriedade: {00FF00}R$ %d\n{408080}Ganhos da Propriedade: {009300}R$ %d", PropInfo[PropID][Prop_ID], PropInfo[PropID][Prop_Nome], PropInfo[PropID][Prop_Dono], PropInfo[PropID][Prop_Valor], PropInfo[PropID][Prop_Ganhando]);
  654.  
  655.             if(PropInfo[PropID][Prop_Comprada])
  656.             {
  657.                 if(!strcmp(PropInfo[PropID][Prop_Dono], pNamer(playerid))) ShowPlayerDialog(playerid, DIALOG_PROP_INFOS, DIALOG_STYLE_MSGBOX, "Informações", DialogInfosProp, "Opções", "Fechar");
  658.                 else ShowPlayerDialog(playerid, DIALOG_PROP_INFOS, DIALOG_STYLE_MSGBOX, "Informações", DialogInfosProp, "Fechar", "");
  659.             }
  660.             else ShowPlayerDialog(playerid, DIALOG_PROP_INFOS, DIALOG_STYLE_MSGBOX, "Informações", DialogInfosProp, "Comprar", "Fechar");
  661.         }
  662.         case DIALOG_PROP_AJUSTES:
  663.         {
  664.             if(!strcmp(PropInfo[PropID][Prop_Dono], pNamer(playerid)))
  665.             {
  666.                 format(DialogInfosProp, sizeof(DialogInfosProp), "{00FFFF}Nome ({FF8000}%s{00FFFF})\n{FF0080}Vender Propriedade ({00FF00}R$ %d{FF0080})", DOF2_GetString(pProp(PropID), "Prop_Nome"), DOF2_GetInt(pProp(PropID), "Prop_Valor")/2);
  667.                 ShowPlayerDialog(playerid, DIALOG_PROP_AJUSTES, DIALOG_STYLE_LIST, "Opções", DialogInfosProp, "Confirmar", "Cancelar");
  668.             }
  669.         }
  670.         case DIALOG_PROP_NOME:
  671.         {
  672.             format(DialogInfosProp, sizeof(DialogInfosProp), "{C0C0C0}'{FFFF00}%s{C0C0C0}'\n\n{8080FF}Digite abaixo o nome da propriedade desejado:", PropInfo[PropID][Prop_Nome]);
  673.             if(!strcmp(PropInfo[PropID][Prop_Dono], pNamer(playerid)) || IsPlayerAdmin(playerid))
  674.                 return ShowPlayerDialog(playerid, DIALOG_PROP_NOME, DIALOG_STYLE_INPUT, "Nome da propriedade", DialogInfosProp, "Confirmar", "Cancelar");
  675.         }
  676.         case DIALOG_PROP_VENDER:
  677.         {
  678.             format(DialogInfosProp, sizeof(DialogInfosProp), "{8080FF}Tem certeza que quer vender a propriedade de {00FFFF}ID %d {8080FF}por {00FF00}R$ %d{8080FF}?", PropID, PropInfo[PropID][Prop_Valor]/2);
  679.             if(!strcmp(PropInfo[PropID][Prop_Dono], pNamer(playerid)))
  680.                 return ShowPlayerDialog(playerid, DIALOG_PROP_VENDER, DIALOG_STYLE_MSGBOX, "Vender Propriedade", DialogInfosProp, "Vender", "Cancelar");
  681.         }
  682.         //ADMIN
  683.         case DIALOG_PROP_ADMIN_HOME:
  684.         {
  685.             if(!IsPlayerAdmin(playerid)) return 1;
  686.  
  687.             if(PropID == -666)
  688.             {
  689.                 if(Propriedades_Criadas > 0) format(DialogInfosProp, sizeof(DialogInfosProp), "{00FF00}Criar Propriedade {8080FF}[ID: %d]\n{FF8000}Resetar Propriedades {8080FF}[All(%d)]\n{FF0080}Deletar Propriedades {8080FF}[All(%d)]", GetCurrentPropID(), Propriedades_Criadas, Propriedades_Criadas);
  690.                 else format(DialogInfosProp, sizeof(DialogInfosProp), "{00FF00}Criar Propriedade {8080FF}[ID: %d]", GetCurrentPropID());
  691.             }
  692.             else
  693.             {
  694.                 format(DialogInfosProp, sizeof(DialogInfosProp), "{C0C0C0}Criar Propriedade [ID: %d]\n{C0C0C0}Resetar Propriedades [All(%d)]\n{C0C0C0}Deletar Propriedades [All(%d)]\n{FF0000}Deletar Propriedade {8080FF}[ID: %d]\n{FF8000}Resetar Propriedade {8080FF}[ID: %d]\n{FFFF00}Nome da Propriedade {8080FF}[ID: %d]\n{FF0080}Dono da Propriedade {8080FF}[ID: %d]\n{00FF00}Preço da Propriedade {8080FF}[ID: %d]", GetCurrentPropID(), Propriedades_Criadas, Propriedades_Criadas, PropID, PropID, PropID, PropID, PropID);
  695.  
  696.                 if(PropInfo[PropID][Prop_IntActived]) format(StrCatMotherFuck, sizeof(StrCatMotherFuck), "\n{FF80C0}Interior {8080FF}(%s)\n{A40000}Desabilitar Interior {8080FF}[ID: %d]", _GetIntProps[PropInfo[PropID][Prop_InteriorID]][pIntName], PropID);
  697.                 else format(StrCatMotherFuck, sizeof(StrCatMotherFuck), "\n{FF80C0}Definir Interior {8080FF}[ID: %d]", PropID);
  698.                 strcat(DialogInfosProp, StrCatMotherFuck);
  699.             }
  700.  
  701.             ShowPlayerDialog(playerid, DIALOG_PROP_ADMIN_HOME, DIALOG_STYLE_LIST, "rProperties", DialogInfosProp, "Confirmar", "Cancelar");
  702.         }
  703.         case DIALOG_PROP_NEW_NOME: ShowPlayerDialog(playerid, DIALOG_PROP_NEW_NOME, DIALOG_STYLE_INPUT, "[NEW] Nome da Propriedade", "{8080FF}Digite abaixo o nome desejado para a nova propriedade:", "Confirmar", "Cancelar");
  704.         case DIALOG_PROP_NEW_PRECO: ShowPlayerDialog(playerid, DIALOG_PROP_NEW_PRECO, DIALOG_STYLE_INPUT, "[NEW] Preço da Propriedade", "{8080FF}Digite abaixo o preço da nova propriedade:\n{C0C0C0}(Mínimo: 100 | Máximo: 10000000)", "Confirmar", "Cancelar");
  705.         case DIALOG_PROP_RESET_ALL:
  706.         {
  707.             format(DialogInfosProp, sizeof(DialogInfosProp), "{8080FF}Tem certeza que quer resetar todas propriedades do servidor? {C0C0C0}(%d)", Propriedades_Criadas);
  708.             ShowPlayerDialog(playerid, DIALOG_PROP_RESET_ALL, DIALOG_STYLE_MSGBOX, "Resetar propriedades", DialogInfosProp, "Resetar", "Cancelar");
  709.         }
  710.         case DIALOG_PROP_DELETE_ALL:
  711.         {
  712.             format(DialogInfosProp, sizeof(DialogInfosProp), "{8080FF}Tem certeza que quer {FF0000}deletar {8080FF}todas propriedades do servidor? {C0C0C0}(%d)", Propriedades_Criadas);
  713.             ShowPlayerDialog(playerid, DIALOG_PROP_DELETE_ALL, DIALOG_STYLE_MSGBOX, "Deletar propriedades", DialogInfosProp, "Resetar", "Cancelar");
  714.         }
  715.         case DIALOG_PROP_SET_OWNER:
  716.         {
  717.             ShowPlayerDialog(playerid, DIALOG_PROP_SET_OWNER, DIALOG_STYLE_INPUT, "Dono da propriedade", "{8080FF}Digite abaixo o {FF8000}ID do jogador {8080FF}que será o novo dono da propriedade:", "Confirmar", "Cancelar");
  718.         }
  719.         case DIALOG_PROP_SET_PRICE:
  720.         {
  721.             format(DialogInfosProp, sizeof(DialogInfosProp), "{8080FF}Preço atual: {00FF00}R$ %d\n\n{8080FF}Digite abaixo o preço da propriedade:\n{C0C0C0}(Mínimo: 100 | Máximo: 10000000)", DOF2_GetInt(pProp(PropID), "Prop_Valor"));
  722.             ShowPlayerDialog(playerid, DIALOG_PROP_SET_PRICE, DIALOG_STYLE_INPUT, "Definir preço da propriedade", DialogInfosProp, "Confirmar", "Cancelar");
  723.         }
  724.         case DIALOG_PROP_EXTORCAO:
  725.         {
  726.             format(DialogInfosProp, sizeof(DialogInfosProp), "{8080FF}Digite abaixo o valor de extorção da propriedade:\n{8080FF}Máximo: {00FF00}R$ %d\n\n{C0C0C0}(Caso digitar 0 ou deixar em branco, não será cobrado extorção)", DOF2_GetInt(pProp(PropID), "Prop_Valor")/2);
  727.             ShowPlayerDialog(playerid, DIALOG_PROP_EXTORCAO, DIALOG_STYLE_INPUT, "Extorção da Propriedade", DialogInfosProp, "Confirmar", "Cancelar");
  728.         }
  729.     }
  730.     return 1;
  731. }
  732.  
  733. stock pNamer(playerid)
  734. {
  735.     new NamePlayerPropH[MAX_PLAYER_NAME];
  736.     GetPlayerName(playerid, NamePlayerPropH, sizeof(NamePlayerPropH));
  737.     return NamePlayerPropH;
  738. }
  739.  
  740. stock ResetAll_Property(bool:DeleteProperty=false) //Resetar todas as propriedades, ou seja, deixar todas à venda novamente.
  741. {
  742.     Contar_Propriedades();
  743.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  744.     {
  745.         if(DOF2_FileExists(pProp(i)))
  746.         {
  747.             if(!DeleteProperty)
  748.             {
  749.                 DOF2_SetString(pProp(i), "Prop_Dono", "Ninguém");
  750.                 DOF2_SetBool(pProp(i), "Prop_Comprada", false);
  751.                 DOF2_SetBool(pProp(i), "Prop_IntActived", false);
  752.                 DOF2_SetInt(pProp(i), "Prop_Extorcao", 0);
  753.                 DOF2_SetInt(pProp(i), "Prop_InteriorID", -1);
  754.                 DOF2_SetInt(pProp(i), "Prop_AutoSell", DIAS_AUTO_VENDER);
  755.                 CarregarProp(i);
  756.             }
  757.             else Deletar_Propriedade(i);
  758.         }
  759.     }
  760.     return 1;
  761. }
  762.  
  763. stock ViewListProps(playerid)
  764. {
  765.     new uYuString[800], MotherFuck[128];
  766.     for(new i = Prop_List[playerid][10], c = -1; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  767.     {
  768.         Prop_List[playerid][c + 1] = -1;
  769.         if(c < 9)
  770.         {
  771.             if(DOF2_FileExists(pProp(i)))
  772.             {
  773.                 Prop_List[playerid][++c] = i;
  774.                 if(PropInfo[i][Prop_Comprada])
  775.                 {
  776.                     if(!strcmp(DOF2_GetString(pProp(i), "Prop_Dono"), pNamer(playerid))) format(MotherFuck, sizeof(MotherFuck), "{FF8000}%s {0080C0}[ID %d]: {00FF00}R$ %d {FFFF6C}(Sua propriedade)\n", PropInfo[i][Prop_Nome], i, PropInfo[i][Prop_Valor]);
  777.                     else format(MotherFuck, sizeof(MotherFuck), "{FF8000}%s {0080C0}[ID %d]: {00FF00}R$ %d {FF4A4A}(Vendida)\n", PropInfo[i][Prop_Nome], i, PropInfo[i][Prop_Valor]);
  778.                 }
  779.                 else format(MotherFuck, sizeof(MotherFuck), "{FF8000}%s {0080C0}[ID %d]: {00FF00}R$ %d\n", PropInfo[i][Prop_Nome], i, PropInfo[i][Prop_Valor]);
  780.                 strcat(uYuString, MotherFuck);
  781.             }
  782.         }
  783.         else
  784.         {
  785.             if(DOF2_FileExists(pProp(i)))
  786.             {
  787.                 Prop_List[playerid][++c] = i;
  788.                 strcat(uYuString, "{FF0080}Próximo >>\n");
  789.                 break;
  790.             }
  791.         }
  792.     }
  793.  
  794.     ShowPlayerDialog(playerid, DIALOG_PROP_LIST, DIALOG_STYLE_LIST, "Propriedades", uYuString, "Ok", "Cancelar");
  795.     return 1;
  796. }
  797.  
  798. stock LoadAll_Property() //Carregar todas as propriedades
  799. {
  800.     Contar_Propriedades();
  801.     static Propriedades_Compradas;
  802.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  803.     {
  804.         CarregarProp(i);
  805.         if(PropInfo[i][Prop_Comprada]) Propriedades_Compradas++;
  806.     }
  807.  
  808.     print("\n|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=->");
  809.     printf("| Propriedades Criadas: %d", Propriedades_Criadas);
  810.     printf("| Propriedades Compradas: %d", Propriedades_Compradas);
  811.     printf("| Máximo de Propriedades: %d", MAX_PROPRIEDADES_SERVIDOR);
  812.     printf("| Quantidade que poderá criar: %d", MAX_PROPRIEDADES_SERVIDOR - Propriedades_Criadas);
  813.     print("|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=->\n");
  814.     return 1;
  815. }
  816.  
  817. stock GetCurrentPropID()
  818. {
  819.     Contar_Propriedades();
  820.     new CurrentPropID = -666;
  821.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  822.     {
  823.         if(!DOF2_FileExists(pProp(i)))
  824.         {
  825.             CurrentPropID = i;
  826.             break;
  827.         }
  828.     }
  829.  
  830.     if(CurrentPropID == -666) CurrentPropID = Propriedades_Criadas;
  831.     return CurrentPropID;
  832. }
  833.  
  834. stock Criar_Propriedade(_pNome[], _pDono[], Float:_pX, Float:_pY, Float:_pZ, bool:_pComprada, _pValor, bool:_pIntActived=false, _pIntID=-1, _pExtorcao=0, _pGanhando=-1)
  835. {
  836.     new CurrentID = GetCurrentPropID();
  837.  
  838.     if(DOF2_FileExists(pProp(CurrentID))) return 0;
  839.  
  840.     DOF2_CreateFile(pProp(CurrentID));
  841.  
  842.     DOF2_SetInt(pProp(CurrentID), "Prop_ID", CurrentID);
  843.  
  844.     DOF2_SetString(pProp(CurrentID), "Prop_Nome", _pNome); //Nome da Propriedade
  845.     DOF2_SetString(pProp(CurrentID), "Prop_Dono", _pDono); //Dono da Propriedade
  846.  
  847.     DOF2_SetFloat(pProp(CurrentID), "Prop_X", _pX); //Posição X da Propriedade
  848.     DOF2_SetFloat(pProp(CurrentID), "Prop_Y", _pY); //Posição Y da Propriedade
  849.     DOF2_SetFloat(pProp(CurrentID), "Prop_Z", _pZ); //Posição Z da Propriedade
  850.  
  851.     DOF2_SetBool(pProp(CurrentID), "Prop_Comprada", _pComprada); //Se a Propriedade está comprada, ou não.
  852.     DOF2_SetBool(pProp(CurrentID), "Prop_IntActived", _pIntActived); //Se a Propriedade é entrável ou não.
  853.  
  854.     DOF2_SetInt(pProp(CurrentID), "Prop_Valor", _pValor);
  855.  
  856.     //Caso isto seja escolhido, irá auto-calcular o valor de ganho da propriedade, ou seja, 10% do valor original.
  857.     if(_pGanhando == -1) DOF2_SetInt(pProp(CurrentID), "Prop_Ganhando", _pValor / 10);
  858.     else DOF2_SetInt(pProp(CurrentID), "Prop_Ganhando", _pGanhando);
  859.  
  860.     DOF2_SetInt(pProp(CurrentID), "Prop_InteriorID", _pIntID);
  861.     DOF2_SetInt(pProp(CurrentID), "Prop_Extorcao", _pExtorcao);
  862.     DOF2_SetInt(pProp(CurrentID), "Prop_AutoSell", DIAS_AUTO_VENDER);
  863.  
  864.     DOF2_SaveFile();
  865.     CarregarProp(CurrentID);
  866.  
  867.     if(CurrentID == Propriedades_Criadas) Propriedades_Criadas++;
  868.     return 1;
  869. }
  870.  
  871. stock Deletar_Propriedade(PropID)
  872. {
  873.     if(!DOF2_FileExists(pProp(PropID))) return 0;
  874.  
  875.     DestroyDynamicPickup(PropInfo[PropID][Prop_Pickup]);
  876.     DestroyDynamicMapIcon(PropInfo[PropID][Prop_MapIcon]);
  877.     DestroyDynamic3DTextLabel(PropInfo[PropID][PropText]);
  878.  
  879.     DOF2_RemoveFile(pProp(PropID));
  880.  
  881.     if(PropID == Propriedades_Criadas)
  882.         Propriedades_Criadas--;
  883.  
  884.     return 1;
  885. }
  886.  
  887. stock pProp(PropID)
  888. {
  889.     new Prop_String[30];
  890.     format(Prop_String, sizeof(Prop_String), FOLDER_PROPRIEDADES, PropID);
  891.     return Prop_String;
  892. }
  893.  
  894. stock ContarMyProps(playerid)
  895. {
  896.     new MyProps;
  897.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  898.     {
  899.         if(DOF2_FileExists(pProp(i)))
  900.         {
  901.             if(!strcmp(DOF2_GetString(pProp(i), "Prop_Dono"), pNamer(playerid))) MyProps++;
  902.         }
  903.     }
  904.     return MyProps;
  905. }
  906.  
  907. stock Contar_Propriedades()
  908. {
  909.     Propriedades_Criadas = 0;
  910.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  911.     {
  912.         if(DOF2_FileExists(pProp(i)))
  913.         {
  914.             Propriedades_Criadas++;
  915.         }
  916.     }
  917.     return 1;
  918. }
  919.  
  920. stock CarregarProp(PropID)
  921. {
  922.     new PropriedadeTextStr[350];
  923.  
  924.     PropInfo[PropID][Prop_ID] = DOF2_GetInt(pProp(PropID), "Prop_ID"); //ID da Propriedade!
  925.  
  926.     format(PropInfo[PropID][Prop_Nome], 64, "%s", DOF2_GetString(pProp(PropID), "Prop_Nome")); //Nome da Propriedade
  927.     format(PropInfo[PropID][Prop_Dono], MAX_PLAYER_NAME, "%s", DOF2_GetString(pProp(PropID), "Prop_Dono")); //Dono da Propriedade
  928.  
  929.     PropInfo[PropID][Prop_X] = DOF2_GetFloat(pProp(PropID), "Prop_X"); //Posição X da Propriedade
  930.     PropInfo[PropID][Prop_Y] = DOF2_GetFloat(pProp(PropID), "Prop_Y"); //Posição Y da Propriedade
  931.     PropInfo[PropID][Prop_Z] = DOF2_GetFloat(pProp(PropID), "Prop_Z"); //Posição Z da Propriedade
  932.  
  933.     PropInfo[PropID][Prop_Comprada] = DOF2_GetBool(pProp(PropID), "Prop_Comprada"); //Se a Propriedade está comprada, ou não.
  934.     PropInfo[PropID][Prop_IntActived] = DOF2_GetBool(pProp(PropID), "Prop_IntActived"); //Se a Propriedade é entrável ou não.
  935.  
  936.     PropInfo[PropID][Prop_Valor]    = DOF2_GetInt(pProp(PropID), "Prop_Valor"); //Valor da Propriedade (Dinheiro preciso para comprá-la)
  937.     PropInfo[PropID][Prop_Ganhando] = DOF2_GetInt(pProp(PropID), "Prop_Ganhando"); //10% do Valor acima - isso seria quanto o jogador irá ganhar a cada 30 minutos.
  938.     PropInfo[PropID][Prop_InteriorID] = DOF2_GetInt(pProp(PropID), "Prop_InteriorID"); //ID do Interior da Propriedade
  939.     PropInfo[PropID][Prop_Extorcao] = DOF2_GetInt(pProp(PropID), "Prop_Extorcao");
  940.     PropInfo[PropID][Prop_AutoSell] = DOF2_GetInt(pProp(PropID), "Prop_AutoSell");
  941.  
  942.     DestroyDynamicPickup(PropInfo[PropID][Prop_Pickup]);
  943.     DestroyDynamicMapIcon(PropInfo[PropID][Prop_MapIcon]);
  944.     DestroyDynamic3DTextLabel(PropInfo[PropID][PropText]);
  945.  
  946.     if(PropInfo[PropID][Prop_IntActived])
  947.     {
  948.         if(PropInfo[PropID][Prop_Extorcao] <= 0) format(PropriedadeTextStr, sizeof(PropriedadeTextStr), "{FADD00}ID: {FFFFFF}%d\n{FADD00}Nome da Propriedade: {FFFFFF}%s\n{FADD00}Dono da Propriedade: {FFFFFF}%s\n{FADD00}Preço: {00FF00}R$ %d\n{26C2FF}Pressione '{FF8000}Y{26C2FF}' para mais informações\n{26C2FF}Pressione '{FF8000}F{26C2FF}' ou '{FF8000}Enter{26C2FF}' para entrar", PropID, PropInfo[PropID][Prop_Nome], PropInfo[PropID][Prop_Dono], PropInfo[PropID][Prop_Valor]);
  949.         else format(PropriedadeTextStr, sizeof(PropriedadeTextStr), "{FADD00}ID: {FFFFFF}%d\n{FADD00}Nome da Propriedade: {FFFFFF}%s\n{FADD00}Dono da Propriedade: {FFFFFF}%s\n{FADD00}Preço: {00FF00}R$ %d\n{FADD00}Extorção: {FF0000}R$ %d\n{26C2FF}Pressione '{FF8000}Y{26C2FF}' para mais informações\n{26C2FF}Pressione '{FF8000}F{26C2FF}' ou '{FF8000}Enter{26C2FF}' para entrar", PropID, PropInfo[PropID][Prop_Nome], PropInfo[PropID][Prop_Dono], PropInfo[PropID][Prop_Valor], PropInfo[PropID][Prop_Extorcao]);
  950.     }
  951.     else
  952.     {
  953.         format(PropriedadeTextStr, sizeof(PropriedadeTextStr), "{FADD00}ID: {FFFFFF}%d\n{FADD00}Nome da Propriedade: {FFFFFF}%s\n{FADD00}Dono da Propriedade: {FFFFFF}%s\n{FADD00}Preço: {00FF00}R$ %d\n{26C2FF}Pressione '{FF8000}F{26C2FF}' ou '{FF8000}Enter{26C2FF}' para mais informações", PropID, PropInfo[PropID][Prop_Nome], PropInfo[PropID][Prop_Dono], PropInfo[PropID][Prop_Valor]);
  954.     }
  955.     PropInfo[PropID][PropText] = CreateDynamic3DTextLabel(PropriedadeTextStr, 0xFFFFFFAA, PropInfo[PropID][Prop_X], PropInfo[PropID][Prop_Y], PropInfo[PropID][Prop_Z]+1, 7);
  956.  
  957.     if(PropInfo[PropID][Prop_Comprada]) //Se a propriedade for comprada...
  958.     {
  959.         PropInfo[PropID][Prop_Pickup] = CreateDynamicPickup(PICKUP_PROP_COMPRADA, 1, PropInfo[PropID][Prop_X], PropInfo[PropID][Prop_Y], PropInfo[PropID][Prop_Z]);
  960.         PropInfo[PropID][Prop_MapIcon] = CreateDynamicMapIcon(PropInfo[PropID][Prop_X], PropInfo[PropID][Prop_Y], PropInfo[PropID][Prop_Z], ICONE_PROP_COMPRADA, -1);
  961.     }
  962.     else //Se a propriedade não estiver comprada...
  963.     {
  964.         PropInfo[PropID][Prop_Pickup] = CreateDynamicPickup(PICKUP_PROP_NORMAL, 1, PropInfo[PropID][Prop_X], PropInfo[PropID][Prop_Y], PropInfo[PropID][Prop_Z]);
  965.         PropInfo[PropID][Prop_MapIcon] = CreateDynamicMapIcon(PropInfo[PropID][Prop_X], PropInfo[PropID][Prop_Y], PropInfo[PropID][Prop_Z], ICONE_PROP_NORMAL, -1);
  966.     }
  967.     return 1;
  968. }
  969.  
  970. stock IsPlayerNearProperty(playerid)
  971. {
  972.     new Float:Distance;
  973.     for(new i; i < MAX_PROPRIEDADES_SERVIDOR; i++)
  974.     {
  975.         if(DOF2_FileExists(pProp(i)))
  976.         {
  977.             Distance = GetDistanceToProperty(playerid, i);
  978.             if(Distance < 1.0) return i;
  979.         }
  980.     }
  981.     return -666;
  982. }
  983.  
  984. forward Float:GetDistanceToProperty(playerid, Property);
  985. public Float:GetDistanceToProperty(playerid, Property)
  986. {
  987.     new Float:CurrentPos[6];
  988.     GetPlayerPos(playerid, CurrentPos[0], CurrentPos[1], CurrentPos[2]);
  989.     CurrentPos[3] = PropInfo[Property][Prop_X];
  990.     CurrentPos[4] = PropInfo[Property][Prop_Y];
  991.     CurrentPos[5] = PropInfo[Property][Prop_Z];
  992.     return floatsqroot(floatpower(floatabs(floatsub(CurrentPos[3],CurrentPos[0])),2)+floatpower(floatabs(floatsub(CurrentPos[4],CurrentPos[1])),2)+floatpower(floatabs(floatsub(CurrentPos[5],CurrentPos[2])),2));
  993. }
  994.  
  995. forward Propriedade_Ganhos(playerid);
  996. public Propriedade_Ganhos(playerid)
  997. {
  998.     if(ContarMyProps(playerid) <= 0) return 1;
  999.     new PropStrGanhos[128];
  1000.  
  1001.     SendClientMessage(playerid, -1, "{FF0000}[!]{FFFF00}========================[ {FF8000}GANHOS DE SUAS PROPRIEDADES {FFFF00}]========================");
  1002.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  1003.     {
  1004.          if(DOF2_FileExists(pProp(i)))
  1005.          {
  1006.             if(!strcmp(DOF2_GetString(pProp(i), "Prop_Dono"), pNamer(playerid)))
  1007.             {
  1008.                 format(PropStrGanhos, sizeof(PropStrGanhos), "{FF0000}[!] {FF0080}%s {FFFFFF}| ID: {00FFFF}%d {FFFFFF}| Ganhos: {00FF00}R$ %d", DOF2_GetString(pProp(i), "Prop_Nome"), i, DOF2_GetInt(pProp(i), "Prop_Ganhando"));
  1009.                 SendClientMessage(playerid, -1, PropStrGanhos);
  1010.                 GivePlayerMoney(playerid, DOF2_GetInt(pProp(i), "Prop_Ganhando"));
  1011.                
  1012.                 DOF2_SetInt(pProp(i), "Prop_AutoSell", DIAS_AUTO_VENDER);
  1013.                 PropInfo[i][Prop_AutoSell] = DOF2_GetInt(pProp(i), "Prop_AutoSell");
  1014.             }
  1015.          }
  1016.     }
  1017.     SendClientMessage(playerid, -1, "{FF0000}[!]{FFFF00}========================[ {FF8000}GANHOS DE SUAS PROPRIEDADES {FFFF00}]========================");
  1018.     return 1;
  1019. }
  1020.  
  1021. forward FuncAutoSell();
  1022. public FuncAutoSell()
  1023. {
  1024.     for(new i = 0; i < MAX_PROPRIEDADES_SERVIDOR; ++i)
  1025.     {
  1026.         if(DOF2_FileExists(pProp(i)))
  1027.         {
  1028.             if(DOF2_GetBool(pProp(i), "Prop_Comprada") == true)
  1029.             {
  1030.                 DOF2_SetInt(pProp(i), "Prop_AutoSell", DOF2_GetInt(pProp(i), "Prop_AutoSell")-3600000);
  1031.                 PropInfo[i][Prop_AutoSell] = DOF2_GetInt(pProp(i), "Prop_AutoSell");
  1032.                 if(PropInfo[i][Prop_AutoSell] <= 0)
  1033.                 {
  1034.                     DOF2_SetString(pProp(i), "Prop_Dono", "Ninguém");
  1035.                     DOF2_SetBool(pProp(i), "Prop_Comprada", false);
  1036.                     DOF2_SetInt(pProp(i), "Prop_AutoSell", DIAS_AUTO_VENDER);
  1037.                     printf("[AUTO-VENDER] Propriedade ID %d vendida automaticamente.", i);
  1038.                     CarregarProp(i);
  1039.                 }
  1040.             }
  1041.         }
  1042.     }
  1043.     return 1;
  1044. }
  1045.  
  1046. stock CallViewListInts(playerid)
  1047. {
  1048.     IntMaxValue[playerid][0] = IntMaxValue[playerid][2]*10; //Aqui multiplica o MIN do Loop pelo número da página, se por acaso eu estiver na página 2, então: 2*10=20
  1049.     IntMaxValue[playerid][1] = IntMaxValue[playerid][2]*10+10; //Aqui multiplica o MAX do Loop pelo número da página e adiciona +10, se por acaso eu estiver na página 2, então: 20*10=20+10=30
  1050.  
  1051.     if(IntMaxValue[playerid][1] >= sizeof(_GetIntProps)) IntMaxValue[playerid][1] = sizeof(_GetIntProps);
  1052.  
  1053.     new StringDialog[400], Strizs[128];
  1054.     for(new i = IntMaxValue[playerid][0]; i < IntMaxValue[playerid][1]; ++i)
  1055.     {
  1056.         format(Strizs, sizeof(Strizs), "%s\n", _GetIntProps[i][pIntName]);
  1057.         strcat(StringDialog, Strizs);
  1058.     }
  1059.  
  1060.     if(!(IntMaxValue[playerid][1] >= sizeof(_GetIntProps))) strcat(StringDialog, "{FF0080}Próximo >>");
  1061.  
  1062.     if(IntMaxValue[playerid][2] <= 0) ShowPlayerDialog(playerid, DIALOG_PROP_INTERIORES, DIALOG_STYLE_LIST, "Lista de Interiores", StringDialog, "Escolher", "Cancelar");
  1063.     else ShowPlayerDialog(playerid, DIALOG_PROP_INTERIORES, DIALOG_STYLE_LIST, "Lista de Interiores", StringDialog, "Escolher", "Voltar");
  1064.     return 1;
  1065. }
  1066.  
  1067. /*
  1068. stock GetTempProp(PropID)
  1069. {
  1070.     new StringTempProp[25];
  1071.     if(DOF2_GetInt(pProp(PropID), "Prop_AutoSell") >= 86400000) format(StringTempProp, sizeof(StringTempProp), "%d Dia(s)", DOF2_GetInt(pProp(PropID), "Prop_AutoSell")/86400000);
  1072.     else if(DOF2_GetInt(pProp(PropID), "Prop_AutoSell") >= 3600000 && DOF2_GetInt(pProp(PropID), "Prop_AutoSell") < 86400000) format(StringTempProp, sizeof(StringTempProp), "%d Hora(s)", DOF2_GetInt(pProp(PropID), "Prop_AutoSell")/3600000);
  1073.     else if(DOF2_GetInt(pProp(PropID), "Prop_AutoSell") >= 60000 && DOF2_GetInt(pProp(PropID), "Prop_AutoSell") < 3600000) format(StringTempProp, sizeof(StringTempProp), "%d Minuto(s)", DOF2_GetInt(pProp(PropID), "Prop_AutoSell")/60000);
  1074.     return StringTempProp;
  1075. }
  1076. */
  1077. //----> Comandos
  1078. CMD:aprops(playerid)
  1079. {
  1080.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem permissão para usar este comando.");
  1081.     RhayID[playerid] = IsPlayerNearProperty(playerid);
  1082.     ShowDialogProps(playerid, RhayID[playerid], DIALOG_PROP_ADMIN_HOME);
  1083.     return 1;
  1084. }
  1085.  
  1086. CMD:props(playerid)
  1087. {
  1088.     Contar_Propriedades();
  1089.     if(Propriedades_Criadas <= 0) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Nenhuma propriedade encontrada.");
  1090.     Prop_List[playerid][10] = -1;
  1091.     ViewListProps(playerid);
  1092.     return 1;
  1093. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement