wasik95
[KST]
Wiek: 31 Na forum: 5345 dni Posty: 63
Nick w MP: W_A_S_I_K
Piwa : 12
A wi?c tak w mapie mam zdefiniowane:
Kod:
#define MAX_TEAMS 100
#define MAX_CARS 600
#define MAX_HOUSES 500
#define MAX_INTERIORS 15
#define MAX_VIA 10000
#define MAX_WEIGHT_POINTS 100
#define MAX_LOADING_POINTS 100
#define MAX_SCRIPT_VEHICLES 100
#define MAX_PETROL_POINTS 100
#undef MAX_PLAYERS
#define MAX_PLAYERS 50
#undef MAX_VEHICLES
#define MAX_VEHICLES MAX_CARS+(MAX_PLAYERS*3)
Jak widac MAX _CARS 600 jednak?e gdy dodam powyzej 60 AUT one blokuja dalsz? rozgrywk?. W scriptfiles mam folder gdzie zapisuj? si? oba auta
Wszystko co zwi?zane z MAX_CARS
Kod:
new sVehInfo[MAX_CARS][sVInfo];
Loop(i, MAX_CARS)
{
if(fexist(cfile(i)))
{
if(djFloat(cfile(i), "x") != 0)
{
printf("Pojazd UID %d za?adowany", i);
CreateVeh(djInt(cfile(i), "model"), djFloat(cfile(i), "x"), djFloat(cfile(i), "y"), djFloat(cfile(i), "z"), djFloat(cfile(i), "a"), djInt(cfile(i), "color1"), djInt(cfile(i), "color2"), djInt(cfile(i), "team"), dj(cfile(i), "owner"), djFloat(cfile(i), "distance"), djFloat(cfile(i), "fixdistance"), djInt(cfile(i), "fuel"), djInt(cfile(i), "tirehp"), i);
}
}
}
public OnGameModeExit()
{
Loop(uid, MAX_CARS)
{
new vehicleid = sVehInfo[uid][sVID];
if(vehicleid != 0)
{
djSetFloat(cfile(uid), "distance", vehInfo[vehicleid][vDistance]);
djSetInt(cfile(uid), "tirehp", vehInfo[vehicleid][vTireHP]);
djSetInt(cfile(uid), "color1", sVehInfo[uid][sColor1]);
djSetInt(cfile(uid), "color2", sVehInfo[uid][sColor2]);
djSetInt(cfile(uid), "fuel", vehInfo[vehicleid][vFuel]);
djSetFloat(cfile(uid), "fixdistance", vehInfo[vehicleid][vFixDistance]);
}
}
djson_GameModeExit();
return 1;
}
forward SaveVehicles();
public SaveVehicles()
{
Loop(uid, MAX_CARS)
{
new vehicleid = sVehInfo[uid][sVID];
if(vehicleid != 0)
{
djSetFloat(cfile(uid), "distance", vehInfo[vehicleid][vDistance]);
djSetInt(cfile(uid), "tirehp", vehInfo[vehicleid][vTireHP]);
djSetInt(cfile(uid), "color1", sVehInfo[uid][sColor1]);
djSetInt(cfile(uid), "color2", sVehInfo[uid][sColor2]);
djSetInt(cfile(uid), "fuel", vehInfo[vehicleid][vFuel]);
djSetFloat(cfile(uid), "fixdistance", vehInfo[vehicleid][vFixDistance]);
}
}
return 1;
}
To by by?o na tyle. Mo?e jaki? include od sscanf'a ? Prosze o jak najszybsz? odpowied?