28.04.2011, 11:49
So, I now figured out the problem isn't with Y_ini here. First, let's see the code
My file looks like this
When you log in as Harr_Levis, that name will be put in Input and the playername (Harr_Levis) and his password (mypass3) will be send to the player after each other. When I next log in with Lead_Admin for example, the playername will still be send to the player (Lead_Admin) but the password which is send is still the password from Harr_Levis (mypass3 and not mypass67). This means something is not right with Input, but I don't know what is going wrong exactly and how to solve it. I tried manually giving Input values (
) and with that I could get more than one value out of the file using gPass to store it in. SO Y_ini can't be the problem here, I think it is Input.
Please don't respond if you don't know what the problem is or how to solve it.
Thanks.
pawn Код:
new Input[MAX_PASSWORD], Password[MAX_PLAYERS][MAX_PASSWORD], gPass[MAX_PASSWORD];
INI:playerlist[](name[], value[])
{
INI_String(Input, gPass, sizeof(Input));
return 0;
}
stock CheckPlayer(playerid){
if(strlen(Password[playerid]) == 0){
ShowPlayerDialog(playerid, 30, 1, "Register", "To register you must first give in the first name of your character.", "OK", "");
return 1;
}
else{
ShowPlayerDialog(playerid, 33, 1, "Login", "Please give in your password.", "OK", "");
return 1;
}
}
public OnPlayerConnect(playerid){
strdel(Input, 0, MAX_PLAYER_NAME);
GetPlayerName(playerid, Input, sizeof(Input));
INI_Load("playerlist.ini");
strpack(Password[playerid], gPass, sizeof(gPass));]
SendClientMessage(playerid, COLOR_WHITE, Input);
SendClientMessage(playerid, COLOR_WHITE, gPass);
CheckPlayer(playerid);
return 1;
}
Код:
Max_Havelaar = mypass Harr_Levis = mypass3 Lead_Admin = mypass67
pawn Код:
strpack(Input, "Harr_Levis", sizeof(Input))
Please don't respond if you don't know what the problem is or how to solve it.
Thanks.