case DIALOG_REGISTER: { if (!response) return 1; if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FF21E1}Register","{F5ED05}Type your password below to register an account.\n{FA1111}That password is invalid","Register","Cancel"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteString(File,"Password",inputtext); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"Vip",0); INI_WriteInt(File,"Muted",0); INI_WriteInt(File,"Ban",0); INI_WriteInt(File,"Score",0); INI_WriteInt(File,"Pet",0); INI_Close(File); SendClientMessage(playerid, COLOR_GREEN, "Your stats will now be saved! You have been logged in automatically."); } }
case DIALOG_LOGIN: { if (!response) return Kick (playerid); if(response) { if(strcmp(inputtext, PlayerInfo[playerid][pPass], false)) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); SendClientMessage(playerid, COLOR_GREEN, "You have been logged in."); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FF21E1}Login","{F5ED05}Type your password below to login.\n{FA1111}Incorrect password!","Login","Quit server"); } return 1; } }
if(strcmp(inputtext, PlayerInfo[playerid][pPass], false))
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
Topic title: "Login script allows any password"
Read before posting dude. Your problem is on the strcmp line. See information about the function here: https://sampwiki.blast.hk/wiki/strcmp pawn Код:
pawn Код:
|