Jump to content
  • 0

Problema masini personale


AndrewTG01

Question

Problema intalnita (descriere): Am adaugat pe server un sistem de masini personale , creez o masina , o cumpar si daca ies de pe server , il inchid si intru iar id-ul masinii se face 1 si nu mai este masina mea personala.
Ero(area / rile) / warning-(ul / urile): Nu primesc erori sau warning-uri
Liniile de cod / sursa / script-ul(obligatoriu): -
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  Da

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0
35 minutes ago, AndrewTG01 said:

Problema intalnita (descriere): Am adaugat pe server un sistem de masini personale , creez o masina , o cumpar si daca ies de pe server , il inchid si intru iar id-ul masinii se face 1 si nu mai este masina mea personala.
Ero(area / rile) / warning-(ul / urile): Nu primesc erori sau warning-uri
Liniile de cod / sursa / script-ul(obligatoriu): -
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  Da

Din păcate în visul meu de aseară nu ti.am văzut scriptul, si nici azi la observator nu a dat nimic.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 hour ago, AndrewTG01 said:

Problema intalnita (descriere): Am adaugat pe server un sistem de masini personale , creez o masina , o cumpar si daca ies de pe server , il inchid si intru iar id-ul masinii se face 1 si nu mai este masina mea personala.
Ero(area / rile) / warning-(ul / urile): Nu primesc erori sau warning-uri
Liniile de cod / sursa / script-ul(obligatoriu): -
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  Da

Arată.mi LoadCars, sau cum încarci tu mașinile din baza de date.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
public LoadCar()
{
	new arrCoords[31][64];
	new strFromFile2[256];
	new File: file = fopen("cars.cfg", io_read);
	if (file)
	{
		new idx = carsonserver;
		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]);
			strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255);
			CarInfo[idx][cOwned] = strval(arrCoords[11]);
			CarInfo[idx][cLock] = strval(arrCoords[12]);
			CarInfo[idx][mod1] = strval(arrCoords[13]);
			CarInfo[idx][mod2] = strval(arrCoords[14]);
			CarInfo[idx][mod3] = strval(arrCoords[15]);
			CarInfo[idx][mod4] = strval(arrCoords[16]);
			CarInfo[idx][mod5] = strval(arrCoords[17]);
			CarInfo[idx][mod6] = strval(arrCoords[18]);
			CarInfo[idx][mod7] = strval(arrCoords[19]);
			CarInfo[idx][mod8] = strval(arrCoords[20]);
			CarInfo[idx][mod9] = strval(arrCoords[21]);
			CarInfo[idx][mod10] = strval(arrCoords[22]);
			CarInfo[idx][mod11] = strval(arrCoords[23]);
			CarInfo[idx][mod12] = strval(arrCoords[24]);
			CarInfo[idx][mod13] = strval(arrCoords[25]);
			CarInfo[idx][mod14] = strval(arrCoords[26]);
			CarInfo[idx][mod15] = strval(arrCoords[27]);
			CarInfo[idx][mod16] = strval(arrCoords[28]);
			CarInfo[idx][mod17] = strval(arrCoords[29]);
			CarInfo[idx][paintjob] = strval(arrCoords[30]);
			printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
			idx++;
		}
	}
	return 1;
}

 

Link to comment
Share on other sites

  • 0
Just now, AndrewTG01 said:
public LoadCar()
{
	new arrCoords[31][64];
	new strFromFile2[256];
	new File: file = fopen("cars.cfg", io_read);
	if (file)
	{
		new idx = carsonserver;
		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]);
			strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255);
			CarInfo[idx][cOwned] = strval(arrCoords[11]);
			CarInfo[idx][cLock] = strval(arrCoords[12]);
			CarInfo[idx][mod1] = strval(arrCoords[13]);
			CarInfo[idx][mod2] = strval(arrCoords[14]);
			CarInfo[idx][mod3] = strval(arrCoords[15]);
			CarInfo[idx][mod4] = strval(arrCoords[16]);
			CarInfo[idx][mod5] = strval(arrCoords[17]);
			CarInfo[idx][mod6] = strval(arrCoords[18]);
			CarInfo[idx][mod7] = strval(arrCoords[19]);
			CarInfo[idx][mod8] = strval(arrCoords[20]);
			CarInfo[idx][mod9] = strval(arrCoords[21]);
			CarInfo[idx][mod10] = strval(arrCoords[22]);
			CarInfo[idx][mod11] = strval(arrCoords[23]);
			CarInfo[idx][mod12] = strval(arrCoords[24]);
			CarInfo[idx][mod13] = strval(arrCoords[25]);
			CarInfo[idx][mod14] = strval(arrCoords[26]);
			CarInfo[idx][mod15] = strval(arrCoords[27]);
			CarInfo[idx][mod16] = strval(arrCoords[28]);
			CarInfo[idx][mod17] = strval(arrCoords[29]);
			CarInfo[idx][paintjob] = strval(arrCoords[30]);
			printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
			idx++;
		}
	}
	return 1;
}

 

Arată carsonserver

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 minute ago, AndrewTG01 said:
new carsonserver = 123;

 

pune în loc de sizeof(CarInfo) pu e <= MAX_VEHICLES

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 minute ago, AndrewTG01 said:

la fel..

In primul rand explică.mi ce vrea să însemne carsonserver

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 hour ago, AndrewTG01 said:

carsonserver arata cate masini sunt pe server create cu CreateVehicle AddStaticVehicle, eu am 122 + 1 care trebuie adaugat adica 123

While  înlocuiește cu asta:

for(new i = 0;i<=MAX_VEHICLES;I++)

SI STERGI NEW idx = carsonserver

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
17 minutes ago, AndrewTG01 said:

Am sa incerc si asta , mersi de sfat. (nu am lucrat cu mysql deci nu stiu cum se trece de pe normal pe mysql ...)

Câte linii are gm.ul tău?

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.