30.05.2014, 14:15
pawn Код:
stock CreateVehicleForPlayer(model, owner[], Float: x, Float: y, Float: z, Float:a)
{
new query[512], vehicleid;
format(query, sizeof(query), "INSERT INTO Vehicles (Owner, CarX, CarY, CarZ, CarA, Model, Color1, Color2, Faction, Plate, Paintjob, Locked, Sell) VALUES ('%s', '%f', '%f', '%f', '%f', '%d', '-1', '-1', '-1', 'NOTREG', '-1', '1', '0')", owner, x, y, z, a, model);
mysql_query(query);
mysql_free_result();
vehicleid = CreateVehicle(model, x, y, z, a, -1, -1, -1);
vInfo[vehicleid][Model] = model;
myStrcpy(vInfo[vehicleid][Owner], owner);
myStrcpy(vInfo[vehicleid][Plate], "NOTREG");
vInfo[vehicleid][vColor1] = -1;
vInfo[vehicleid][vColor2] = -1;
vInfo[vehicleid][Paintjob] = -1;
vInfo[vehicleid][Locked] = 1;
vInfo[vehicleid][Faction] = -1;
vInfo[vehicleid][vPosX] = x;
vInfo[vehicleid][vPosY] = y;
vInfo[vehicleid][vPosZ] = z;
vInfo[vehicleid][vPosA] = a;
SetVehicleNumberPlate(vehicleid, vInfo[vehicleid][Plate]);
SetVehicleToRespawn(vehicleid);
return 1;
}