ORM Pos not update! [++REP] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ORM Pos not update! [++REP] (
/showthread.php?tid=589553)
ORM Pos not update! [++REP] -
norton2 - 20.09.2015
Position in not updating in database!
Код HTML:
Veh[vehicleid][ID] = cache_insert_id();
new Float: vp[3][4] = {
{ 238.5601,-1536.6544,24.2187,53.8474 },
{ 188.0786,-1522.2850,24.2187,234.5494 },
{ 897.5580,-2508.5419,24.2187,235.4181 } }, Float:vehx, Float:vehy, Float:vehz, Float:z_rot;
new rand = random(sizeof(vp));
new did = Veh[vehicleid][ID];
Veh[did][ServerID] = CreateVehicle(dmodelid[playerid], vp[rand][0], vp[rand][1], vp[rand][2], vp[rand][3], 1, 1, -1);
GetVehiclePos(Veh[did][ServerID], vehx, vehy, vehz); GetVehicleZAngle(Veh[did][ServerID], z_rot);
Veh[did][PosX] = vehx;
Veh[did][PosY] = vehy;
Veh[did][PosZ] = vehz;
Veh[did][VAngle] = z_rot;
printf("%f %f %f %f", vehx, vehy, vehz, z_rot);// DEBUG
orm_update(Veh[did][ORM_ID]);
DEBUG LOG:
Код HTML:
188.0786,-1522.2850,24.2187,234.5494
Re: ORM Pos not update! [++REP] -
Jefff - 20.09.2015
pawn Код:
Veh[vehicleid][ID] = cache_insert_id();
static const Float:vp[][] =
{
{ 238.5601,-1536.6544,24.2187,53.8474 },
{ 188.0786,-1522.2850,24.2187,234.5494 },
{ 897.5580,-2508.5419,24.2187,235.4181 }
};
new rand = random(sizeof(vp));
new did = Veh[vehicleid][ID];
Veh[did][ServerID] = CreateVehicle(dmodelid[playerid], vp[rand][0], vp[rand][1], vp[rand][2], vp[rand][3], 1, 1, -1);
Veh[did][PosX] = vp[rand][0];
Veh[did][PosY] = vp[rand][1];
Veh[did][PosZ] = vp[rand][2];
Veh[did][VAngle] = vp[rand][3];
orm_update(Veh[did][ORM_ID]);