[POMOC] Vozila

Započeo ThE P.A.W.n !, Avgust 05, 2012, 23:30:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 6 gostiju pregledaju ovu temu.

Skripta koju koristim: Privatna.
Detaljan opis problema: Ubacio sam COS(Car owner ship) sistem iz GTA:RP-a,sve sam lepo prebacio,i sad kad u OnGameModeInit stavim LoadCar(); ( ima public LoadCar() ubacen !!) i upload,restart server,pise mi ono Mod: Unknow | Map: SanAndreas,ne ucita ni jedne komande,mape,vozila nista,a kad izbacim iz OnGameModeInit LoadCar(); , onda sve lepo radi.
Dio skripte: http://pastebin.com/s5z5xDNt

enum cInfo
{
cModel,
Float:cLocationx,
Float:cLocationy,
Float:cLocationz,
Float:cAngle,
cColorOne,
cColorTwo,
cOwner[MAX_PLAYER_NAME],
cDescription[MAX_PLAYER_NAME],
cValue,
cLicense,
cRegistration,
cOwned,
cLock
};
new CarInfo[430][cInfo]; // broj vozila za poslove,org(346 + 84 vozila koji se nalaze u cars.cfg)


forward LoadCar();
public LoadCar()
{
new arrCoords[13][256];
new strFromFile2[256];
new File: file = fopen("cfg/cars.cfg", io_read);
if (file)
{
new idx = 346; // odavde krecu vozila,ovo unazad su od org,poslova....
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
CarInfo[idx][cLicense] = strval(arrCoords[10]);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
printf("ID: %d || Vlasnik: %d",idx,CarInfo[idx][cOwner]);
idx++;
}
}
return 1;
}

// public OnPropUpdate

idx = 346;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d\n",
CarInfo[idx][cModel],//
CarInfo[idx][cLocationx],//
CarInfo[idx][cLocationy],//
CarInfo[idx][cLocationz],//
CarInfo[idx][cAngle],//
CarInfo[idx][cColorOne],//
CarInfo[idx][cColorTwo],//
CarInfo[idx][cOwner],//
CarInfo[idx][cDescription],//
CarInfo[idx][cValue],//
CarInfo[idx][cLicense],//
CarInfo[idx][cOwned],//
CarInfo[idx][cLock]);
if(idx == 346)
{
file2 = fopen("cfg/cars.cfg", io_write);
}
else
{
file2 = fopen("cfg/cars.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}

Capetroon.

Provjeri da li u scriptfiles imaš pluginse i dodaj na njih .so znači trebalo bi da bude ovako streamer.so sscanf.so itd.

Citat: Capetroon. poslato Avgust 05, 2012, 23:52:45 POSLE PODNE
Provjeri da li u scriptfiles imaš pluginse i dodaj na njih .so znači trebalo bi da bude ovako streamer.so sscanf.so itd.

Imam sve,rekao sam ti,bez ovoga LoadCar(); radi,a sa tim ne radi,citaj malo sta pise i ne spamuj ako ne znas,pluginsi se nalaze u PLUGINS folderu a ne u scriptfiles.

Citat: Chris_King poslato Avgust 06, 2012, 00:09:39 PRE PODNE
daj mi Public Loadcar cijeli


forward LoadCar();
public LoadCar()
{
new arrCoords[13][256];
new strFromFile2[256];
new File: file = fopen("cfg/cars.cfg", io_read);
if (file)
{
new idx = 346; // odavde krecu vozila,ovo unazad su od org,poslova....
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
CarInfo[idx][cLicense] = strval(arrCoords[10]);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
printf("ID: %d || Vlasnik: %d",idx,CarInfo[idx][cOwner]);
idx++;
}
}
return 1;
}


Citat: Chris_King poslato Avgust 06, 2012, 00:39:12 PRE PODNE
Jesi stavio LoadCar();  pod public OnGameModeInit()

Citaj lepo gore,pise ti da jesam.

Citat: Chris_King poslato Avgust 06, 2012, 14:42:11 POSLE PODNE
daj mi sve od ovog public OnGameModeInit()

Ako si na ovo mislio:

        for(new h = 347; h < sizeof(CarInfo); h++)
{
AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
}