files doesnt save
#1

i got a weird problem and that the files doesnt save if anyboddy can fix , please do it , here is it :

Код:
#include <a_samp>
#include <dini>
#include <dutils>
#include <dudb>
#pragma unused ret_memcpy
#define UserPath "VIP"



enum Info
{
  	PName[MAX_PLAYER_NAME],
	Pip[16],
  	VIP,
}
new PlayerInfo[MAX_PLAYERS][Info];


public OnPlayerConnect(playerid)
{
  new FilePath[32];
  new Ip[16];
  GetPlayerIp(playerid,Ip,sizeof(Ip));

  format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid));
  if(!dini_Exists(FilePath)) {
    dini_Create(FilePath);
    dini_Set(FilePath, "Name", PlayerName(playerid));
    dini_Set(FilePath, "Ip", Ip);
    dini_IntSet(FilePath, "VIP", 0);
  }
  return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
  new FilePath[32];
  new Ip[16];
  format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid));
	dini_Set(FilePath, "Name", PlayerName(playerid));
  dini_Set(FilePath, "Ip", Ip);
  dini_IntSet(FilePath, "VIP", 0);

	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
if(strcmp(cmd, "/vr", true) == 0) {
if(PlayerInfo[playerid][VIP]) {
SetPlayerHealth(playerid,100.0);
}
return 1;
}
return 0;
}
stock PlayerName(playerid) {
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  return name;
}
Reply
#2

u got it to save and wrong place it should be like

From This
Код:
  format(FilePath, sizeof(FilePath), "%s/%s.ini", UserPath, PlayerName(playerid));
To SOme like this
Код:
format(string3, sizeof(string3), "Accounts/%s.ini", playername3);
Reply
#3

dude i defined a user patch , it doesn't have for the folder to be called accounts !?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)