Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------WhenCheckVehicle
- public WhenVehCheck1(eent)
- {
- new query[254];
- cache_get_data(rows, fields, handle);
- cache_get_field_content(0, "ID", temp), VehiclesInfo[eent][vID] = strval(temp);
- cache_get_field_content(0, "Model", temp), VehiclesInfo[eent][vModel] = strval(temp);
- cache_get_field_content(0, "PositionX", temp), VehiclesInfo[eent][vPositionX] = floatstr(temp);
- cache_get_field_content(0, "PositionY", temp), VehiclesInfo[eent][vPositionY] = floatstr(temp);
- cache_get_field_content(0, "PositionZ", temp), VehiclesInfo[eent][vPositionZ] = floatstr(temp);
- cache_get_field_content(0, "Angle", temp), VehiclesInfo[eent][vAngle] = floatstr(temp);
- cache_get_field_content(0, "Color1", temp), VehiclesInfo[eent][vColor1] = strval(temp);
- cache_get_field_content(0, "Color2", temp), VehiclesInfo[eent][vColor2] = strval(temp);
- cache_get_field_content(0, "PaintJob", temp), VehiclesInfo[eent][vPaintJob] = strval(temp);
- cache_get_field_content(0, "Owner", temp), VehiclesInfo[eent][vOwner] = strval(temp);
- cache_get_field_content(0, "Lock", temp), VehiclesInfo[eent][vLock] = strval(temp);
- cache_get_field_content(0, "KM", temp), VehiclesInfo[eent][vKM] = strval(temp);
- cache_get_field_content(0, "Days", temp), VehiclesInfo[eent][vDays] = strval(temp);
- cache_get_field_content(0, "NumberPlate", temp), VehiclesInfo[eent][vNumberPlate] = sizeof(temp);
- cache_get_field_content(0, "Component1", temp), VehiclesInfo[eent][vComponent1] = strval(temp);
- cache_get_field_content(0, "Component2", temp), VehiclesInfo[eent][vComponent2] = strval(temp);
- cache_get_field_content(0, "Component3", temp), VehiclesInfo[eent][vComponent3] = strval(temp);
- cache_get_field_content(0, "Component4", temp), VehiclesInfo[eent][vComponent4] = strval(temp);
- cache_get_field_content(0, "Component5", temp), VehiclesInfo[eent][vComponent5] = strval(temp);
- cache_get_field_content(0, "Component6", temp), VehiclesInfo[eent][vComponent6] = strval(temp);
- cache_get_field_content(0, "Component7", temp), VehiclesInfo[eent][vComponent7] = strval(temp);
- cache_get_field_content(0, "Component8", temp), VehiclesInfo[eent][vComponent8] = strval(temp);
- cache_get_field_content(0, "Component9", temp), VehiclesInfo[eent][vComponent9] = strval(temp);
- cache_get_field_content(0, "Component10", temp), VehiclesInfo[eent][vComponent10] = strval(temp);
- cache_get_field_content(0, "Component11", temp), VehiclesInfo[eent][vComponent11] = strval(temp);
- cache_get_field_content(0, "Component12", temp), VehiclesInfo[eent][vComponent12] = strval(temp);
- cache_get_field_content(0, "Component13", temp), VehiclesInfo[eent][vComponent13] = strval(temp);
- cache_get_field_content(0, "Component14", temp), VehiclesInfo[eent][vComponent14] = strval(temp);
- cache_get_field_content(0, "Component15", temp), VehiclesInfo[eent][vComponent15] = strval(temp);
- cache_get_field_content(0, "Component16", temp), VehiclesInfo[eent][vComponent16] = strval(temp);
- cache_get_field_content(0, "Component17", temp), VehiclesInfo[eent][vComponent17] = strval(temp);
- cache_get_field_content(0, "ServerID", temp), VehiclesInfo[eent][vServerID] = strval(temp);
- cache_get_field_content(0, "Slot", temp), VehiclesInfo[eent][vSlot] = strval(temp);
- VehiclesInfo[eent][vServerID] = CreateVehicle(VehiclesInfo[eent][vModel],VehiclesInfo[eent][vPositionX],VehiclesInfo[eent][vPositionY],VehiclesInfo[eent][vPositionZ],VehiclesInfo[eent][vAngle],VehiclesInfo[eent][vColor1],VehiclesInfo[eent][vColor2],60000);
- mysql_format(handle, query, sizeof(query), "UPDATE `vehicles` SET ServerID = %i WHERE ID = %i LIMIT 1", VehiclesInfo[eent][vServerID], VehiclesInfo[eent][vID]);
- mysql_query(handle, query);
- Tunen(VehiclesInfo[eent][vServerID]);
- printf("!!: %i", VehiclesInfo[eent][vServerID]); // debugging.
- return 1;
- }
- ---------------------------------Tunen
- public Tunen(vehicleid)
- {
- new v = vehicleid;
- if(VehiclesInfo[v][vComponent1]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent1]); }
- if(VehiclesInfo[v][vComponent2]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent2]); }
- if(VehiclesInfo[v][vComponent3]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent3]); }
- if(VehiclesInfo[v][vComponent4]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent4]); }
- if(VehiclesInfo[v][vComponent5]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent5]); }
- if(VehiclesInfo[v][vComponent6]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent6]); }
- if(VehiclesInfo[v][vComponent7]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent7]); }
- if(VehiclesInfo[v][vComponent8]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent8]); }
- if(VehiclesInfo[v][vComponent9]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent9]); }
- if(VehiclesInfo[v][vComponent10]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent10]); }
- if(VehiclesInfo[v][vComponent11]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent11]); }
- if(VehiclesInfo[v][vComponent12]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent12]); }
- if(VehiclesInfo[v][vComponent13]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent13]); }
- if(VehiclesInfo[v][vComponent14]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent14]); }
- if(VehiclesInfo[v][vComponent15]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent15]); }
- if(VehiclesInfo[v][vComponent16]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent16]); }
- if(VehiclesInfo[v][vComponent17]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent17]); }
- if(VehiclesInfo[v][vColor1] != 0 || VehiclesInfo[v][vColor2] != 0)
- {
- ChangeVehicleColor(vehicleid,VehiclesInfo[v][vColor1],VehiclesInfo[v][vColor2]);
- }
- if(VehiclesInfo[v][vPaintJob]!=0) { ChangeVehiclePaintjob(vehicleid,VehiclesInfo[v][vPaintJob]); }
- }
Advertisement
Add Comment
Please, Sign In to add comment