[Ajuda] Como fazer isso...
#1

Код:
	new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"data");
        INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
	INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
	INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
	INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
	INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
	INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
	INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
	INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
	INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
	INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
	INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
	INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
	INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
	INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
	INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
	INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
	INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
	INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
	INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
    INI_Close(File);
Isso ta na public OnPlayerDisconnect, como eu posso fazer o mesmo so que para pegar os dados
Reply
#2

Nгo mecho com INI, mas creio que seja uma funзгo como essa
pawn Код:
INI_GetInt
Da uma pesquisada sobre essa include, duvido que vocк nгo ache nada.
Reply
#3

cara deu uma boa prucurada sobre tutoriais dessa inc nao achei nada cara
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=175565

Vocк ta querendo tipo, carregar os dados? Se for й INI_Int
Reply
#5

Use INI_ParseFile...

pawn Код:
forward carregar(playerid, name[], value[]);
public carregar(playerid, name[], value[]) {
    INI_Int("dinheiro", array_do_dinheiro);
    INI_Int("level", array_do_level);
    return 1;
}
//Quando o jogador logar
INI_ParseFile(ARQUIVO, "carregar", false, true, playerid);
Reply
#6

#include <YSI\y_ini>

essa, mesma coisa nй ?
Reply
#7

Quote:
Originally Posted by Exco
Посмотреть сообщение
#include <YSI\y_ini>

essa, mesma coisa nй ?
Sim.
Reply
#8

Код:
#define PATH "/Users/%s.ini"I

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Age",PlayerInfo[playerid][pAge]);
    INI_Int("Origin",PlayerInfo[playerid][pOrigin]);
    INI_Int("Sex",PlayerInfo[playerid][pSex]);
    INI_Int("Model",PlayerInfo[playerid][pModel]);
    INI_Int("DriveLic",PlayerInfo[playerid][pDriveLic]);
    INI_Int("Place",PlayerInfo[playerid][pPlace]);
    INI_Int("Exp",PlayerInfo[playerid][pExp]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Number",PlayerInfo[playerid][pNumber]);
    INI_Int("Tester",PlayerInfo[playerid][pTester]);
    INI_Int("Warns",PlayerInfo[playerid][pWarns]);
    INI_Int("Selected",PlayerInfo[playerid][pSelected]);
    INI_Int("Muted",PlayerInfo[playerid][pMuted]);
    INI_Int("MuteTime",PlayerInfo[playerid][pMuteTime]);
    INI_Int("FirstJoined",PlayerInfo[playerid][pFirstJoined]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Spawn",PlayerInfo[playerid][pSpawn]);
    INI_Int("Locked",PlayerInfo[playerid][pLocked]);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"data");
        INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
	INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
	INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
	INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
	INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
	INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
	INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
	INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
	INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
	INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
	INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
	INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
	INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
	INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
	INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
	INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
	INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
	INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
	INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
        INI_Close(File);
	return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1234)
	{
		if(!response)  return Kick(playerid);
		if(response)
		{
			if(fexist(UserPath(playerid)))
			{
				INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
				ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
			}
			else 
                        }
				ShowPlayerDialog(playerid, 1,    DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new      account.","Register","Quit");
			}
		}
	}
}
ainda continua o erro alguem tem uma idea coloquei o codico assima
Reply
#9

Onde estб o erro? que linha

Eu tambйm uso esse sistema de salvamento e ta tudo certinho atй agora, rs
Reply
#10

entao eu tbm nao sei cara tipo eu spawno tudo zerado sem grana sem respeito sem nada sem grana tipo o skin vem correto so isso
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)