Dini help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dini help (
/showthread.php?tid=306802)
Dini help -
luigifan9 - 28.12.2011
I am trying to get it so if you join the server and you don't have a save file it will create one, but it doesn't work.
Код:
public OnPlayerConnect(playerid)
{
M_OnPlayerConnect(playerid);
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined the server.", name);
SendClientMessageToAll(0xC4C4C4FF, string);
if (dini_Exists(name) == true)
{
return 1;
}
else
dini_Create(name);
return 1;
}
Re: Dini help -
Tee - 28.12.2011
I've stopped using Dini a long time ago, but give this a shot.
pawn Код:
public OnPlayerConnect(playerid)
{
M_OnPlayerConnect(playerid);
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined the server.", name);
SendClientMessageToAll(0xC4C4C4FF, string);
format(string,sizeof(string),"Accounts/%s.ini",name);//Change that to the folder where you store your user files and change the file type (if it's not .ini)
if(dini_Exists(string))return 1;//If it exists, it willl return 1 so it won't create the file.
dini_Create(string);//If it didn't return 1 then the file will be created.
return 1;
}
Re: Dini help -
luigifan9 - 28.12.2011
When I joined the server crashed 0.o Nothing about it in the server log either...
Is there a plugin similar to Dini that is simpler? I thought I had heard of something at one point.
Re: Dini help -
Tee - 28.12.2011
Well you have Y_INI, and MySQL
.
Edit: Remember to change your folder location and file type form what I have to what you use. "FOLDER/%s.FILETYPE"
pawn Код:
public OnPlayerConnect(playerid)
{
M_OnPlayerConnect(playerid);
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined the server.", name);
SendClientMessageToAll(0xC4C4C4FF, string);
format(string,sizeof(string),"Accounts/%s.ini",name);//Change that to the folder where you store your user files and change the file type (if it's not .ini)
if(!dini_Exists(string))
{
dini_Create(string);
}
return 1;
}
Try that ^
Re: Dini help -
luigifan9 - 28.12.2011
That doesn't work either, but I will check out y_ini. Any good tutorials you know of?
Re: Dini help -
Tee - 28.12.2011
Did you change the file location and file type?
Also there are many of them, check here:
Link