Gguiz007

Untitled

Apr 29th, 2020
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.98 KB | None | 0 0
  1. #define DialogInfoLogin 7188
  2. CMD:infocasa(playerid)
  3. {
  4.         if (APlayerData[playerid][LoggedIn] == false) return 0;
  5.         for(new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  6.         {
  7.                 if (IsPlayerInRangeOfPoint(playerid, 1.0, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  8.                 {  
  9.                     new dono[24], string[200], query[128], dia, mes, ano;
  10.                     format(dono, sizeof(dono), "%s", AHouseData[HouseID][Owner]);
  11.                     if (AHouseData[HouseID][Owned] == false) return SCM(playerid, 0xFF0000FF, "Essa residência não tem dono!");
  12.                     mysql_format(IDConexao, query, 128, "SELECT `LoginDias`, `LoginMes`, `LoginAno` FROM `usuários` WHERE `Name` = '%s'", dono);
  13.                     new Cache:_cache = mysql_query(IDConexao, query, true), rows = cache_num_rows();
  14.        
  15.                     if(rows > 0)
  16.                     {
  17.                         for(new i = 0; i < rows; i++)
  18.                         {
  19.                             cache_get_value_name_int(i, "LoginAno", ano);
  20.                             cache_get_value_name_int(i, "LoginMes", mes);
  21.                             cache_get_value_name_int(i, "LoginDias", dia);
  22.                            
  23.                             format(string, sizeof(string), "{FF8000}Dono: {FFFFFF}%s\n{FF8000}ID da casa: {FFFFFF}%d\n{FF8000}Último login: {FFFFFF}%d/%d/%d", dono, HouseID, ano, mes, dia);
  24.                         }
  25.                         ShowPlayerDialog(playerid, DialogInfoLogin, DIALOG_STYLE_MSGBOX, "{FF8000}#{FFFFFF}Log da Residência",  string, "Ok", #);
  26.                     }
  27.                     cache_delete(_cache);  
  28.                 }
  29.         }
  30.         return 1;
  31. }
  32.  
  33.  
  34. CMD:infoempresa(playerid)
  35. {
  36.     if (APlayerData[playerid][LoggedIn] == false) return 0;
  37.     for (new BusID; BusID < MAX_BUSINESS; BusID++)
  38.     {
  39.         if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
  40.         {
  41.  
  42.             if (ABusinessData[BusID][Owned] == false) return SCM(playerid, 0xFF0000FF, "Essa empresa não tem dono!");
  43.             new dono[24], dia, mes, ano, string[150];
  44.             new queryy[500];                  
  45.             format(dono, sizeof(dono), "%s", ABusinessData[BusID][Owner]);
  46.                                          
  47.             mysql_format(IDConexao, queryy, sizeof(queryy), "SELECT `LoginDias`, `LoginMes`, `LoginAno` FROM `usuários` WHERE `Name` = '%s'", dono);
  48.             new Cache:_cache = mysql_query(IDConexao, queryy, true), rows = cache_num_rows();    
  49.             if(rows > 0)
  50.             {
  51.                 for(new i = 0; i < rows; i++)
  52.                 {
  53.                     cache_get_value_name_int(i, "LoginAno", ano);
  54.                     cache_get_value_name_int(i, "LoginMes", mes);
  55.                     cache_get_value_name_int(i, "LoginDias", dia);
  56.  
  57.                     format(string, sizeof(string), "{FFCC00}Dono: {FFFFFF}%s\n{FFCC00}ID da empresa: {FFFFFF}%d\n{FFCC00}Último login: {FFFFFF}%d/%d/%d", dono, BusID, ano, mes, dia);
  58.                 }
  59.                 ShowPlayerDialog(playerid, DialogInfoLogin, DIALOG_STYLE_MSGBOX, "{FFCC00}#{FFFFFF}Log da Empresa",  string, "Ok", #);
  60.             }  
  61.             cache_delete(_cache);
  62.         }
  63.     }      
  64.     return 1;
  65. }
  66.  
  67. CMD:envios(playerid, params[])
  68. {
  69.     new player;
  70.     if(APlayerData[playerid][PlayerLevel] >= 3)
  71.     {
  72.         if(!sscanf(params, "u", player))
  73.         {
  74.             SendAdminText(playerid, "/envios", params);
  75.             if(IsPlayerConnected(player))
  76.             {
  77.                 new info[8000], name[24], query[256], remip[24], destname[24], destip[24], amount, year, month, day, hour, minute, second;
  78.                 GetPlayerName(player, name, 24);
  79.                 mysql_format(IDConexao, query, sizeof(query), "SELECT `Sender`, `Reciever`, `SenderIP`, `RecieverIP`, `Amount`, `Day`, `Month`, `Year`, `Hour`, `Minute`, `Second` FROM `pagamentos` WHERE `Sender` = '%s' ORDER BY `Amount` DESC LIMIT 15", name);
  80.                 new Cache:cache_ = mysql_query(IDConexao, query, true), rows = cache_num_rows();
  81.  
  82.                 if(rows > 0)
  83.                 {      
  84.                     format(info, sizeof(info), "%s ID | Destinatário | Quantia | IP do Remetente | IP do Destinatário | Data | Hora\n",info);
  85.                     for(new i; i < rows; i++)
  86.                     {
  87.                         cache_get_value_name(i, "Reciever", destname);
  88.                         cache_get_value_name(i, "SenderIP", remip);
  89.                         cache_get_value_name(i, "RecieverIP", destip);
  90.                         cache_get_value_int(i, "Amount", amount);
  91.                         cache_get_value_name_int(i, "Day", day);
  92.                         cache_get_value_name_int(i, "Month", month);
  93.                         cache_get_value_name_int(i, "Year", year);
  94.                         cache_get_value_name_int(i, "Hour", hour);
  95.                         cache_get_value_name_int(i, "Minute", minute);
  96.                         cache_get_value_name_int(i, "Second", second);
  97.  
  98.                         format(info, sizeof(info), "%s %d | %s | R$%d | %s | %s | %02d:%02d:%02d | %d:%d:%d\n", info, (i+1), destname, amount, remip, destip, day, month, year, hour, minute, second);
  99.                     }
  100.                     ShowPlayerDialog(playerid, DIALOG_ENVIOS, DIALOG_STYLE_MSGBOX, "Transações", info, "Fechar", #);
  101.                 }  
  102.                 cache_delete(cache_);
  103.             }
  104.             else return SCM(playerid, 0xFF0000AA, "Este player não está conectado!");                    
  105.         }
  106.         else return SCM(playerid, 0xFF0000AA, "Use: /envios [playerid/nome]");     
  107.     }
  108.     return 1;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment