[Pedido] DOF2 nгo escreve em arquivo
#1

Eae galera, eu sou novo em pawn, depois de procurar um pouco mais sobre dof2 criei esse fs, que nгo esta escrevendo as informaзхes no aquivo, e tambem nгo esta colocando o nome do player no arquivo, alguem poderia corrigi-lo pra mim?

Код:
#include <a_samp>
#include <dof2>

#if defined FILTERSCRIPT

#define VIP "VIP/%s.ini

new Vip [MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	//
	
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
	if(!DOF2_FileExists("VIP/%s.ini"))
	{
	    DOF2_CreateFile("VIP/%s.ini");
	}
	return 1;
}
Reply
#2

Editado: Como vocк quer que o DOF2 crie um arquivo que nem foi formatado? Vocк tб colocando o arquivo direto nos parвmetros sem ter formatado ele com o nome do player, dб uma olhada em alguns tutoriais sobre DOF2 pra vocк entender como funciona.
Reply
#3

Oloco, agora que vi ipsLeon, o code veio pela metade '-', aqui estб o code completo:

Код:
#include <a_samp>
#include <dof2>

#if defined FILTERSCRIPT

#define VIP "VIP/%s.ini

new Vip [MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	//
	
	return 1;
}

public OnFilterScriptExit()
{
    DOF2_Exit("VIP/%s.ini");
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
	if(!DOF2_FileExists("VIP/%s.ini"))
	{
	    DOF2_CreateFile("VIP/%s.ini");
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new Nome[MAX_PLAYER_NAME];
	new VIP[64];
	new Float:Level;
	GetPlayerScore(playerid, Level);
	DOF2_SetFloat("VIP/%s.ini");
	new String[50];
    format(String, sizeof(String), VIP, Nome);
    DOF2_SetFloat(String,"Level", Level);
    DOF2_SaveFile("VIP/%s.ini");
	return 1;
}

public OnPlayerSpawn(playerid)
{
	new VIP[64];
	new Nome[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), VIP, Nome);
    SetPlayerScore(playerid, DOF2_GetFloat(String,"Level"));
	return 1;
}

#endif
Reply
#4

Quote:

DOF2_FileExists("VIP/%s.ini");
DOF2_CreateFile("VIP/%s.ini");
DOF2_SetFloat("VIP/%s.ini");
DOF2_SaveFile("VIP/%s.ini");

Cadк os formats?
Reply
#5

Ata, tendi, Leon, conhece algum tutorial que explique bem sobre dof2? E vlw ae pela ajuda
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)