Originally Posted by Harrinston
pawn Код:
SaveDate(playerid) { new File:handle = fopen("tuarchivo.txt", io_write); new string[TAMAСO DE LO QUE VAS A GUARDAR], name[MAX_PLAYER_NAME], Float:x, Float:y, Float:z; GetPlayerName(playerid, name, MAX_PLAYER_NAME); GetPlayerPos(playerid, x, y, z); format(string, sizeof(string), "%s, %s, %f, %f, %f, %d", name, variablepass, x, y, z, GetPlayerSkin(playerid)); fwrite(handle, string); fclose(handle); return 1; }
Eso es para guardar, aunque hay mбs mйtodos de hacerlo por otros sistemas y demбs.
Y esto es para cargar:
pawn Код:
LoadMapIcons() { new File:handle = fopen("tuarchivo.txt", io_read); if(fexist("tuarchivo.txt")) { new Float:x, Float:y, Float:z, line[256], CountAccounts = 0; // y mбs variables while(fread(handle, line)) { if(!unformat(line, "p<SEPARADO>tus variables", variables)) { //Aquн cargas las variables del jugador asignandole a cada uno la variable determinada que separу el unformat CountAccounts++; } } fclose(handle); printf("Fueron cargados %d cuentas desde el archivo 'tuarchivo.txt'.", CountAccounts); return 1; } else return 0; }
Asн cargaba yo las cosas y las guardaba aunque hace mucho que ya no toco file, estoy usando mбs MySQL. Me duele un poco la cabeza ahora, disculpas si lo hice desordenado o hay algъn error de ortografнa. Me pareciу mбs efectivo ayudarte que no responder nada.
|