Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. public LoadPlayerData(playerid)
  2. {
  3. new name[MAX_PLAYER_NAME],file[128];
  4. GetPlayerName(playerid,name,sizeof(name));
  5. format(file,sizeof(file),"saves/user/%s.ini",name);
  6. if(!fexist(file)) return;
  7.  
  8. new tmpxp = dini_Int(file,"Xp");
  9.  
  10. if(!tmpxp) return;
  11.  
  12.  
  13. SetPlayerScore(playerid,tmpxp);
  14. SetPlayerPos(playerid,dini_Float(file,"Pozicija_X"),dini_Float(file,"Pozicija_Y"),dini_Float(file,"Pozicija_Z"));
  15. SetPlayerInterior(playerid,dini_Int(file,"Interioras"));
  16. SetPlayerWantedLevel(playerid,dini_Int(file,"Ieskomumas"));
  17. ResetPlayerMoneyA(playerid);
  18. GivePlayerMoneyA(playerid,dini_Int(file,"Pinigai.Rankose"));
  19. SetPlayerVirtualWorld(playerid,dini_Int(file,"Virtualus.Pasaulis"));
  20. SetPVarInt(playerid, "Pinigai.Banke", dini_Int(file, "Pinigai.Banke"));
  21. playerDB[playerid][mobsas] = dini_Int(file,"Mobilus");
  22. SetPVarInt(playerid, "Narkotikai", dini_Int(file, "Narkotikai"));
  23. SetPVarInt(playerid, "Lytis", dini_Int(file, "Lytis"));
  24. SetPVarInt(playerid, "Drabuziai", dini_Int(file,"Drabuziai"));
  25. SetPVarInt(playerid, "Teises", dini_Int(file,"Teises"));
  26. SetPVarInt(playerid, "Naujokas", dini_Int(file,"Naujokas"));
  27. SetPVarInt(playerid, "Ginklas", dini_Int(file,"Ginklas"));
  28. SetPVarInt(playerid, "Ispejimai", dini_Int(file,"Ispejimai"));
  29. SetPVarInt(playerid, "Uniforma", dini_Int(file,"Uniforma"));
  30. SetPVarInt(playerid, "Uniformd", dini_Int(file,"Uniformd"));
  31. SetPVarInt(playerid, "Direktorius", dini_Int(file,"Direktorius"));
  32. SetPVarInt(playerid,"Kalejimo.Laikas", dini_Int(file,"Kalejimo.Laikas"));
  33. SetPVarInt(playerid, "Specialybe", dini_Int(file, "Darbas"));
  34. SetPVarInt(playerid, "Pastatas", dini_Int(file, "Pastatas"));
  35.  
  36. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas0"),dini_Int(file,"Ammo0"));
  37. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas1"),dini_Int(file,"Ammo1"));
  38. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas2"),dini_Int(file,"Ammo2"));
  39. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas3"),dini_Int(file,"Ammo3"));
  40. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas4"),dini_Int(file,"Ammo4"));
  41. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas5"),dini_Int(file,"Ammo5"));
  42. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas6"),dini_Int(file,"Ammo6"));
  43. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas7"),dini_Int(file,"Ammo7"));
  44. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas8"),dini_Int(file,"Ammo8"));
  45. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas9"),dini_Int(file,"Ammo9"));
  46. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas10"),dini_Int(file,"Ammo10"));
  47. GivePlayerWeapon(playerid,dini_Int(file,"Ginklas11"),dini_Int(file,"Ammo11"));
  48.  
  49. //Checks that prevent lots of bandwith
  50. if(gSession==dini_Int(file,"Paskutine.Sesija"))
  51. {
  52. playerDB[playerid][pcar] = dini_Int(file,"Masina");
  53. if(playerDB[playerid][pcar] != -1)
  54. {
  55. if(strcmp(name,vehicleDB[playerDB[playerid][pcar]][owner_name],true) || !vehicleDB[playerDB[playerid][pcar]][locked]) playerDB[playerid][pcar]=-1;
  56. }
  57. }else{
  58. playerDB[playerid][pcar]=-1;
  59. }
  60.  
  61. if(GetPVarInt(playerid, "Kalejimo.Laikas") > 0)
  62. {
  63. SetTimerEx("UnjailPlayer",GetPVarInt(playerid, "Kalejimo.Laikas")*1000,0,"iffffi",playerid,-1597.6338,716.4904,11.7759,341.3682,0);
  64. SetPVarInt(playerid, "Ikalintas", 1);
  65. }
  66.  
  67. if(GetPVarInt(playerid, "Uniformd") == 1)
  68. SetPlayerSkin(playerid,GetPVarInt(playerid, "Uniforma"));
  69. else
  70. SetPlayerSkin(playerid,GetPVarInt(playerid, "Drabuziai"));
  71.  
  72. return;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement