Dini help
#1

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;
}
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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 ^
Reply
#5

That doesn't work either, but I will check out y_ini. Any good tutorials you know of?
Reply
#6

Did you change the file location and file type?
Also there are many of them, check here: Link
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)