CMD:vmove(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(PlayerInfo[playerid][pAdmin] >= 6)
{
new str[256];
for(new x = 0; x < MAX_VEHICLES; x++)
{
if(VehicleInfo[x][vehCarID] == GetPlayerVehicleID(playerid))
{
GetVehiclePos(x, Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(x, Angle);
GetVehiclePos(VehicleInfo[x][vehCarID], VehicleInfo[x][vehPosX], VehicleInfo[x][vehPosY], VehicleInfo[x][vehPosZ]);
GetVehicleZAngle(VehicleInfo[x][vehCarID], VehicleInfo[x][vehRotation]);
mysql_format(SQL,str,sizeof(str),"UPDATE vehicles SET `PosX`='%f',`PosY`='%f',`PosZ`='%f',`Rotation`='%f' WHERE `ID`='%d'",VehicleInfo[x][vehPosX],VehicleInfo[x][vehPosY],VehicleInfo[x][vehPosZ],VehicleInfo[x][vehRotation],VehicleInfo[x][vehCarIDD]);
mysql_tquery(SQL,str,"","");
VehicleInfo[x][vehPosX] = Pos[0];
VehicleInfo[x][vehPosY] = Pos[1];
VehicleInfo[x][vehPosZ] = Pos[2];
VehicleInfo[x][vehRotation] = Angle;
SendClientMessage(playerid, COLOR_YELLOW, "Vehicle position changed.");
return 1;
}
}
}
else return SendClientMessage(playerid, COLOR_LIGHTGREEN3, AdminOnly);
return 1;
}