12.03.2013, 20:20
Alright guys so we have a bug in our script or at least I think its our script. The deal is whevener a new player joins they are either Admins lvl 1-5 or Vips lvl 1-3 Anyway to fix this? here is my register and login script.
Код:
switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"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,"Vip",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_WriteInt(File,"Ban",0); INI_WriteInt(File,"Score",0); INI_WriteInt(File,"Talent",0); INI_Close(File); ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Welcome to Urban-Gaming Online.\nWe Highly recommend you re-log to successfully save your Account.","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, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok",""); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit"); } return 1; } } } return 1; }