[Include] [INC]SimpleFiles - ۞ Save your accounts as easy as never before ۞
#1

SimpleFiles.inc - Save your accounts as easy as never before

SimpleFiles is an include to save accounts.
I though i want to create a file include which is clear and easy to use.
So i started to create SimpleFiles:
-It's based on dini and dutils and it also includes "encode" and "decode" from dudb.
-The passwords are in hash format.
-There are only easy functions
-The second pack includes a Register+Login FS

_________________________________________________

© Copyright by Rafelder
Credits to:
-DracoBlue for encode and decode
-wiki.sa-mp for hash
-Rafelder for SimpleFiles

_________________________________________________

Register+Login FS:
-Command: /register [password], /login [password], /setpass [old password] [new password] [new password again]
-Saves just money at the moment but you can edit it.
-Scripted with SimpleFiles

_________________________________________________

FileCreate(filename[], password[]);
Creates a new files with an hash password if it doesn't exist already.

FileDelete(filename[]);
Deletes a file if the filename exists.

FileExists(filename[])
Checks if the filename exists.

SaveFileString(filename[], key[], string[]);
Saves a string into a given key in a given file.

SaveFileInteger(filename[], key[], integer);
Saves a integer into a given key in a given file.

SaveFileFloat(filename[], key[], Float:float);
Saves a float into a given key in a given file.

GetFileString(filename[], key[]);
Returns a string of a given key in a given file.

GetFileInteger(filename[], key[]);
Returns a integer of a given key in a given file.

GetFileFloat(filename[], key[]);
Returns a float of a given key in a given file.

IsRightPassword(filename[], password[])
Checks the password with hash.

ChangePassword(filename[], newpassword[]);
Changes the password in hash format.

EditFileName(filename[], newname[]);
Changes the filename.

_________________________________________________

To check a password (for example in /login) use:
pawn Код:
if (strcmp(cmd, "/login", true) == 0)
{
new playerpassword[256];
playerpassword = strtok(cmdtext, idx);
if (IsRightPassword(PlayerName(playerid), playerpassword)) {//Use this line to check passwords
//Do something if its right
} else {
//Do something if its wrong
}
return 1;
}
_________________________________________________

Please write a comment if you download the file
I would be happy.

SimpleFiles.inc + Testmode <=> SimpleFiles.inc + Testmode + Register/Login FS
Reply
#2

oooh nice
Reply
#3

N I C E !!!!
Reply
#4

Quote:
Originally Posted by [M
kc ]
oooh nice
Quote:
Originally Posted by [M
cmg4life ]
N I C E !!!!
Thanks and thanks
Reply
#5

Wath is best? Dini or SimpleFiles?

//EDIT: 100 post
Reply
#6

It's basically the same exact thing with name changes and adding of passwords.
Reply
#7

Nice enough
Reply
#8

Buth dini it takes many memories
Reply
#9

Quote:
Originally Posted by [P7
Pixels^ ]
It's basically the same exact thing with name changes and adding of passwords.
I said i want to have a easy include with easy functions
And dini doesn't use hash+encode+decode.
dubd uses this functions but i think dudb isn't as easy as SimpleFiles
Quote:
Originally Posted by Maniek
Wath is best? Dini or SimpleFiles?
SimpleFiles is based on dini
Reply
#10

Quote:

Buth dini it takes many memories

Not really.
pawn Код:
//FileCreate(filename[], password[]); is the same as
dini_Create(filename[])
dini_Set(filename[],"password",password);
Reply
#11

this is automatic yo = translation = good
Reply
#12

Quote:
Originally Posted by Cale
this is automatic yo = translation = good
Thanks

I updated the file, now it includes a Register+Login FS in SimpleFiles format.
Look at the first post.
Reply
#13

I could hug you right now!!!! Just what I needed, Functions that proclaim!! the name.
Reply
#14

THANNNNKSSSSS!!!!!!!!!! Man ur a god i needed this to create my rpg server and i dont know how to use dudb thanks mannnn!!!!!!!!!!!!!!!
Reply
#15

Quote:
Originally Posted by waxhunter
i needed this to create my rpg server and i dont know how to use dudb thanks mannnn!
Thats the reason why i made this include. Thanks
Reply
#16

hey so i did a stats saving thing, well , saves them , but doesnt load them, WHY ?

http://pawn.pastebin.com/m7cfb041f

and the prints show up :P
Reply
#17

Because SimpleFiles saves files as txt file: *.txt
Reply
#18

so instead of ini i use .txt ?

tryed now doesnt save/load a thing


could u do it working ? also i removed password[] from FileCreate :P
Reply
#19

Nice one! I've just checked it out but, the weird thing is that it can't compile. I get 7 errors, 6 of these: "array sizes do not match, or destination array is too small" and one "symbol already defined: "strtok". I realize that it says it has strtok already defined, so I placed // in front of the "extra strtok" and my PAWN compiler crashed. The "array sizes do not match..." are caused by the extra strtok, but I really have no idea how to fix it. Do you have maybe any idea on what else could I try to fix up these errors?
Reply
#20

nice
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)