30.05.2014, 14:12
Hello people, I want to ask for help. I need help in creating vehicles.
Here is my script:
You can see vehicleid in every brackets. How I should define the vehicleid here?
Here is my script:
Код:
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(); 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; CreateVehicle(vInfo[vehicleid][Model], vInfo[vehicleid][vPosX], vInfo[vehicleid][vPosY], vInfo[vehicleid][vPosZ], vInfo[vehicleid][vPosA], vInfo[vehicleid][vColor1], vInfo[vehicleid][vColor2], -1); SetVehicleNumberPlate(vehicleid, vInfo[vehicleid][Plate]); SetVehicleToRespawn(vehicleid); return 1; }