Problema Raro
#1


Hola a todos, Bueno yo tengo un problema medio Raro.

Cual es?

Son 2.

Cada ves que entro y me registro y luego me logeo, El server kickea al jugador, osae no se puede entrar

Y Bueno antes cuando no me pasaba lo de arriba me pasaba otra cosa. El Skin se movia como una chica osea medio rara y en cualquier skin.(Espero que me entiendan)

y Bueno esas eran mi pregunta.

Espero que me puedan ayudar.
Reply
#2

1) Dejб el cуdigo que ejecutбs cuando el jugador se loguea y cuando se registra asн te podemos ayudar.
2) En OnGameModeInit pone
pawn Код:
UsePlayerPedAnims();
Reply
#3

pawn Код:
switch(dialogid)
    {
        case D_Registro:
        {
            if(response == 1)
            {
                if(strlen(inputtext))
                {
                    new tmppass[64];
                    strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
                    Registro(playerid,tmppass);
                    new tlogeo[150];
                    format(tlogeo,sizeof(tlogeo),"%s\nYa te has registrado\nAhora ingrese su contraseсa para ingresar",Nombre(playerid));
                    ShowPlayerDialog(playerid,D_Logeo,DIALOG_STYLE_PASSWORD,"Role Play Latino",tlogeo,"Logear","Canselar");
                }
                else
                {
                    ShowPlayerDialog(playerid,D_Registro,DIALOG_STYLE_PASSWORD,"Role Play Latino","Usted debe ingresar una contraseсa mayor a 4 digitos","Aceptar","Canselar");
                }
            }
            else
            {
                Error(playerid,"Debes de registrarte para jugar en RPL");
                //Kick(playerid);
            }
        }
        case D_Logeo:
        {
            if(response == 1)
            {
                if(strlen(inputtext))
                {
                    new tmppass[64];
                    strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
                    Login(playerid,tmppass);
                }
                else
                {
                    ShowPlayerDialog(playerid,D_Logeo,DIALOG_STYLE_PASSWORD,"Role Play Latino","Debes ingresar tu contraseсa para ingresar","Aceptar","");
                }
            }
            else
            {
                //Kick(playerid);
            }
        }

    }
Reply
#4

pawn Код:
public Registro(playerid,password[])
{
    if(IsPlayerConnected(playerid))
    {
            new string[32];
            new NombreJ[MAX_PLAYER_NAME];
            GetPlayerName(playerid, NombreJ, sizeof(NombreJ));
            format(string, sizeof(string), "Usuarios/%s.ini", NombreJ);
            new File: hFile = fopen(string, io_write);
            if (hFile)
            {
                strmid(Info[playerid][Pass], password, 0, strlen(password), 255);
                new var[64];
                format(var, 64, "Pass=%i\n",    Info[playerid][Pass]);fwrite(hFile, var);
                format(var, 64, "Level=%i\n",   Info[playerid][Level]);fwrite(hFile, var);
                format(var, 64, "Dinero=%i\n",  Info[playerid][Dinero]);fwrite(hFile, var);
                SetPlayerHealth(playerid,85.9); GetPlayerHealth(playerid,Info[playerid][Vida]);
                format(var, 64, "Vida=%f\n",    Info[playerid][Vida]);fwrite(hFile, var);
                format(var, 64, "DineroSusto=%i\n", Info[playerid][DineroSusto]);fwrite(hFile, var);
                format(var, 64, "Faccion=%i\n", Info[playerid][Faccion]);fwrite(hFile, var);
                format(var, 64, "Job=%i\n", Info[playerid][Job]);fwrite(hFile, var);
                format(var, 64, "Radio=%i\n", Info[playerid][Radio]);fwrite(hFile, var);
                format(var, 64, "Frecuencia=%i\n", Info[playerid][Frecuencia]);fwrite(hFile, var);
                format(var, 64, "RadioOn/Off=%i\n", Info[playerid][StatRadio]);fwrite(hFile, var);
                format(var, 64, "Rango=%i\n", Info[playerid][Rango]);fwrite(hFile, var);
                format(var, 64, "Hora=%i\n", Info[playerid][Horas]);fwrite(hFile, var);
                format(var, 64, "Minutos=%i\n", Info[playerid][Mins]);fwrite(hFile, var);
                format(var, 64, "Segundos=%i\n", Info[playerid][Segs]);fwrite(hFile, var);
                format(var, 64, "PosX=%f\n", Info[playerid][Posx]);fwrite(hFile, var);
                format(var, 64, "PosY=%f\n", Info[playerid][Posy]);fwrite(hFile, var);
                format(var, 64, "PosZ=%i\n", Info[playerid][Posz]);fwrite(hFile, var);
                format(var, 64, "Casa1=%i\n", Info[playerid][Casas][0]);fwrite(hFile, var);
                format(var, 64, "Casa2=%i\n", Info[playerid][Casas][1]);fwrite(hFile, var);
                format(var, 64, "Banco=%i\n", Info[playerid][MoneyBanco]); fwrite(hFile, var);
                //format(var, 64, "=%i\n", Info[playerid][]);fwrite(hFile, var);
                fclose(hFile);
            }
    }
    return 1;
}

public Login(playerid,password[])
{
    //new tmp2[256];
    new string2[64];
    new fail[MAX_PLAYERS];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "Usuarios/%s.ini", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
        new PassData[256];
        new keytmp[256], valtmp[256];
        fread( UserFile , PassData , sizeof( PassData ) );
        keytmp = ini_GetKey( PassData );
        if( strcmp( keytmp , "Pass" , true ) == 0 )
        {
            valtmp = ini_GetValue( PassData );
            strmid(Info[playerid][Pass], valtmp, 0, strlen(valtmp)-1, 255);
        }
        if(strcmp(Info[playerid][Pass],password, true ) == 0 )
        {
                new key[ 256 ] , val[ 256 ];
                new Data[ 256 ];
                while ( fread( UserFile , Data , sizeof( Data ) ) )
                {
                    key = ini_GetKey( Data );
                    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Level] = strval( val ); }
                    if( strcmp( key , "Dinero" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Dinero] = strval( val ); }
                    if( strcmp( key , "Vida" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Vida] = floatstr( val ); }
                    if( strcmp( key , "DineroSusto" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][DineroSusto] = strval( val ); }
                    if( strcmp( key , "Faccion" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Faccion] = strval( val ); }
                    if( strcmp( key , "Job" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Job] = strval( val ); }
                    if( strcmp( key , "Radio" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Radio] = strval( val ); }
                    if( strcmp( key , "Frecuencia" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Frecuencia] = strval( val ); }
                    if( strcmp( key , "RadioOn/Off" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][StatRadio] = strval( val ); }
                    if( strcmp( key , "Rango" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Rango] = strval( val ); }
                    if( strcmp( key , "Hora" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Horas] = strval( val ); }
                    if( strcmp( key , "Minutos" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Mins] = strval( val ); }
                    if( strcmp( key , "Segundos" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Segs] = strval( val ); }
                    if( strcmp( key , "PosX" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Posx] = floatstr( val ); }
                    if( strcmp( key , "PosY" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Posy] = floatstr( val ); }
                    if( strcmp( key , "PosZ" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Posz] = floatstr( val ); }
                    if( strcmp( key , "Staff" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Staff] = strval( val ); }
                    if( strcmp( key , "Casa1" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Casas][0] = strval( val ); }
                    if( strcmp( key , "Casa2" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][Casas][1] = strval( val ); }
                    if( strcmp( key , "Banco" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][MoneyBanco] = strval( val ); }
                    //if( strcmp( key , "" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][] = strval( val ); }
                    //if( strcmp( key , "" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][] = strval( val ); }
                    //if( strcmp( key , "" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][] = strval( val ); }
                    //if( strcmp( key , "" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][] = strval( val ); }
                    //if( strcmp( key , "" , true ) == 0 ) { val = ini_GetValue( Data ); Info[playerid][] = strval( val ); }
                }
                fclose(UserFile);
        }
        else
        {
            ShowPlayerDialog(playerid,D_Logeo,DIALOG_STYLE_PASSWORD,"Role Play Latino","Usted a ingresado una contraseсa incorrecta\nPorfavor introdusca la verdadera contraseсa\nsi te la olvidaste puedes entrar a nuestro foro y imformarte del tema","Logear","Canselar");
            fail[playerid]++;
            if(fail[playerid] >= 3)
            {
                Error(playerid,"Usted a superado los maximo intento de logerase en RPL");
                Mensaje(playerid,Blanco,"Porfavor si usted se olvido de su contraseсa pidalo en nuestro foro "#WebPag" e imformese de como recuperarla");
                fail[playerid] = 0;
                Kick(playerid);
            }
        }
        SpawnPlayer(playerid);
        SetPlayerColor(playerid, PLAYERS_COLOR);
        TimeFromTimePlayer(playerid);
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid,Info[playerid][Dinero]);
        SetPlayerHealth(playerid,Info[playerid][Vida]);
        //SetPlayerPos(playerid,Info[playerid][Posx],Info[playerid][Posy],Info[playerid][Posz]); Terminar con el virtual world y interior
        Info[playerid][MoneyBanco] = 10000;
        Mensaje(playerid,Amarillo,MensajeAdm);
    }
    return 1;
}
Reply
#5

Me pasaba lo mismo con eso del logeo, el error era que no tenнa SetSpawnInfo, y al momento de agregarlo junto con SpawnPlayer, no paso mas, suerte con eso
Reply
#6

Claro, probб eso qeu te dice Lunnatiicz, ponйs SpawnPlayer sin poner previamente un SetSpawnInfo.
Reply
#7

Grasias Lunnatiicz Me sirvio +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)