Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new groupid;
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pSkin,
- pFaction
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
- INI_WriteInt(File,"Faction",Group_GetPlayer(Group:groupid,playerid));
- INI_Close(File);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- return 1;
- }
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Skin",PlayerInfo[playerid][pSkin]);
- INI_Int("Faction",PlayerInfo[playerid][pFaction]);
- return 1;
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- Group_SetPlayer(Group:groupid,playerid,PlayerInfo[playerid][pFaction]);
- }
- else
- {
- ShowPlayerDialog(playerid, 7, 3, "Login", "You have entered an incorrect password.\n""Enter your password to login", "Login", "Quit");
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement