Advertisement
nick1999

Untitled

Jun 6th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.04 KB | None | 0 0
  1. new groupid;
  2.  
  3. enum pInfo
  4. {
  5.     pPass,
  6.     pCash,
  7.     pAdmin,
  8.     pKills,
  9.     pDeaths,
  10.     pSkin,
  11.     pFaction
  12. }
  13.  
  14. public OnPlayerDisconnect(playerid, reason)
  15. {
  16.     new INI:File = INI_Open(UserPath(playerid));
  17.     INI_SetTag(File,"data");
  18.     INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  19.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  20.     INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  21.     INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  22.     INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
  23.     INI_WriteInt(File,"Faction",Group_GetPlayer(Group:groupid,playerid));
  24.     INI_Close(File);
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerDeath(playerid, killerid, reason)
  29. {
  30.     PlayerInfo[killerid][pKills]++;
  31.     PlayerInfo[playerid][pDeaths]++;
  32.     return 1;
  33. }
  34.  
  35. public LoadUser_data(playerid,name[],value[])
  36. {
  37.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  38.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  39.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  40.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  41.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  42.     INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  43.     INI_Int("Faction",PlayerInfo[playerid][pFaction]);
  44.     return 1;
  45. }
  46.  
  47.     case DIALOG_LOGIN:
  48.         {
  49.                 if ( !response ) return Kick ( playerid );
  50.                 if( response )
  51.                 {
  52.                     if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  53.                     {
  54.                             INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  55.                             GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  56.                             SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  57.                 Group_SetPlayer(Group:groupid,playerid,PlayerInfo[playerid][pFaction]);
  58.                     }
  59.                     else
  60.                     {
  61.                             ShowPlayerDialog(playerid, 7, 3, "Login", "You have entered an incorrect password.\n""Enter your password to login", "Login", "Quit");
  62.                     }
  63.                     return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement