Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.30 KB | None | 0 0
  1. public OnAccountLoad(playerid, type)
  2. {
  3.     switch(Type)
  4.     {
  5.         case 1:
  6.         {
  7.             Info[playerid][ID] = cache_get_field_content_int(0,"ID");
  8.             Info[playerid][Level] = cache_get_field_content_int(0, "Level");
  9.             Info[playerid][Money] = cache_get_field_content_int(0, "Money");
  10.             Info[playerid][Credits] = cache_get_field_content_int(0, "Credits");
  11.             Info[playerid][Kills] = cache_get_field_content_int(0, "Kills");
  12.             Info[playerid][Deaths] = cache_get_field_content_int(0, "Deaths");
  13.             Info[playerid][Hours] = cache_get_field_content_int(0, "Hours");
  14.             Info[playerid][Minutes] = cache_get_field_content_int(0, "Minutes");
  15.             Info[playerid][Seconds] = cache_get_field_content_int(0, "Seconds");
  16.             Info[playerid][Marijuana] = cache_get_field_content_int(0, "Marijuana");
  17.             Info[playerid][Cocaine] = cache_get_field_content_int(0, "Cocaine");
  18.             Info[playerid][Premium] = cache_get_field_content_int(0, "Premium");
  19.             Info[playerid][xLevel] = cache_get_field_content_int(0, "xLevel");
  20.             Info[playerid][XP] = cache_get_field_content_int(0, "XP");
  21.             Info[playerid][WantedLevel] = cache_get_field_content_int(0, "WantedLevel");
  22.             Info[playerid][Muted] = cache_get_field_content_int(0, "Muted");
  23.             Info[playerid][Jailed] = cache_get_field_content_int(0, "Jailed");
  24.             Info[playerid][Hitman] = cache_get_field_content_int(0, "Hitman");
  25.             Info[playerid][Skin] = cache_get_field_content_int(0, "Skin");
  26.             Info[playerid][PosX] = cache_get_field_content_float(0, "PosX");
  27.             Info[playerid][PosY] = cache_get_field_content_float(0, "PosY");
  28.             Info[playerid][PosZ] = cache_get_field_content_float(0, "PosZ");
  29.             Info[playerid][PosA] = cache_get_field_content_float(0, "PosA");
  30.             Info[playerid][Interior] = cache_get_field_content_int(0, "Interior");
  31.             Info[playerid][PlayerTeam] = cache_get_field_content_int(0, "PlayerTeam");
  32.             break;
  33.         }
  34.         case 2:
  35.         {
  36.                 new
  37.                 weaponid,
  38.                 ammo;
  39.            
  40.             for(new i, j = cache_get_row_count(userDB); i < j; i++) // loop through all the rows that were found
  41.             {
  42.                 weaponid    = cache_get_row_int(i, 0, userDB);
  43.                 ammo        = cache_get_row_int(i, 1, userDB);
  44.                
  45.                 if(!(0 <= weaponid <= 46)) // check if weapon is valid (should be)
  46.                 {
  47.                     continue;
  48.                 }
  49.                
  50.                 GivePlayerWeapon(playerid, weaponid, ammo);
  51.             }
  52.             break;
  53.         }
  54.     }
  55.     Info[playerid][Logged] = 1;
  56.     SetSpawnInfo( playerid, NO_TEAM, Info[playerid][Skin], Info[playerid][PosX], Info[playerid][PosY], Info[playerid][PosZ], Info[playerid][PosA], 0,0,0,0,0,0);
  57.     TogglePlayerSpectating(playerid, false);
  58.     SpawnPlayer(playerid);
  59.     SetPlayerInterior(playerid, Info[playerid][Interior]);
  60.     GivePlayerMoney(playerid, Info[playerid][Money]);
  61.     SetPlayerWantedLevel(playerid, Info[playerid][WantedLevel]);
  62.     gTeam[playerid] = Info[playerid][PlayerTeam];
  63.     TeamCounter(playerid);
  64.     SetColorForPlayer(playerid);
  65.     return 1;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement