Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnAccountLoad(playerid, type)
- {
- switch(Type)
- {
- case 1:
- {
- Info[playerid][ID] = cache_get_field_content_int(0,"ID");
- Info[playerid][Level] = cache_get_field_content_int(0, "Level");
- Info[playerid][Money] = cache_get_field_content_int(0, "Money");
- Info[playerid][Credits] = cache_get_field_content_int(0, "Credits");
- Info[playerid][Kills] = cache_get_field_content_int(0, "Kills");
- Info[playerid][Deaths] = cache_get_field_content_int(0, "Deaths");
- Info[playerid][Hours] = cache_get_field_content_int(0, "Hours");
- Info[playerid][Minutes] = cache_get_field_content_int(0, "Minutes");
- Info[playerid][Seconds] = cache_get_field_content_int(0, "Seconds");
- Info[playerid][Marijuana] = cache_get_field_content_int(0, "Marijuana");
- Info[playerid][Cocaine] = cache_get_field_content_int(0, "Cocaine");
- Info[playerid][Premium] = cache_get_field_content_int(0, "Premium");
- Info[playerid][xLevel] = cache_get_field_content_int(0, "xLevel");
- Info[playerid][XP] = cache_get_field_content_int(0, "XP");
- Info[playerid][WantedLevel] = cache_get_field_content_int(0, "WantedLevel");
- Info[playerid][Muted] = cache_get_field_content_int(0, "Muted");
- Info[playerid][Jailed] = cache_get_field_content_int(0, "Jailed");
- Info[playerid][Hitman] = cache_get_field_content_int(0, "Hitman");
- Info[playerid][Skin] = cache_get_field_content_int(0, "Skin");
- Info[playerid][PosX] = cache_get_field_content_float(0, "PosX");
- Info[playerid][PosY] = cache_get_field_content_float(0, "PosY");
- Info[playerid][PosZ] = cache_get_field_content_float(0, "PosZ");
- Info[playerid][PosA] = cache_get_field_content_float(0, "PosA");
- Info[playerid][Interior] = cache_get_field_content_int(0, "Interior");
- Info[playerid][PlayerTeam] = cache_get_field_content_int(0, "PlayerTeam");
- break;
- }
- case 2:
- {
- new
- weaponid,
- ammo;
- for(new i, j = cache_get_row_count(userDB); i < j; i++) // loop through all the rows that were found
- {
- weaponid = cache_get_row_int(i, 0, userDB);
- ammo = cache_get_row_int(i, 1, userDB);
- if(!(0 <= weaponid <= 46)) // check if weapon is valid (should be)
- {
- continue;
- }
- GivePlayerWeapon(playerid, weaponid, ammo);
- }
- break;
- }
- }
- Info[playerid][Logged] = 1;
- 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);
- TogglePlayerSpectating(playerid, false);
- SpawnPlayer(playerid);
- SetPlayerInterior(playerid, Info[playerid][Interior]);
- GivePlayerMoney(playerid, Info[playerid][Money]);
- SetPlayerWantedLevel(playerid, Info[playerid][WantedLevel]);
- gTeam[playerid] = Info[playerid][PlayerTeam];
- TeamCounter(playerid);
- SetColorForPlayer(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement