Advertisement
smcspals

aa

Feb 21st, 2024
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.93 KB | None | 0 0
  1. ResetarVariaveis(playerid)
  2. {
  3.     strclear(PlayerInfo[playerid][pNome]);
  4.     strclear(PlayerInfo[playerid][pSenha]);
  5.  
  6.     PlayerInfo[playerid][pID] = -1;
  7.     PlayerInfo[playerid][pDinheiro] = 25000;
  8.     PlayerInfo[playerid][pTempoVip] = 0;
  9.     PlayerInfo[playerid][pVip] = 0;
  10.     PlayerInfo[playerid][pAdmin] = 0;
  11.     PlayerInfo[playerid][pLevel] = 1;
  12.     PlayerInfo[playerid][pExp] = 12;
  13.     PlayerInfo[playerid][pSkin] = 0;
  14.  
  15.     PlayerInfo[playerid][pMatou] = 0;
  16.     PlayerInfo[playerid][pMorreu] = 0;
  17.  
  18.     PlayerInfo[playerid][pDuelosWin] = 0;
  19.     PlayerInfo[playerid][pDuelosLoose] = 0;
  20.  
  21.     PlayerInfo[playerid][pGangID] = 0;
  22.     PlayerInfo[playerid][pGangExp] = 0;
  23.  
  24.     PlayerInfo[playerid][pHudColor] = 0;
  25.     PlayerInfo[playerid][pHitmarkalpha] = 0;
  26.  
  27.     PlayerInfo[playerid][pAntiSpawnKill] = 0;
  28.     PlayerInfo[playerid][pLogado] = false;
  29.  
  30.     PlayerInfo[playerid][pTimer] = 10;
  31.     PlayerInfo[playerid][pWeather] = 10;
  32.     PlayerInfo[playerid][pHitSound] = 1;
  33.  
  34.     PlayerInfo[playerid][pMaxArenaDmg] = 0;
  35.     PlayerInfo[playerid][pWonArenas] = 0;
  36.     return 1;
  37. }
  38.  
  39. Kast:LoadAccount(playerid)
  40. {  
  41.     new rows = cache_num_rows();
  42.     if(rows)
  43.     {
  44.         cache_get_value_name_int(0, "ID", PlayerInfo[playerid][pID]);
  45.         cache_get_value_name_int(0, "Senha", PlayerInfo[playerid][pSenha]);
  46.         cache_get_value_name_int(0, "Dinheiro", PlayerInfo[playerid][pDinheiro]);
  47.         cache_get_value_name_int(0, "TempoVip", PlayerInfo[playerid][pTempoVip]);
  48.         cache_get_value_name_int(0, "Vip", PlayerInfo[playerid][pVip]);
  49.         cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][pAdmin]);
  50.         cache_get_value_name_int(0, "Level", PlayerInfo[playerid][pLevel]);
  51.         cache_get_value_name_int(0, "Score", PlayerInfo[playerid][pScore]);
  52.         cache_get_value_name_int(0, "Exp", PlayerInfo[playerid][pExp]);
  53.         cache_get_value_name_int(0, "Skin", PlayerInfo[playerid][pSkin]);
  54.         cache_get_value_name_int(0, "Matou", PlayerInfo[playerid][pMatou]);
  55.         cache_get_value_name_int(0, "Morreu", PlayerInfo[playerid][pMorreu]);
  56.         cache_get_value_name_int(0, "Win", PlayerInfo[playerid][pDuelosWin]);
  57.         cache_get_value_name_int(0, "Loose", PlayerInfo[playerid][pDuelosLoose]);
  58.         cache_get_value_name_int(0, "GangID", PlayerInfo[playerid][pGangID]);
  59.         cache_get_value_name_int(0, "GangExp", PlayerInfo[playerid][pGangExp]);
  60.         cache_get_value_name_int(0, "HudColor", PlayerInfo[playerid][pHudColor]);
  61.         cache_get_value_name_int(0, "HitmarkColor", PlayerInfo[playerid][pHitmarkalpha]);
  62.         cache_get_value_name_int(0, "SpawnKill", PlayerInfo[playerid][pAntiSpawnKill]);
  63.         cache_get_value_name_int(0, "Timer", PlayerInfo[playerid][pTimer]);
  64.         cache_get_value_name_int(0, "Weather", PlayerInfo[playerid][pWeather]);
  65.         cache_get_value_name_int(0, "HitSound", PlayerInfo[playerid][pHitSound]);
  66.         cache_get_value_name_int(0, "MaxArenaDmg", PlayerInfo[playerid][pMaxArenaDmg]);
  67.         cache_get_value_name_int(0, "WonA", PlayerInfo[playerid][pWonArenas]);
  68.         ShowDialogLogin(playerid);
  69.         return true;
  70.     }
  71.     ShowDialogRegister(playerid);
  72.     return true;
  73. }
  74.  
  75. SaveAccount(playerid)
  76. {
  77.     new query[1000];
  78.     mysql_format(Conexao, query, sizeof(query), "UPDATE `usuarios` SET `Dinheiro` = '%i', `Tempovip` = '%i', `Vip` = '%i', `Admin` = '%i', `Score` = '%i', `Level` = '%i', `Exp` = '%i', `Skin` = '%i', `Matou` = '%i', `Morreu` = '%i', `Win` = '%i', `Loose` = '%i', `GangID` = '%i', `GangExp` = '%i', `HudColor` = '%i', `HitmarkColor` = '%i', `SpawnKill` = '%i', `Timer` = '%i', `Weather` = '%i', `HitSound` = '%i', `MaxArenaDmg` = '%i', `WonA` = '%'i WHERE `id` = '%i'",
  79.     PlayerInfo[playerid][pDinheiro],
  80.     PlayerInfo[playerid][pTempoVip],
  81.     PlayerInfo[playerid][pVip],
  82.     PlayerInfo[playerid][pAdmin],
  83.     PlayerInfo[playerid][pScore],
  84.     PlayerInfo[playerid][pLevel],
  85.     PlayerInfo[playerid][pExp],
  86.     PlayerInfo[playerid][pSkin],
  87.     PlayerInfo[playerid][pMatou],
  88.     PlayerInfo[playerid][pMorreu],
  89.     PlayerInfo[playerid][pDuelosWin],
  90.     PlayerInfo[playerid][pDuelosLoose],
  91.     PlayerInfo[playerid][pGangID],
  92.     PlayerInfo[playerid][pGangExp],
  93.     PlayerInfo[playerid][pHudColor],
  94.     PlayerInfo[playerid][pHitmarkalpha],
  95.     PlayerInfo[playerid][pAntiSpawnKill],
  96.     PlayerInfo[playerid][pTimer],
  97.     PlayerInfo[playerid][pWeather],
  98.     PlayerInfo[playerid][pHitSound],
  99.     PlayerInfo[playerid][pMaxArenaDmg],
  100.     PlayerInfo[playerid][pWonArenas],
  101.     PlayerInfo[playerid][pID]);
  102.     mysql_tquery(Conexao, query);
  103.     return 1;
  104. }
  105.  
  106. stock removeQuotesFromString(str[])
  107. {
  108.     for(new t = 0; t < 2; t++)
  109.     {
  110.         for (new i = 0; i < strlen(str); i++)
  111.         {
  112.             if (str[i] == '"' || str[i] == '\'')
  113.             {
  114.                 strdel(str, i, i + 1);
  115.             }
  116.         }
  117.     }
  118.  
  119.     return true;
  120. }
  121.  
  122. Kast:InserirSQL(playerid)
  123. {
  124.     PlayerInfo[playerid][pID] = cache_insert_id();
  125. }
  126.  
  127. stock ShowDialogRegister(playerid)
  128.     return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "registro", "texto registro", "Enter", "Cancel");
  129.  
  130. stock ShowDialogLogin(playerid)
  131.     return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "login", "texto login", "Enter", "Cancel");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement