Advertisement
MrAlienBG

Untitled

May 18th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.96 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI\y_ini>
  3. #define pSave "Jail/%s.ini"
  4.  
  5.  
  6. enum Info
  7. {
  8.     Jail
  9. }
  10. new Pnfo[MAX_PLAYERS][Info];
  11.  
  12. forward LoadStats(playerid,name[],value[]);
  13. public LoadStats(playerid,name[],value[])
  14. {
  15.     INI_Int("Jail", Pnfo[playerid][Jail]);
  16.     return 1;
  17. }
  18.  
  19. public OnPlayerConnect(playerid)
  20. {
  21.     INI_ParseFile(UserPath(playerid),"LoadStats",.bExtra = true, .extra = playerid);
  22.     return 1;
  23. }
  24.    
  25. public OnPlayerDisconnect(playerid, reason)
  26. {
  27.     new INI:File = INI_Open(UserPath(playerid));
  28.     INI_SetTag(File,"Stats");
  29.     INI_WriteInt(File, "Jail", Pnfo[playerid][Jail]);
  30.     INI_Close(File);
  31.  
  32.     return 1;
  33. }
  34.  
  35. public OnPlayerSpawn(playerid)
  36. {
  37.     if(Pnfo[playerid][Jail] == 1)
  38.     {
  39.     // send to jail function
  40.     }
  41.     return 1;
  42. }
  43. stock UserPath(playerid)
  44. {
  45.     new string[128],playername[MAX_PLAYER_NAME];
  46.     GetPlayerName(playerid,playername,sizeof(playername));
  47.     format(string,sizeof(string),pSave,playername);
  48.     return string;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement