saving player
#1

I want to make a login register system, so I decided to make it with fread, etc.

Cand somebody learn me how to manipulate them? In any language I was never supposed to make scripts who write on file
Reply
#2

Either use ini processor or MySQL. Use ini if you want to save the stuff in a file.
Here's a tutorial of creating a y_ini login and register system: https://sampforum.blast.hk/showthread.php?tid=273088
I use dini2 though because I think it's easier and is supposed to be faster (not sure about that, but that's what the creator said :P)
Reply
#3

I want to go with fread, fwrite, etc, because I want to make it easy.

Quote:

public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME],
string[128];

GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s {FFFFFF}a intrat pe server", name);
SendClientMessageToAll(rosu, string);
format(SaveLocation, sizeof(SaveLocation), "users/%s.ini", name);

if(!fexist(SaveLocation))
{
new File:fhandle = fopen(SaveLocation, io_write), print[128];
format(print, sizeof(print), "Money = %i \r\nBankM = %i \r\nAdmin = %i \r\nBan = %i", 100, 100, 0, 0);
fwrite(fhandle, print);
fclose(fhandle);
}
return 1;
}

But how I read it.
Reply
#4

Dude, if you want to make it easy and fast you need to use an ini processor. Using only file functions makes it harder and slow. Look into an ini processor include. You will see that the code is pretty big and requires a lot of work. Your gamemode is not going to be too good if you are not going to use any includes.
Reply
#5

Ok, I downloaded dini, but how I use it? can you tell me functions?
Reply
#6

Download YINI 4..

Here is tut: https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#7

Dini register/login system tutorial here: https://sampforum.blast.hk/showthread.php?tid=308390
Functions are the same. Dini2 is just a faster version of dini. You got dini2, right?
This is the dini2 page, also there are all the functions: https://sampforum.blast.hk/showthread.php?tid=611399
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)