Originally Posted by Troydere
You're doing few things wrong:
PHP код:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registrando al jugador.","Has introducido una clave invбlida.\nEscribe tu clave para registrar una nueva cuenta.","Registrar","Cancelar");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Pass",udb_hash(inputtext));
INI_WriteInt(File,"Skin",1); // You don't have to set this value as it'll set itself later when the player disconnects
INI_Close(File);
AddPlayerClass(PlayerInfo[playerid][pSkin], 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // there's no PlayerInfo[playerid][pSkin] value yet as you have not written anything to it in this part of the script
}
}
Also, AddPlayerClass does not work as you think it does
PHP код:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); // This is useless here as you've loaded the player's data under OnPlayerConnect
AddPlayerClass(PlayerInfo[playerid][pSkin], 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // Should be changed for SetSpawnInfo
}
https://sampwiki.blast.hk/wiki/SetSpawnInfo
|