Load car tuning
#1

Car have this: (Mod17=1029, Mod8=1036, etc) at tabel (after tuned) [working].. but after server restarting car isn't tuned. Why?

At LoadCar func.

Код:
		AddStaticVehicleEx(bla bla...);
		if(CarInfo[idx][cPaintjob]!=0) { ChangeVehiclePaintjob(idx,CarInfo[idx][cPaintjob]); }
		if(CarInfo[idx][cMod1]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod1]); }
		if(CarInfo[idx][cMod2]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod2]); }
		if(CarInfo[idx][cMod3]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod3]); }
		if(CarInfo[idx][cMod4]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod4]); }
		if(CarInfo[idx][cMod5]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod5]); }
		if(CarInfo[idx][cMod6]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod6]); }
		if(CarInfo[idx][cMod7]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod7]); }
		if(CarInfo[idx][cMod8]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod8]); }
		if(CarInfo[idx][cMod9]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod9]); }
		if(CarInfo[idx][cMod10]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod10]); }
		if(CarInfo[idx][cMod11]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod11]); }
		if(CarInfo[idx][cMod12]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod12]); }
		if(CarInfo[idx][cMod13]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod13]); }
		if(CarInfo[idx][cMod14]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod14]); }
		if(CarInfo[idx][cMod15]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod15]); }
		if(CarInfo[idx][cMod16]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod16]); }
		if(CarInfo[idx][cMod17]!=0) { AddVehicleComponent(idx,CarInfo[idx][cMod17]); }
Reply
#2

Topic up. (Topic was in 2 pages)
Reply
#3

U must save into file?
Reply
#4

No. Im using mySQL.

Theres tabel was Mod17=1082, etc... I restarting server and still car isn't tuned. Why?
Reply
#5

I cant understand isnt it woking at all? Or just tuning is gone after server restart?
Try to use printf() to find out if all variables are correct.
Like:
pawn Код:
printf("Vehicle id: %d and VehicleComponent: %d",idx,CarInfo[idx][cMod1]);
Most likely your componentIDs are not loaded properly, and they are 0.
Reply
#6

0 = Not tuned

thats why:
if(CarInfo[idx][cMod1]!=0) {

Car isnt still tuned after server restart...

But.. car had this..

Reply
#7

If you are using mysql, are you reading the information from the database at all in the script? If not, I think that might be why it's not changing anything. Look over it and see if you can figure out how to read info from the DB, if that is the problem.
Reply
#8

Quote:
Originally Posted by Hiitch
Посмотреть сообщение
If you are using mysql, are you reading the information from the database at all in the script? If not, I think that might be why it's not changing anything. Look over it and see if you can figure out how to read info from the DB, if that is the problem.
Sorry, im not begginer scripter.

Added picture..
Reply
#9

Quote:
Originally Posted by Typhome
Посмотреть сообщение
Sorry, im not begginer scripter.

Added picture..
-Are you saying you are a beginner scripter, or you aren't?

Anyways, let me try to break it down for you.

If you store any information to mysql for whatever reason, at a time you might want the gamemode to read the information from the mysql, in this case it is the vehicle mods.

You need to create something so when the gamemode is started, it gets (loads) the information from the mysql, and gives the vehicle its mods. I am not 100% sure how you do this, as I haven't done anything in mysql for a while. Do you understand it now?
Reply
#10

Quote:
Originally Posted by Typhome
Посмотреть сообщение
0 = Not tuned

thats why:
if(CarInfo[idx][cMod1]!=0) {
yes, i understand.
Same question in different way: Are you sure you are loading every variable correctly and to correct car id in an array?
What i mean is that your component id may be in wrong place or not loaded at all.
Code you posted doesnt really tell anything about the reason.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)