Advertisement
Guest User

reqrqe

a guest
Mar 22nd, 2011
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.37 KB | None | 0 0
  1. public load_stats(playerid)
  2. {
  3.     new playername[MAX_PLAYER_NAME];
  4.     new sql[80], row[512];
  5.     new pdata[122][64];
  6.     GetPlayerName(playerid, playername, sizeof(playername));
  7.     format(sql, sizeof(sql), "SELECT * FROM players WHERE Name='%s'", playername);
  8.     mysql_query(sql);
  9.     //if (DEBUG) SQLLog(sql);
  10.     mysql_store_result();
  11.     if (mysql_num_rows() == 0)
  12.     {
  13.         SendClientMessage(playerid, COLOR_LIGHTRED, "Houve um erro na autenticação.");
  14.         return 1;
  15.     }
  16.     else
  17.     {
  18.     // fetch user profile
  19.         mysql_fetch_row(row);
  20.         splith(row, pdata, '|');
  21.         SendClientMessage(playerid, COLOR_LIGHTRED, "Carregou 3.");
  22.             PlayerInfo[playerid][pLevel] = strval(pdata[3]);
  23.             PlayerInfo[playerid][pAdmin] = strval(pdata[4]);
  24.             PlayerInfo[playerid][pDonateRank] = strval(pdata[5]);
  25.             PlayerInfo[playerid][gPupgrade] = strval(pdata[6]);
  26.             PlayerInfo[playerid][pConnectTime] = strval(pdata[7]);
  27.             PlayerInfo[playerid][pReg] = strval(pdata[8]);
  28.             PlayerInfo[playerid][pSex] = strval(pdata[9]);
  29.             PlayerInfo[playerid][pAge] = strval(pdata[10]);
  30.             PlayerInfo[playerid][pOrigin] = strval(pdata[11]);
  31.             PlayerInfo[playerid][pCK] = strval(pdata[12]);
  32.             PlayerInfo[playerid][pMuted] = strval(pdata[13]);
  33.             PlayerInfo[playerid][pExp] = strval(pdata[14]);
  34.             PlayerInfo[playerid][pCash] = strval(pdata[15]);
  35.             PlayerInfo[playerid][pAccount] = strval(pdata[16]);
  36.             PlayerInfo[playerid][pCrimes] = strval(pdata[17]);
  37.             PlayerInfo[playerid][pKills] = strval(pdata[18]);
  38.             PlayerInfo[playerid][pDeaths] = strval(pdata[19]);
  39.             PlayerInfo[playerid][pArrested] = strval(pdata[20]);
  40.             PlayerInfo[playerid][pWantedDeaths] = strval(pdata[21]);
  41.             PlayerInfo[playerid][pPhoneBook] = strval(pdata[22]);
  42.             PlayerInfo[playerid][pLottoNr] = strval(pdata[23]);
  43.             PlayerInfo[playerid][pFishes] = strval(pdata[24]);
  44.             PlayerInfo[playerid][pBiggestFish] = strval(pdata[25]);
  45.             PlayerInfo[playerid][pJob] = strval(pdata[26]);
  46.             PlayerInfo[playerid][pPayCheck] = strval(pdata[27]);
  47.             PlayerInfo[playerid][pHeadValue] = strval(pdata[28]);
  48.             PlayerInfo[playerid][pJailed] = strval(pdata[29]);
  49.             PlayerInfo[playerid][pJailTime] = strval(pdata[30]);
  50.             PlayerInfo[playerid][pMats] = strval(pdata[31]);
  51.             PlayerInfo[playerid][pDrugs] = strval(pdata[32]);
  52.             PlayerInfo[playerid][pLeader] = strval(pdata[33]);
  53.             PlayerInfo[playerid][pMember] = strval(pdata[34]);
  54.             PlayerInfo[playerid][pFMember] = strval(pdata[35]);
  55.             PlayerInfo[playerid][pRank] = strval(pdata[36]);
  56.             PlayerInfo[playerid][pChar] = strval(pdata[37]);
  57.             PlayerInfo[playerid][pContractTime] = strval(pdata[38]);
  58.             PlayerInfo[playerid][pDetSkill] = strval(pdata[39]);
  59.             PlayerInfo[playerid][pSexSkill] = strval(pdata[40]);
  60.             PlayerInfo[playerid][pBoxSkill] = strval(pdata[41]);
  61.             PlayerInfo[playerid][pLawSkill] = strval(pdata[42]);
  62.             PlayerInfo[playerid][pMechSkill] = strval(pdata[43]);
  63.             PlayerInfo[playerid][pJackSkill] = strval(pdata[44]);
  64.             PlayerInfo[playerid][pCarSkill] = strval(pdata[45]);
  65.             PlayerInfo[playerid][pNewsSkill] = strval(pdata[46]);
  66.             PlayerInfo[playerid][pDrugsSkill] = strval(pdata[47]);
  67.             PlayerInfo[playerid][pCookSkill] = strval(pdata[48]);
  68.             PlayerInfo[playerid][pFishSkill] = strval(pdata[49]);
  69.             PlayerInfo[playerid][pSHealth] = floatstr(pdata[50]);
  70.             PlayerInfo[playerid][pHealth] = floatstr(pdata[51]);
  71.             PlayerInfo[playerid][pInt] = strval(pdata[52]);
  72.             PlayerInfo[playerid][pLocal] = strval(pdata[53]);
  73.             PlayerInfo[playerid][pTeam] = strval(pdata[54]);
  74.             PlayerInfo[playerid][pModel] = strval(pdata[55]);
  75.             PlayerInfo[playerid][pPnumber] = strval(pdata[56]);
  76.             PlayerInfo[playerid][pPhousekey] = strval(pdata[57]);
  77.             PlayerInfo[playerid][pPcarkey] = strval(pdata[58]);
  78.             PlayerInfo[playerid][pPapptkey] = strval(pdata[59]);
  79.             PlayerInfo[playerid][pPbiskey] = strval(pdata[60]);
  80.             PlayerInfo[playerid][pPos_x] = floatstr(pdata[61]);
  81.             PlayerInfo[playerid][pPos_y] = floatstr(pdata[62]);
  82.             PlayerInfo[playerid][pPos_z] = floatstr(pdata[63]);
  83.             PlayerInfo[playerid][pCarLic] = strval(pdata[64]);
  84.             PlayerInfo[playerid][pFlyLic] = strval(pdata[65]);
  85.             PlayerInfo[playerid][pBoatLic] = strval(pdata[66]);
  86.             PlayerInfo[playerid][pFishLic] = strval(pdata[67]);
  87.             PlayerInfo[playerid][pGunLic] = strval(pdata[68]);
  88.             PlayerInfo[playerid][pGun1] = strval(pdata[69]);
  89.             PlayerInfo[playerid][pGun2] = strval(pdata[70]);
  90.             PlayerInfo[playerid][pGun3] = strval(pdata[71]);
  91.             PlayerInfo[playerid][pGun4] = strval(pdata[72]);
  92.             PlayerInfo[playerid][pAmmo1] = strval(pdata[73]);
  93.             PlayerInfo[playerid][pAmmo2] = strval(pdata[74]);
  94.             PlayerInfo[playerid][pAmmo3] = strval(pdata[75]);
  95.             PlayerInfo[playerid][pAmmo4] = strval(pdata[76]);
  96.             PlayerInfo[playerid][pCarTime] = strval(pdata[77]);
  97.             PlayerInfo[playerid][pPayDay] = strval(pdata[78]);
  98.             PlayerInfo[playerid][pPayDayHad] = strval(pdata[79]);
  99.             PlayerInfo[playerid][pCDPlayer] = strval(pdata[80]);
  100.             PlayerInfo[playerid][pWins] = strval(pdata[81]);
  101.             PlayerInfo[playerid][pLoses] = strval(pdata[82]);
  102.             PlayerInfo[playerid][pAlcoholPerk] = strval(pdata[83]);
  103.             PlayerInfo[playerid][pDrugPerk] = strval(pdata[84]);
  104.             PlayerInfo[playerid][pMiserPerk] = strval(pdata[85]);
  105.             PlayerInfo[playerid][pPainPerk] = strval(pdata[86]);
  106.             PlayerInfo[playerid][pTraderPerk] = strval(pdata[87]);
  107.             PlayerInfo[playerid][pTut] = strval(pdata[88]);
  108.             PlayerInfo[playerid][pMissionNr] = strval(pdata[89]);
  109.             PlayerInfo[playerid][pWarns] = strval(pdata[90]);
  110.             PlayerInfo[playerid][pAdjustable] = strval(pdata[91]);
  111.             PlayerInfo[playerid][pFuel] = strval(pdata[92]);
  112.             PlayerInfo[playerid][pMarried] = strval(pdata[93]);
  113.             PlayerInfo[playerid][pMarriedTo] = strmid(PlayerInfo[playerid][pMarriedTo], pdata[94], 0, strlen(pdata[94])-1, 255);
  114.             PlayerInfo[playerid][pLinked] = strval(pdata[96]);
  115.             PlayerInfo[playerid][pDeagle] = strval(pdata[97]);
  116.             PlayerInfo[playerid][pShotgun] = strval(pdata[98]);
  117.             PlayerInfo[playerid][pRifle] = strval(pdata[99]);
  118.             PlayerInfo[playerid][pSDPistol] = strval(pdata[100]);
  119.             PlayerInfo[playerid][pMP5] = strval(pdata[101]);
  120.             PlayerInfo[playerid][pM4] = strval(pdata[102]);
  121.             PlayerInfo[playerid][pAK47] = strval(pdata[103]);
  122.             format(PlayerInfo[playerid][pStartIP], 16, "%s", pdata[104]);
  123.             format(PlayerInfo[playerid][pEndIP], 16, "%s", pdata[105]);
  124.             PlayerInfo[playerid][pLocker] = strval(pdata[106]);
  125.             PlayerInfo[playerid][pRadioFrequency] = strval(pdata[107]);
  126.             PlayerInfo[playerid][pRadio] = strval(pdata[108]);
  127.             PlayerInfo[playerid][pPecArm] = strval(pdata[109]);
  128.             PlayerInfo[playerid][pMesa] = strval(pdata[110]);
  129.             PlayerInfo[playerid][pLuvas] = strval(pdata[111]);
  130.             drugInfo[playerid][dgCocaina] = strval(pdata[112]);
  131.             drugInfo[playerid][dgMaconha] = strval(pdata[113]);
  132.             drugInfo[playerid][dgOpio] = strval(pdata[114]);
  133.             drugInfo[playerid][dgCrack] = strval(pdata[115]);
  134.             drugInfo[playerid][dgMeth] = strval(pdata[116]);
  135.             drugInfo[playerid][dgHeroina] = strval(pdata[117]);
  136.             drugInfo[playerid][dgHaxixe] = strval(pdata[118]);
  137.             PlayerInfo[playerid][pPcarkey2] = strval(pdata[119]);
  138.             PlayerInfo[playerid][pTrabalhado] = strval(pdata[120]);
  139.             PlayerInfo[playerid][pPartes] = strval(pdata[121]);
  140.             //PlayerInfo[playerid][pPcarkey3] = strval(field[122]);
  141.         //printf("Player %s, Helper:%d, NMuted:%d", playername, PlayerInfo[playerid][pHelper], PlayerInfo[playerid][pNMuted]);
  142.         mysql_free_result();
  143.     }
  144.     return 1;
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement