Turfs reload problem [HELP PLEASE]
#4

can give me code please help please
PHP код:
forward LoadTurfs();
public 
LoadTurfs()
{
    new 
arrCoords[14][256];
    new 
strFromFile2[256];
    new 
Filefile fopen("Factions/Turfs.ini"io_read);
    if (
file)
    {
        new 
playerid;
        while (
playerid sizeof(turfs))
        {
            
fread(filestrFromFile2);
            
split(strFromFile2arrCoords'|');
            
turfs[playerid][turfID] = strval(arrCoords[0]);
            
strmid(turfs[playerid][turfName], arrCoords[1], 0strlen(arrCoords[0]), 255);
            
strmid(turfs[playerid][cityName], arrCoords[2], 0strlen(arrCoords[0]), 255);
            
turfs[playerid][zMinX] = strval(arrCoords[3]);
            
turfs[playerid][zMinY] = strval(arrCoords[4]);
            
turfs[playerid][zMaxX] = strval(arrCoords[5]);
            
turfs[playerid][zMaxY] = strval(arrCoords[6]);
            
strmid(turfs[playerid][TurfColor], arrCoords[7], 0strlen(arrCoords[0]), 255);
            
strmid(turfs[playerid][TurfOwner], arrCoords[8], 0strlen(arrCoords[0]), 255);
            
turfs[playerid][TurfAttacker] = strval(arrCoords[9]);
            
turfs[playerid][TurfKills] = strval(arrCoords[10]);
            
turfs[playerid][TurfAttackKills] = strval(arrCoords[11]);
            
turfs[playerid][TurfWarStarted] = strval(arrCoords[12]);
            
turfs[playerid][MIT] = strval(arrCoords[13]);
            
playerid++;
        }
        
fclose(file);
     }
    return 
1;

PHP код:
forward SaveTurfs();
public 
SaveTurfs()
{
    new 
idx;
    new 
Filefile2;
    while (
idx sizeof(turfs))
    {
        new 
coordsstring[512];
        
format(coordsstringsizeof(coordsstring), "%d|%s|%s|%d|%d|%d|%d|||%d|%d|%d|%d|%d___________________\n",
            
turfs[idx][turfID],
            
turfs[idx][turfName],
            
turfs[idx][cityName],
            
turfs[idx][zMinX],
            
turfs[idx][zMinY],
            
turfs[idx][zMaxX],
            
turfs[idx][zMaxY],
            
turfs[idx][TurfColor],
            
turfs[idx][TurfOwner],
            
turfs[idx][TurfAttacker],
            
turfs[idx][TurfKills],
            
turfs[idx][TurfAttackKills],
            
turfs[idx][TurfWarStarted],
            
turfs[idx][MIT]);
        if(
idx == 0)
        {
            
file2 fopen("Factions/Turfs.ini"io_write);
        }
        else
        {
            
file2 fopen("Factions/Turfs.ini"io_append);
        }
        
fwrite(file2coordsstring);
        
idx++;
        
fclose(file2);
    }
    return 
1;

I dont save Turf Owner and Turf Color help me guys
Reply


Messages In This Thread
Turfs reload problem [HELP PLEASE] - by Cr3dO - 29.03.2015, 16:36
Re: Turfs reload problem [HELP PLEASE] - by CoachCarter - 29.03.2015, 17:11
Re: Turfs reload problem [HELP PLEASE] - by CalvinC - 29.03.2015, 18:24
Re: Turfs reload problem [HELP PLEASE] - by Cr3dO - 30.03.2015, 19:25
Re: Turfs reload problem [HELP PLEASE] - by CalvinC - 31.03.2015, 07:38

Forum Jump:


Users browsing this thread: 1 Guest(s)