stock SaveData(playerid)//adatok mentése.{new string[200];format(string,sizeof(string),\"Users/%s.ini\",pName(playerid));new Float:X,Float:Y,Float:Z;GetPlayerPos(playerid,X,Y,Z); dfile_Open(string); dfile_MultiSet(\"fff\", \"PosX\",X, \"PosY\",Y, \"PosZ\",Z ); dfile_SaveFile(); dfile_CloseFile();return true;}
stock LoadData(playerid){ new string[200];format(string,sizeof(string),\"Users/%s.ini\",pName(playerid)); dfile_Open(string);dfile_MultiGet(\"fff\", \"PosX\",pInfo[playerid][PosX], \"PosY\",pInfo[playerid][PosY], \"PosZ\",pInfo[playerid][PosZ] );dfile_CloseFile();SetPlayerPos(playerid,pInfo[playerid][PosX],pInfo[playerid][PosY],pInfo[playerid][PosZ]);return true;}
#include a_samp#include dini#include dfilepublic OnPlayerDisconnect(playerid, reason){new Float:pos[3], string[256], string2[256];GetPlayerPos(playerid, pos[0], pos[1], pos[2]);format(string, sizeof(string), \"TesztDFILE/%s.ini\", pName(playerid)); // dfileformat(string2, sizeof(string2), \"TesztDINI/%s.ini\", pName(playerid)); // dinidfile_Create(string); // Létrehozomdfile_Open(string); // Megnyitom dfile_MultiSet(\"fff\", \"PosX\", pos[0], \"PosY\", pos[1], \"PosZ\", pos[2]); // Beleírom dfile_SaveFile(); // Elmentem dfile_CloseFile(); // Bezárom dini_Create(string2); dini_FloatSet(string2, \"PosX\", pos[0]); dini_FloatSet(string2, \"PosY\", pos[1]); dini_FloatSet(string2, \"PosZ\", pos[2]);return 1;}stock pName(playerid){new n[24];GetPlayerName(playerid, n, 24);return n;}
stock LoadData(playerid){ new string[200]; format(string,sizeof(string),\"Users/%s.ini\",pName(playerid)); dfile_Open(string); pInfo[playerid][PosX] = dfile_ReadFloat(\"PosX\"); pInfo[playerid][PosY] = dfile_ReadFloat(\"PosY\"); pInfo[playerid][PosZ] = dfile_ReadFloat(\"PosZ\"); dfile_CloseFile(); SetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]); return 1;}
#include a_samp#include dini#include dfilepublic CallMePlease(playerid);public OnPlayerSpawn(playerid){SetTimerEx(\"CallMePlease\", 4000, false, \"i\", playerid);return 1;}public OnPlayerDisconnect(playerid, reason){new Float:pos[3], string[256], string2[256];GetPlayerPos(playerid, pos[0], pos[1], pos[2]);format(string, sizeof(string), \"TesztDFILE/%s.ini\", pName(playerid)); // dfileformat(string2, sizeof(string2), \"TesztDINI/%s.ini\", pName(playerid)); // dini dfile_Create(string); // Létrehozomdfile_Open(string); // Megnyitom dfile_MultiSet(\"fff\", \"PosX\", pos[0], \"PosY\", pos[1], \"PosZ\", pos[2]); // Beleírom dfile_SaveFile(); // Elmentem dfile_CloseFile(); // Bezárom dini_Create(string2); dini_FloatSet(string2, \"PosX\", pos[0]); dini_FloatSet(string2, \"PosY\", pos[1]); dini_FloatSet(string2, \"PosZ\", pos[2]);return 1;}public CallMePlease(playerid){SendClientMessage(playerid, -1, \"CallMePlease meghívva!\");new Float:pos[3], string[256], msg[128];format(string, sizeof(string), \"TesztDFILE/%s.ini\", pName(playerid));dfile_Open(string);//dfile_MultiGet(\"fff\", pos[0], \"PosY\", pos[1], \"PosZ\", pos[2]);pos[0] = dfile_ReadFloat(\"PosX\");pos[1] = dfile_ReadFloat(\"PosY\");pos[2] = dfile_ReadFloat(\"PosZ\");SetPlayerPos(playerid, pos[0], pos[1], pos[2]);SendClientMessage(playerid, -1, \"Beolvasott koordináták:\");format(msg, 128, \"X: %f | Y: %f | Z: %f\", pos[0], pos[1], pos[2]);SendClientMessage(playerid, -1, msg);dfile_CloseFile();return 1;}stock pName(playerid){new n[24];GetPlayerName(playerid, n, 24);return n;}