Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 6, 1, "Register", "You have entered an invalid password.\n""Type your password below to register a new account.", "Register", "Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, 8, 0, "Success", "Great!You are now registerd", "Ok", "");
- }
- }
- 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]);
- ShowPlayerDialog(playerid, 9, 0, "Success!", "You have successfully logged in!", "ok", "");
- }
- else
- {
- ShowPlayerDialog(playerid, 7, 1, "Login", "You have entered an incorrect password.\n""Type your password below to login.", "Login", "Quit");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment