Turfs reload problem [HELP PLEASE]
#1

PHP код:
enum tinfo
{
     
turfID,
      
turfName40 ],
      
cityName40 ],
     
Float:zMinX,
     
Float:zMinY,
     
Float:zMaxX,
     
Float:zMaxY,
     
TurfColor40 ],
     
TurfOwner40 ],
     
TurfAttacker,
     
TurfKills,
     
TurfAttackKills,
     
TurfWarStarted,
     
MIT
}
new 
turfs[MAX_TURFS][tinfo] = {
{  
0"Grove Street",      "LS"2440.60, -1629.702540.90, -1723.70,  COLOR_GREEN,   TEAM_GROVE,   -10000},
{  
1"Ganton",            "LS"2440.60, -1629.702226.30, -1723.70COLOR_GREEN,   TEAM_GROVE,   -10000},
{  
2"Idlewood",          "LS"1812.60, -1852.801971.60, -1742.30CIVILIAN_COLOR,  TEAM_CIVILIAN,  -10000},
{  
3"Idlewood",          "LS"1951.60, -1742.302124.60, -1602.30CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
{  
4"Idlewood",          "LS"1812.60, -1602.302124.60, -1449.60CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
{  
5"Idlewood",          "LS"2124.60, -1742.302222.50, -1494.00CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
{  
6"Idlewood",          "LS"1971.60, -1852.802222.50, -1742.30CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
{  
7"Idlewood",          "LS"1812.60, -1742.301951.60, -1602.30CIVILIAN_COLOR,  TEAM_CIVILIAN,  -10000},
{  
8"Willow Field",      "LS"1970.60, -2179.202089.00, -1852.80AZTECA_COLOR,  TEAM_AZTECAS,  -10000},
{  
9"Willow Field",      "LS"2089.00, -1989.902324.00, -1852.80AZTECA_COLOR,  TEAM_AZTECAS,  -10000},
10"Willow Field",      "LS"2089.00, -2235.802201.80, -1989.90AZTECA_COLOR,  TEAM_AZTECAS,  -10000},
11"Jefferson",         "LS"2056.80, -1372.002281.40, -1210.70BALLA_COLOR,   TEAM_BALLAS,   -10000},
12"Jefferson",         "LS"2056.80, -1210.702185.30, -1126.30BALLA_COLOR,   TEAM_BALLAS,   -10000},
13"Jefferson",         "LS"2056.80, -1449.602266.20, -1372.00BALLA_COLOR,   TEAM_BALLAS,   -10000},
14"East Los Santos",   "LS"2421.00, -1628.502632.80, -1454.30CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
15"East Los Santos",   "LS"2222.50, -1628.502421.00, -1494.00CIVILIAN_COLOR,   TEAM_CIVILIAN,   -10000},
16"East Los Santos",   "LS"2266.20, -1494.002381.60, -1372.00BALLA_COLOR,   TEAM_BALLAS,   -10000},
17"East Los Santos",   "LS"2281.60, -1372.002381.60, -1135.00BALLA_COLOR,   TEAM_BALLAS,   -10000},
18"East Los Santos",   "LS"2381.60, -1454.302462.10, -1135.00VAGOS_COLOR,   TEAM_VAGOS,   -10000},
19"East Los Santos",   "LS"2462.10, -1454.302581.70, -1135.00VAGOS_COLOR,   TEAM_VAGOS,   -10000},
20"El Corona",         "LS"1812.60, -2179.201970.60, -1852.80AZTECA_COLOR,  TEAM_AZTECAS,  -10000},
21"El Corona",         "LS"1692.60, -2179.201812.60, -1842.20AZTECA_COLOR,  TEAM_AZTECAS,  -10000},
22"Glen Park",         "LS"1812.60, -1350.702056.80, -1100.80BALLA_COLOR,   TEAM_BALLAS,   -10000},
23"Los Flores",        "LS"2581.70, -1393.402747.70, -1135.00VAGOS_COLOR,   TEAM_VAGOS,   -10000},
24"Las Colinas",       "LS"1994.30, -1100.802056.80,  -920.80BALLA_COLOR,   TEAM_BALLAS,   -10000},
25"Las Colinas",       "LS"2056.80, -1126.302126.80,  -920.80BALLA_COLOR,   TEAM_BALLAS,   -10000},
26"Las Colinas",       "LS"2185.30, -1154.502281.40,  -934.40VAGOS_COLOR,   TEAM_VAGOS,   -10000},
27"Las Colinas",       "LS"2126.80, -1126.302185.30,  -934.40VAGOS_COLOR,   TEAM_VAGOS,   -10000},
28"Las Colinas",       "LS"2632.70, -1135.002747.70,  -945.00VAGOS_COLOR,   TEAM_VAGOS,   -10000},
29"Las Colinas",       "LS"2281.40, -1135.002632.70,  -945.00VAGOS_COLOR,   TEAM_VAGOS,   -10000},
30"Temple",       "LS"1153.92, -1158.211344.07, -1025.30TRIAD_COLOR,   TEAM_TRIADS,   -10000},
31"Temple",       "LS"954.83, -1158.211153.92, -1025.30TRIAD_COLOR,   TEAM_TRIADS,   -10000},
32"Vinewood",       "LS"789.10, -1158.21954.83, -936.29TRIAD_COLOR,   TEAM_TRIADS,   -10000},
33"Temple",       "LS"954.75, -1025.301152.46, -936.29TRIAD_COLOR,   TEAM_TRIADS,   -10000},
34"Temple",       "LS"1049.42, -1289.621221.19, -1158.21TRIAD_COLOR,   TEAM_TRIADS,   -10000},
35"Temple",       "LS"1221.19, -1289.621341.26, -1158.21TRIAD_COLOR,   TEAM_TRIADS,   -10000},
36"Vinewood",       "LS"1153.92, -1025.301341.26, -862.01TRIAD_COLOR,   TEAM_TRIADS,   -10000},
37"Verona Beach",       "LS"1145.10, -1718.261292.30, -1565.49DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
38"Verona Beach",       "LS"1041.96, -1718.261145.10, -1565.49DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
39"Conference Center",       "LS"1041.96, -1860.831177.37, -1718.26DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
40"Conference Center",       "LS"1177.37, -1860.831292.30, -1718.26DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
41"Verona Beach",       "LS"910.96, -1860.831041.96, -1718.26DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
42"Verona Beach",       "LS"910.96, -1718.261041.96, -1410.60DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
43"Market",       "LS"1041.96, -1565.491347.25, -1410.60DANANGBOYS_COLOR,   TEAM_DANANGBOYS,   -10000},
44"Santa Maria Beach",       "LS"349.85, -2088.68622.75,-1684.52CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
45"Santa Maria Beach",       "LS"622.75, -2088.68804.95, -1684.52CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
46"Verona Beach",       "LS"804.95, -2088.68912.48, -1684.52CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
46"Rodeo",       "LS"359.47, -1684.52522.61, -1410.60CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
47"Rodeo",       "LS"522.61, -1684.52629.04, -1410.60CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
48"Marina",       "LS"629.04, -1684.52792.07, -1410.60CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
49"Verona Beach",       "LS"792.07, -1684.52910.96, -1410.60CRIPZ_COLOR,   TEAM_CRIPZ,   -10000},
50"Verona Beach",       "LS"912.48, -2088.681057.43, -1860.83CRIPZ_COLOR,   TEAM_CRIPZ,   -10000}
};
new 
TurfInfo[MAX_TURFS][MAX_TEAMS][tinfo]; 
How to a save turfs and load Help me please please
Reply
#2

You should have some

SaveTurf , LoadTurf

Public Or STOCK which creates file that saves and loads GANGZONES . We can't help you with the code you gave us, everything is right in that code. Paste the save , load system and i might help you.
Reply
#3

With SAMP's file writing/reading system.
You could also use y_ini or SQL, which is faster, you should ****** about some tutorials on what you wish to use.
Reply
#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
#5

If you're looking for people to do it for you, rather than help, go here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)