native DOF2_SetFile(file[]);native DOF2_LoadFile();native DOF2_SaveFile();native DOF2_ParseFile(file[],extraid,bool:callback=true);native DOF2_ReparseFile(file[],extraid,bool:callback=true);native DOF2_WriteFile();native DOF2_PrintFile(comment[]=\"\");native DOF2_GetString(file[],key[],tag[]=\"\");native DOF2_GetStringEx(file[],key[],result[],size,tag[]=\"\");native Float:DOF2_GetFloat(file[],key[]);native DOF2_GetInt(file[],key[],tag[]=\"\");native DOF2_GetHex(file[],key[],tag[]=\"\");native DOF2_GetBin(file[],key[],tag[]=\"\");native bool:DOF2_GetBool(file[],key[],tag[]=\"\");native DOF2_SetString(file[],key[],value[],tag[]=\"\");native DOF2_SetFloat(file[],key[],Float:value);native DOF2_SetInt(file[],key[],value,tag[]=\"\");native DOF2_SetHex(file[],key[],value,tag[]=\"\");native DOF2_SetBin(file[],key[],value,tag[]=\"\");native DOF2_SetBool(file[],key[],bool:value,tag[]=\"\");native DOF2_IsSet(file[],key[],tag[]=\"\");native DOF2_Unset(file[],key[],tag[]=\"\");native DOF2_FileExists(file[]);native DOF2_RemoveFile(file[]);native DOF2_CreateFile(file[],password[]=\"\");native DOF2_RenameFile(oldfile[],newfile[]);native DOF2_RenameKey(file[],oldkey[],newkey[],tag[]=\"\");native DOF2_CopyFile(filetocopy[],newfile[]);native DOF2_CheckLogin(file[],password[]);native DOF2_File(user[]);native DOF2_ParseInt();native DOF2_ParseFloat();native DOF2_ParseBool();native DOF2_ParseBin();native DOF2_ParseHex();native DOF2_SetUTF8(bool:set);native bool:DOF2_GetUTF8();native DOF2_GetFile();native DOF2_MakeBackup(file[]);native DOF2_RemoveSection (file [], tag []);native DOF2_SectionExists (file [], tag []);native DOF2_SortSection (file [], tag [], bool: ignorecase = true, bool: ascending = true);native DOF2_SortAllSections (file [], bool: ignorecase = true, bool: ascending = true);native DOF2_SetCaseSensitivity (bool: set);native DOF2_GetCaseSensitivity ();
DOF2_CreateFile(\" Fálj neve . ini \");
DOF2_SetString( karakterlánc ,\" Fálj \", amit bele szeretnénk írni a fáljba );
DOF2_SetInt( karakterlánc ,\" Neve amit létrehozzon a mappában \", 0);
DOF2_SaveFile();
DOF2_FileExists
DOF2_GetInt( karakterlánc , \" Amit be szeretnénk tölteni..\" );
DOF2_WriteFile();
/* Double-O-Files_2 Register/Login system by Ty$oNDOF2 Tutorial By SmiTDouble-O-Seven for Double-O-Files_2 (DOF2)*/#include <a_samp>#include <Double-O-Files_2>#define DIALOG_REGISTER 1#define DIALOG_LOGIN 2#define WHITE \"{FFFFFF}\"#define RED \"{F81414}\"#define GREEN \"{00FF22}\"enum P_ENUM{ pMoney, pAdmin, pKills, pDeaths}new P_DATA[ MAX_PLAYERS ][ P_ENUM ];stock USER_FILE(playerid){ new STR[ 128 ], P_NAME[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, P_NAME, sizeof ( P_NAME ) ); format( STR, sizeof ( STR ), USER_FILE_PATH, P_NAME); return STR;}stock Load_Player_Stats(playerid){ P_DATA[ playerid ][ pKills ] = DOF2_GetInt( USER_FILE( playerid ),\"Olesek\"); P_DATA[ playerid ][ pDeaths ] = DOF2_GetInt( USER_FILE( playerid ),\"Halalok\"); P_DATA[ playerid ][ pMoney ] = DOF2_GetInt( USER_FILE( playerid ),\"Penz\"); P_DATA[ playerid ][ pAdmin ] = DOF2_GetInt( USER_FILE( playerid ),\"AdminSzint\"); GivePlayerMoney(playerid, P_DATA[ playerid ][ pMoney ]);}public OnFilterScriptInit(){ return 1;}public OnFilterScriptExit(){ DOF2_Exit(); return 1;}public OnPlayerRequestClass(playerid, classid){ return 1;}public OnPlayerConnect(playerid){ if( DOF2_FileExists ( USER_FILE ( playerid ) ) ) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"WHITE\"Belépés\",\"\"WHITE\"Üdvözöllek!\\n\"RED\"%s\\n\"WHITE\"Te már regisztrálva vagy!\\nLépj be!\",\"Belépés\",\"Kilépés\"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,\"\"WHITE\"Regisztráció\",\"\"WHITE\"Üdvözöllek!\\n\"RED\"%s\\n\"WHITE\"Te még nem vagy regisztrálva!\\nLépj be!\",\"Belépés\",\"Kilépés\"); } return 1;}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); switch( dialogid ) { case DIALOG_REGISTER: { if ( !response ) return Kick( playerid ); if( response ) { if( !strlen ( inputtext ) ) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"WHITE\"Belépés\",\"\"WHITE\"Üdvözöllek!\\n\"RED\"%s\\n\"WHITE\"Te már regisztrálva vagy!\\nLépj be!\",\"Belépés\",\"Kilépés\"); DOF2_CreateFile( USER_FILE ( playerid ), inputtext ); DOF2_SetInt( USER_FILE ( playerid ), \"Olesek\", 0); DOF2_SetInt( USER_FILE ( playerid ), \"Halalok\", 0); DOF2_SetInt( USER_FILE ( playerid ), \"Penz\", 1000); DOF2_SetInt( USER_FILE ( playerid ), \"AdminSzint\", 0); DOF2_SaveFile(); SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 ); SpawnPlayer( playerid ); GivePlayerMoney(playerid, 1000); } } case DIALOG_LOGIN: { if ( !response ) return Kick( playerid ); if( response ) { if( DOF2_CheckLogin( USER_FILE( playerid ), inputtext ) ) { Load_Player_Stats(playerid); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,\"\"WHITE\"Elfelejtett jelszó\",\"\"WHITE\"Rossz jelszót adtál meg!\\n\"RED\"%s\\n\"WHITE\"Írd be a jelszavadat!\",\"Belépés\",\"Kilépés\"); } return 1; } } } return 1;}public OnPlayerDisconnect(playerid, reason){ DOF2_SetInt( USER_FILE ( playerid ), \"Olesek\", P_DATA[ playerid ][ pKills ] ); DOF2_SetInt( USER_FILE ( playerid ), \"Halalok\", P_DATA[ playerid ][ pDeaths ] ); DOF2_SetInt( USER_FILE ( playerid ), \"Penz\", GetPlayerMoney( playerid ) ); DOF2_SetInt( USER_FILE ( playerid ), \"AdminSzint\", P_DATA[ playerid ][ pAdmin ] ); DOF2_SaveFile(); return 1;}public OnPlayerDeath(playerid, killerid, reason){ if( killerid != INVALID_PLAYER_ID ) { P_DATA[ playerid ][ pKills ] ++; } P_DATA[ playerid ][ pDeaths ] ++; return 1;}
#if defined _dof2_included#endinput#endif#define _dof2_included#include <a_samp>/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*//** This is a new version of the INI script Double-O-Files.* However, it\'s has completely been rewritten and has now a much better performance.* There is also the support for sections in the INI file. (But there is no support for comments.)* Double-O-Files 2 is compatible with DUDB, DINI, Double-O-Files and possibly y_ini since it* can handle sections and entry of the format \"key = value\", not only \"key=value\".* The number of spaces between the equal sign and key and value can actually be arbitrary.* I\'ve added some comments below. You may see that I\'ve mentioned the big-O-notation,* \'n\' always Entries.Count.* Double-O-Files 2 should also be useful for Russian letter because I\'m using* the functions fgetchar and fputchar to write and read the files.** There is another new feature which has been inspired by ZCMD and y_ini:* The OnParseFile callbacks. To learn more about it, read the description in* the SA-MP forums if you haven\'t already.* THE END*//*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*//*native DOF2_SetFile(file[]);native DOF2_LoadFile();native DOF2_SaveFile();native DOF2_ParseFile(file[],extraid,bool:callback=true);native DOF2_ReparseFile(file[],extraid,bool:callback=true);native DOF2_WriteFile();native DOF2_PrintFile(comment[]=\"\");native DOF2_GetString(file[],key[],tag[]=\"\");native DOF2_GetStringEx(file[],key[],result[],size,tag[]=\"\");native Float:DOF2_GetFloat(file[],key[]);native DOF2_GetInt(file[],key[],tag[]=\"\");native DOF2_GetHex(file[],key[],tag[]=\"\");native DOF2_GetBin(file[],key[],tag[]=\"\");native bool:DOF2_GetBool(file[],key[],tag[]=\"\");native DOF2_SetString(file[],key[],value[],tag[]=\"\");native DOF2_SetFloat(file[],key[],Float:value);native DOF2_SetInt(file[],key[],value,tag[]=\"\");native DOF2_SetHex(file[],key[],value,tag[]=\"\");native DOF2_SetBin(file[],key[],value,tag[]=\"\");native DOF2_SetBool(file[],key[],bool:value,tag[]=\"\");native DOF2_IsSet(file[],key[],tag[]=\"\");native DOF2_Unset(file[],key[],tag[]=\"\");native DOF2_FileExists(file[]);native DOF2_RemoveFile(file[]);native DOF2_CreateFile(file[],password[]=\"\");native DOF2_RenameFile(oldfile[],newfile[]);native DOF2_RenameKey(file[],oldkey[],newkey[],tag[]=\"\");native DOF2_CopyFile(filetocopy[],newfile[]);native DOF2_CheckLogin(file[],password[]);native DOF2_File(user[]);native DOF2_ParseInt();native DOF2_ParseFloat();native DOF2_ParseBool();native DOF2_ParseBin();native DOF2_ParseHex();native DOF2_SetUTF8(bool:set);native bool:DOF2_GetUTF8();native DOF2_GetFile();native DOF2_MakeBackup(file[]);native DOF2_RemoveSection (file [], tag []);native DOF2_SectionExists (file [], tag []);native DOF2_SortSection (file [], tag [], bool: ignorecase = true, bool: ascending = true);native DOF2_SortAllSections (file [], bool: ignorecase = true, bool: ascending = true);native DOF2_SetCaseSensitivity (bool: set);native DOF2_GetCaseSensitivity ();*/#define DOF2_TagExists DOF2_SectionExists#define DOF2_RemoveTag DOF2_RemoveSection// OnParseFile <Tag><Key>(extraid, value [])// OnParseFile <><Key>(extraid, value [])// OnDefaultParseFile (extraid, value [], key [], tag [], file [])// The arguments of your OnParseFile functions may have arbitrary names but must be an integer followed by a string.// Function must return a value.#define OnParseFile<%0><%1>(%2) \\forward _OnParseFile_%0_%1 (extraid, value []); \\public _OnParseFile_%0_%1 (extraid, value []) \\ return __OnParseFile_%0_%1 (extraid, (value
Frissítve: 2012.02.07[/quote]2013-at írunk.