Jump to content

Problema spawnarea vehiculelor din comanda /sfv


Recommended Posts

Posted
for(new y; y <= 5; y++) {
		for(new v = 1; v <= cache_num_rows(); v++) {
				fVehicle[v][y][vfID] 				= cache_get_field_content_int(v, "factionID");
				fVehicle[v][y][vfRank]				= cache_get_field_content_int(v, "VehRank");
				fVehicle[v][y][vfVehID]				= cache_get_field_content_int(v, "VehID");
				fVehicle[v][y][vfStock]				= cache_get_field_content_int(v, "Stock");
				fVehicle[v][y][vfColor1]			= cache_get_field_content_int(v, "Color1");
				fVehicle[v][y][vfColor2]			= cache_get_field_content_int(v, "Color2");
		}
	}

Daca in for-ul asta din LoadVehicles y = factiune si v = vehicul, atunci va trebui sa adaugi vehiculele asa: fVehicle[y][v][vfId] (la fel pt fiecare proprietate).  Dar oricum nu o sa iti mearga cum te astepti, trebuie sa tii cont de factionId-ul ala venit din DB, ca tu acum adaugi toate vehiculele la toate factiunile (de ex. la pd iti adauga masini de la taxi, paramedic, ...) si am vazut ca in dialog te folosesti de listitem, s-ar putea sa iti dea o masina de la alta factiune. Si incearca sa nu mai folosesti query pe masini in comanda, le ai deja salvate, foloseste-te de ele si mai adauga chestii in DB daca ai nevoie.

 
Posted

Ai incurcat cu totul stocarea si incerci sa accesezi gresit acele array-uri. Nu inteleg de ce mai extragi odata datele la /fveh daca le-ai incarcat deja la pornirea serverului (probabil).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.

moduri samp