need help
#2

Quote:
Originally Posted by [AC
Etch ]
i am creating a vip system which all users should save to scriptfiles/vip but the problem is players join and no files get created in the folder , here is the code :
Код:
public OnPlayerConnect(playerid)
{
  new file[100];
	new Name[MAX_PLAYER_NAME];
	new Ip[16];
	GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
  if(!dini_Exists(file)) {
		dini_Create(file);
		dini_Set(file,"Name",Name);
		dini_Set(file,"Ip",Ip);
		dini_IntSet(file,"VIP",0);
		}
  strcat(PlayerInfo[playerid][PName],					dini_Get(file,"Name"));
	strcat(PlayerInfo[playerid][Pip],					dini_Get(file,"Ip"));
	PlayerInfo[playerid][VIP] 			   = dini_Int(file,"VIP");
	return 1;
	}
You don't define file path on your file string.
You have it now
Код:
format(file, sizeof(file), PlayerFile, Name);
You should use like.
Код:
format(file, sizeof(file), "vip/%s.ini", Name);
This code would create file named by players name in folder \..\scriptfiles\vip\
Reply


Messages In This Thread
need help - by aircombat - 12.03.2010, 11:37
Re: need help - by lameguy - 12.03.2010, 11:40
Re: need help - by aircombat - 12.03.2010, 11:44
Re: need help - by lameguy - 12.03.2010, 11:50
Re: need help - by aircombat - 12.03.2010, 13:43
Re: need help - by lameguy - 12.03.2010, 14:15
Re: need help - by aircombat - 12.03.2010, 15:45
Re: need help - by lameguy - 12.03.2010, 19:38
Re: need help - by aircombat - 12.03.2010, 20:49
Re: need help - by SlashPT - 12.03.2010, 20:52

Forum Jump:


Users browsing this thread: 1 Guest(s)