SA-MP Forums Archive
[Ayuda] Guardado de score - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] Guardado de score (/showthread.php?tid=566141)



[Ayuda] Guardado de score - Darken3 - 03.03.2015

Hola.Quisiera que se guarde el score.Utilizo YSI_INI.


Respuesta: [Ayuda] Guardado de score - byAppeL - 03.03.2015

Dejanos algo de codigo , sino sera imposible ayudarte , adjunta el registro y el guardado al desconectarse de datos.


Respuesta: [Ayuda] Guardado de score - Ghost112397 - 03.03.2015

PHP код:
enum sas
{
    
pScore
}
new 
Informacion[MAX_PLAYERS][sas]

INI_WriteInt(VariableArchivo"Score"Informacion[playerid][pScore]);

INI_Int("Score",Informacion[playerid][pScore]); 



Respuesta: [Ayuda] Guardado de score - Darken3 - 04.03.2015

Код:
/*El sistema de registro
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registrando...",""COL_RED"Has escrito una clave invalida.\n"COL_WHITE"Escribe tu clave para registrar una nueva cuenta","Registrar","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
            }
        }
/*Cuando se desconecta/*
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Close(File);
    return 1;
}
/* Fordward de el sistema de Logeo*/
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Dinero",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Premiun",PlayerInfo[playerid][pPremiun]);
    INI_Int("Ropa",PlayerInfo[playerid][pRopa]);
    INI_Int("Muertes en contra",PlayerInfo[playerid][pDeaths]);
    return 1;
}