24.12.2012, 19:19
pawn Код:
stock GetVehiclePAWNData(const vehicleid)
{
new TempStr[650];
new Float:_Pos[3],
Float:_Angle;
GetVehiclePos(vehicleid, _Pos[0], _Pos[1], _Pos[2]);
GetVehicleZAngle(vehicleid, _Angle);
format(TempStr, 130, "new const v = CreateVehicle(%d, %f, %f, %f, %f, COLOUR_1, COLOUR_2, RESPAWN_TIME);", GetVehicleModel(vehicleid), _Pos[0], _Pos[1], _Pos[2], _Angle);
new TempLine[60], c;
new const SlotName[14][24] =
{
"CARMODTYPE_SPOILER",
"CARMODTYPE_HOOD",
"CARMODTYPE_ROOF",
"CARMODTYPE_SIDESKIRT",
"CARMODTYPE_LAMPS",
"CARMODTYPE_NITRO",
"CARMODTYPE_EXHAUST",
"CARMODTYPE_WHEELS",
"CARMODTYPE_STEREO",
"CARMODTYPE_HYDRAULICS",
"CARMODTYPE_FRONT_BUMPER",
"CARMODTYPE_REAR_BUMPER",
"CARMODTYPE_VENT_RIGHT",
"CARMODTYPE_VENT_LEFT"
};
for(new i = 0; i < 14; i++)
{
c = GetVehicleComponentInSlot(vehicleid, i);
if(c != 0)
{
format(TempLine, 60, "\r\nAddVehicleComponent(v, %d); // %s", c, SlotName[i]);
strcat(TempStr, TempLine);
}
}
return TempStr;
}
Код:
new const v = CreateVehicle(600, 2394.272705, 1034.542236, 10.514182, 140.348159, COLOUR_1, COLOUR_2, RESPAWN_TIME); AddVehicleComponent(v, 1004); // CARMODTYPE_HOOD AddVehicleComponent(v, 1006); // CARMODTYPE_ROOF AddVehicleComponent(v, 1007); // CARMODTYPE_SIDESKIRT AddVehicleComponent(v, 1013); // CARMODTYPE_LAMPS AddVehicleComponent(v, 1010); // CARMODTYPE_NITRO AddVehicleComponent(v, 1020); // CARMODTYPE_EXHAUST AddVehicleComponent(v, 1097); // CARMODTYPE_WHEELS AddVehicleComponent(v, 1087); // CARMODTYPE_HYDRAULICS