20.02.2011, 13:17
Hey guys. I've got a little problem. I want that once you log in you'll spawn automaticly.
But it bugs. When I spawn I can walk but the camera doesn't move.
But it bugs. When I spawn I can walk but the camera doesn't move.
pawn Код:
if (dialogid == Login)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Welcome back", "Pleas fill in your password below", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, COLOR_RED, "Wrong password");
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Welcome back", "Pleas fill in your password below", "Login", "Leave");
}
else
{
logged[playerid] = 1;
PlayerInfo[playerid][adminlevel] = dini_Int(file, "adminlevel");
PlayerInfo[playerid][money] = dini_Int(file, "money");
PlayerInfo[playerid][score] = dini_Int(file, "score");
GivePlayerMoney(playerid, dini_Int(file, "money")-GetPlayerMoney(playerid));
SetPlayerScore(playerid, dini_Int(file, "score")-GetPlayerScore(playerid));
SendClientMessage(playerid,COLOR_RED, "Successfully logged in!");
SpawnPlayer(playerid);
}
}
return 0;
}